Saturday, 16 July 2016

Getting a network trace from a single application

I recently wanted a way to get a network packet trace from a specific application. My googling showed me an old askubuntu thread that solved this by using Linux network namespaces.

You create a new network namespace, that will be isolated from your regular network, you use a virtual network interface and iptables to make the traffic from it reach your regular network. Then you start an application and wireshark in that namespace and then you have a trace of that application.

I took that idea and made it into a small program, hosted on github, nsntrace.

> nsntrace
usage: nsntrace [-o file] [-d device] [-u username] PROG [ARGS]
Perform network trace of a single process by using network namespaces.

-o file     send trace output to file (default nsntrace.pcap)
-d device   the network device to trace
-u username run PROG as username 

It does pretty much the same as the askubuntu thread above describes but with just one step.

> sudo nsntrace -d eth1 wget www.google.com
Starting network trace of 'wget' on interface eth1.
Your IP address in this trace is 172.16.42.255.
Use ctrl-c to end at any time.

--2016-07-15 12:12:17--  http://www.google.com/
Location: http://www.google.se/?gfe_rd=cr&ei=AbeIV5zZHcaq8wfTlrjgCA [following]
--2016-07-15 12:12:17--  http://www.google.se/?gfe_rd=cr&ei=AbeIV5zZHcaq8wfTlrjgCA
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html                                         [ <=>                                                                                                   ]  10.72K  --.-KB/s   in 0.001s 

2016-07-15 12:12:17 (15.3 MB/s) - ‘index.html’ saved [10980]

Finished capturing 42 packets.

> tshark -r nsntrace.pcap -Y 'http.response or http.request'
16   0.998839 172.16.42.255 -> 195.249.146.104    HTTP 229 GET http://www.google.com/ HTTP/1.1
20   1.010671    195.249.146.104 -> 172.16.42.255 HTTP 324 HTTP/1.1 302 Moved Temporarily  (text/html)
22   1.010898 172.16.42.255 -> 195.249.146.104    HTTP 263 GET http://www.google.se/?gfe_rd=cr&ei=AbeIV5zZHcaq8wfTlrjgCA HTTP/1.1
31   1.051006    195.249.146.104 -> 172.16.42.255 HTTP 71 HTTP/1.1 200 OK  (text/html)

If it is something you might have use for or find interesting, please check it out, and help out with patches. It turns out I have a lot to learn about networking and networking code.

All the best!

Maps and tiles

Hello all!

Right now we are having infrastructural problems with Maps. We can no longer use the MapQuest tiles, see mail thread from maps list archive here for more information.

We are working on getting past this and getting a working Maps application released soon. But this is also showing us more clear that we need to get a better grip around the tiles infrastructure if we want to have a Map application and/or a Map infrastructure in GNOME. We are having good discussions and I think we will get through this with a nice plan forward to prevent stuff like this happening. And also with a plan to do better in the future and do cooler stuff with tiles.

All the best!

Tuesday, 1 March 2016

Walkthrough of Maps 3.20 release notes

We have now entered beta period for GNOME 3.20 and the release notes for Maps are starting to look final.

This blog post will expand a bit on the official release notes, adding screenshots and some reasoning to most of the items.

Map bubble re-work

For this cycle we wanted to add some more meta-data to our small map bubbles. But at the same time we thought that the bubbles were kind of cluttered.


So we added a way to expand the bubble, so that we show the minimum amount of information by default. And only show more if user presses the more information dots.


This is sort of a stop-gap feature. For 3.22 we want to do a more ambitious re-design of how we show information about a place on the map.

For this release we added website, phone number, internet access and altitude information, if available, to our map bubbles.

Editing items on OpenStreetMap

One of the things I am most excited about in this release of Maps is the ability to edit and add places on OpenStreetMap. It is due to most awesome work by Marcus Lundbladh. We now have an edit symbol on our map bubbles. If you press it you will be prompted for your OpenStreetMap credentials. Or a link to where you can set up an account.



After that you get an editor view where you can update the object on OpenStreetMap.




It is also possible to add a new node to OpenStreetmap.
By using the map context menu and choosing Add to OpenStreetMap.

Printing of routes

Due to excellent work from our Outreachy intern Amisha we managed to land printing of routes this cycle. This is something we have wanted for a while. It helps us cover some of the offline niche. You can search for a route at home, print to paper or PDF and bring that with you on a journey where you do not have access to net.


When you have successfully search for a route a print icon will appear in Maps header bar. From there one can initiate printing.


Right now you will get one of two print layouts, depending on the distance of the route. The image above is of the long route layout.

Adding of custom map layers

Hashem, another one of our Outreachy interns, has contributed a lot to Maps this cycle. A lot of small details here and there. The most visible contribution is support for KML and GPX layers, as well as an UI to handle them in Maps.

Maps now registers as a handler for the mime-types of GeoJSON, KML and GPX. Which means that Maps will be a suggestion from GNOME when you attempt to open files of those types on the web or on the desktop.


It is possible to open layers through the UI, the command line and through drag and drop to an open Maps window.

For GeoJSON we also support the Mapbox simple style specification.

Scale ruler


A minor change UI wise and code wise, but one that was requested for some time was merged this cycle. The adding of a scale ruler to Maps. It is visible in the bottom left corner of the images above.

Exporting of view to PNG

The library that contains our map widget, libchamplain got support for exporting a view to a cairo_surface. That meant that we could implement the feature of exporting to PNG quite easily.


This is triggered by the map context menu.

Handling geo: URI

The geo URI scheme is a way of linking to a certain location. Maps is now registered as a handler of this URI. So if you encounter it in the wild, say in your web browser. Try to click it and Maps should be your suggested agent for it.

We can also get a geo URI from Maps, by using the Copy Location item in the map context menu. It is also possible to paste or enter a geo URI in the Maps search bar to have Maps go to the location, or give one on Maps command line.

Help overlay

Along with many other GNOME apps we added a help overlay to show our shortcut bindings.



Monday, 4 January 2016

Maps and Outreachy

Outreachy is the successor of the Outreach Program for Women (OPW). OPW was inspired by Google Summer of Code and by how few women applied for it.

The program was renamed to Outreachy with the goal of expanding to engage people from various underrepresented groups and was moved to Software Freedom Conservancy as its organizational home.

For this period (December 2015 - March 2016) Maps has two Outreachy interns!

Amisha Singla will be working on adding the possibility of printing the route in Maps. Working towards the preliminary mockups done by Andreas Nilsson

Her blog has been connected to Planet GNOME but to see her earlier blog post please se the direct link here.


Hashem Nasarat will be working on bringing support for KML/KMZ to Maps.
as well as formalizing the UX and UI for dealing with custom layers.

He is currently working on realizing these mockups:
His blog is also on Planet GNOME and the direct link is here.

Both interns are doing awesome work and we are very very lucky to have them! Maps needs them and also you! For doing design, code evaluation of infrastructure and work flow!





Saturday, 12 December 2015

What's cooking in Maps in GNOME 3.20

We are coming up on the 3.19.3 release this Monday and 3.19.4 will be January 14th which will also be the start of the UI freeze.

I wanted to take some time and give an update on what we have done for Maps this cycle and what we can expect in Maps 3.20.

Open with browser

We have had support to open a location with other applications for a while. New in 3.20 will be Open with browser. That will send you to the OpenStreetMap page for the location in question.



Fun with URIs

Maps in 3.20 will be able to handle the 'geo' URI scheme. That means that if you follow the link in the previous sentence and go to the wiki page and click on a geo: URI, your browser will suggest that you open the URI with Maps.

The GNOME IRC application Polari has also gotten support to linkify the geo: URI.


Geojson

I wrote about this in an earlier blog post we now have support for opening GeoJSON file, that contain simple geometric shapes and annotations. Since then contributor Alaf Azam added initial support for the Mapbox simple style specification for styling GeoJSON data. Which mean we can have stuff looking pretty like below.



Export to PNG

We added functionality to export the current view to PNG.



 

Editing OpenStreetMap from Maps

One thing I have wanted for a while now is happening thanks to Marcus Lundbladh we will have the possibility to do simple editing of OpenStreetMap from GNOME Maps. He has written a more in-detail blog post about it here.

Right now we have merged support to add/alter fields of information in places that already exist. And we will expand on that and maybe add functionality to add points of interest. A reason to use GNOME Maps is that we use the open data from OpenStreetMap and it feels good to offer a way to give data back.










So all of this and more, like going to your last previous location on start-up is what is happening in Maps for 3.20. And we also got two Outreachy interns for Maps for this round! I will introduce them and what they will work on in a later blog installment!

Monday, 26 October 2015

GeoJSON in Maps


For Maps 3.19.1 release we managed to land some support for showing  a GeoJSON layer. This means that you can get a GeoJSON file from somewhere then open it with Maps.

Usage

The different ways to load GeoJSON with Maps is currently...
... from the command line: gnome-maps file.geojson
... drag the file to a Maps window
... double click the file to open it with Maps




In order for double clicking the GeoJSON file to work we need to install the application/vnd.geo+json mime-type on the desktop. I have added the mime-type to the freedesktop.org component shared-mime-info. So you will need a release from that module or build it yourself from Git.

GeoJSON files can be used to create a custom layer above the map. For instance displaying political areas like counties or voting area. An example would be all the municipalities of Norway.




You can also add different places, for instance GUADEC this year will be at Karlsruhe. The bid I saw included four different options for venue. We could map this using GeoJSON (I used geojson.io) to create a layer showing the different options on the map.



Heavy lifting by Mapbox

It turns out rendering large sets of GeoJSON is non-trivial. Fortunatly it is something that Mapbox already has solved with their JavaScript library called geojson-vt. Under the heading of "Rendering big geodata on the fly with GeoJSON-VT" the article describes how the library breaks down the GeoJSON set into vector tiles by filtering out features, optimizing detail and clipping.

We lift the code into Maps, we have to change the way the geojson-vt modules include each other in order to fit into the gjs way of doing things, but other than that, the code is unchanged. The code is then used to construct a libchamplain tile source and is then added as an overlay source to the map view.

Limitations

Right now the code will only handle GeoJSON files that do not change the Coordinate Reference System (crs) to something other than the one we are used to (latitude and longitude ranging from -180/-90 to 180/80).

No styling information is taken into account (except the name property for Points). There is no standard GeoJSON styling style. But we could for instance support the one from Mapbox.

Future

Styling and UX for this feature may change before we end up in 3.20. Please try it out and comment and file bugs. It will help us!

If you want to help out now there are some tasks to look at:
Thanks!

Wednesday, 30 September 2015

Do you want to contribute to Maps?

Right now we have quite a number of tasks in our Bugzilla that are suitable for someone that want to get started developing for Maps or GNOME in general.

I am going to list some of them here and maybe it will pique someones interest. However finding a first task to work on is not all that one need to do in order to start developing for GNOME. You also need to be able to build and run the latest developer version of the GNOME module you want to develop for. In order to get there I will defer to the excellent Newcomers guide.

On to the Maps entry tasks!


Remember last location and use it at start up

This task is about saving the latitude and longitude of the view you are currently viewing so that Maps can go there on start-up. Instead of starting with a view of the world every time.

So in order to solve this you will interact a bit with the GSettings framework and a bit with the ChamplainView that contains our map.



Use stars instead of hearts for favorite places



We currently use hearts for favorite places on our Map bubbles. The rest of GNOME use stars. We should use stars as well. So here you will interact a bit with CSS and with UI files.



Implement new mockups for map Bubbles


We want to fit more information in our map bubbles. New mockups have been provided in the bugzilla for this task. To solve this you need to, among other things, interact a bit with GtkBuilder ui-files.


Support roundabouts in GraphHopper route results

GraphHopper now supports roundbouts. But we do not show that in our route planner UI. For this task we need to use the information from GraphHopper in the Maps ui.


These were a few of our tasks, there are More! We want your help and need it to make Maps 3.20 the best release yet!

Thanks!