Category : Nerd Stuff

De phishing-mails worden steeds gekker

Welke idioot trapt hier nou toch in?

Hello,

I am SSG Mark Phillip, an active American soldier serving in Afghanistan, I am serving in the military of the 1st Armored Division in Afghanistan, as our mission here is highly exclusive due to insurgents everyday and car bombs are attacking our peaceful mission here.

We managed to secure funds from the war zone. The total amount is US$ 19 Million dollars in cash. We want to move this money out of this place,this place is a war zone, so that you may keep our share for us till when we will come over to meet you.We will take 70%, my partner and I.You take 30%. No strings attached, just help us move it out of Afghanistan, Afghanistan is a war zone. We plan on using diplomatic courier and shipping the money out in a large box, using diplomatic immunity.

If you are interested I will send you the full details, my job is to find a good partner that we can trust and that will assist us. Can I trust you? When you receive this letter, kindly send me an e-mail signifying your interest including your most confidential telephone/fax numbers for quick communication also your contact details. This business is risk free.
The box can be shipped out in 48hrs if you want to handle the deal with us as Family.

Thanks
SSG Mark Phillip

I need 4 Raspberry Pi’s

Chances are that by now, you have heard of the Raspberry Pi, a cheap, credit card sized ARM computer, capable of running Linux. As is seems that the distributors (RS Electronics and element14/Premier Farnell) are starting to ship them Real Soon Now, I was thinking how many of them I am going to need 🙂

I think I need 4, to start with:

  • A Home Theater PC, running XBMC
  • A Car PC
  • A shower radio. This one will need a waterproof case, integated speakers, run on batteries and probably have a small integrated amplifier. It will also need WiFi, so it could be a model A without the ethernet interface.
  • A NAS controller, although this might not be wise, since the harddisks can only be connected with USB. It’s worth the experiment, in any case.

I hope the Pi will become available in quantities soon!

Policykit adventures

After installing Debian on a laptop this week, once again, I ran into the “problem” of not being able to shutdown or reboot the computer, when another user is logged in, for example via SSH. If you’re a Linux user, maybe you have seen it:

System policy prevents restarting the system when other users are logged in

The cause of this behaviour is something called policykit, and a policy defined in /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy. I found several pages on the web, that suggested to modify this file to change the policy. However, as this file is shipped by a package, and living below /usr/share, it is not intended to be modified by users to override the policies it contains.

The correct way to fix the problem is in something called PolicyKit Local Authority, or pklocalauthority. To enable all users to shutdown or reboot the computer, even when other users are logged in, create a file named /etc/polkit-1/localauthority/50-local.d/usershutdown.pkla (the name must end in .pkla) and put the following in it:

[Allow Shutdown]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.stop-multiple-users
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Allow Restart]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.restart-multiple-users
ResultAny=yes
ResultInactive=yes
ResultActive=yes

You may have to reboot the computer (or at least log out and back in) for the policy override to take effect.

Google Chart Tools

Ik ben verzot op grafiekjes, dus een product als Google Chart Tools heeft altijd mijn interesse. En Google kennende maken ze het allemaal weer lekker simpel. Je kunt bijvoorbeeld gewoon naar één van de voorbeelden gaan, de voorbeeld-code copy-pasten in een WordPress post (oh ja, wel ff de html, head en body tags eruit mikken), et voilá:

Geinig he?

Convert tracks into routes with GPSBabel

Last week, I blogged about creating routes for a Garmin Zümo, using Google Maps and GPSBabel. The main problem that I was trying to solve, is how to create a “real” route that my Zümo will understand, built out of a minimal amount of route waypoints (that show up as such on the Zümo when navigating), rather than possibly thousands of trackpoints, that are hard to process for the device and don’t give you as much navigation flexibility.

This post is about something else, namely how to convert a GPS track (that you created by driving, downloaded somewhere, etc.) into a route, with the same criteria as last time.

Suppose you have a GPX file, containing a track. Typically, such a track contains many trackpoints. For example, a drive of about 60 km that I took a few weeks back, gave me a track consisting of over 2600 trackpoints. Now, I would like to create a route out of this track, that I can share with others.

I don’t know about you, but in my case, a track always contains some stuff that I don’t want to show up in the end result: mistakes that I made during my ride, like entering dead-end streets, or those extra meters that you make, looking for a place to park for a coffee break. Stuff like that is easily corrected with Viking, a nice GPS/track/waypoint editor, that runs on Linux (POSIX) and Windows, and is available under the GPL v2 license. Maybe later I will post something on using Viking, but that’s besides the scope of this post. Let me continue.

So, now I have a GPX, containing the exact track that I want turned into a route. We will use GPSBabel to do the conversion. The invocation is similar to the one in my previous post, but instead of using waypoints, we convert a track into a route, and we add a filter: simplify. I quote:

The Simplify filter is used to simplify routes and tracks for use with formats that limit the number of points they can contain or just to reduce the complexity of a route.

And that is exactly what we need. Simplify will let you specify a maximum number of waypoints in a route, but we will use another feature: maximum error. It allows us (and again, I quote) to specify the maximum allowable error that may be introduced by removing a single point. That means that the nuber of waypoints can be higher on more complex pieces of our route, and lower on the long stretches.

Here we go:

gpsbabel -i gpx -o gpx -f track.gpx -x transform,rte=trk -x nuketypes,waypoints,tracks -x simplify,error=0.1k -F route.gpx

By specifying a maximum error of 0.1k (0.1 km, or 100 m), our original track file, containing a track of 62.84 km in 2641 trackpoints, is converted in to a route file, containing 73 route waypoints.

In the picture, you can see the result. Click to enlarge. In orange is the original track; in green is the resulting route, with dots on the route waypoints. The map is left out for clarity.

I think that this gives us a route, that has enough waypoints not to leave much room for interpretation by the routing engine of a GPS device. My guess is, that most routing engines will calculate identical routes, regardless of your routing parameters, like shortest/quickest route. I haven’t tested this, though.

It speaks for itself, that a higher value for ‘error’ will give you less waypoints, and a lower value will give you more. For example, using ‘error=0.05k’ (50 m), gives me 109 route waypoints. If this is still acceptable, you can profit from the greater accuracy of your route.

Google maps

Now, the funny thing is, that this can also be applied to tracks from Google Maps’ KML files. Please have a look at this post. So if you want to skip the labour-intensive step of creating placemarks for all your route waypoints, you can use the track instead.

The GPSBabel invocation becomes:

gpsbabel -i kml -o gpx -f Routetest.kml -x transform,rte=trk -x nuketypes,waypoints,tracks -x simplify,error=0.5k -F Routetest.gpx

Meaning:

  • Convert KML into GPX
  • Convert the track into a route
  • Remove as many waypoints as possible, creating maximum error of 500 meters
  • Remove tracks and waypoints from the resulting GPX, keeping only the route

With the KML file from my example (a route of some 590 km through some of the best parts of France), this will result in a route, made out of 179 route waypoints, which should be fine for a Garmin Zümo.

Drawback

There is one drawback when using the track from Google as input for a route for -for example- a Garmin device. The waypoints that remain after the conversion are the result of a mathematical algorithm, and their position on the map is absolute. This means, that if there are differences between Google’s map and Garmin’s (and there are!), it can happen, that a route waypoint ends up in an unfortunate location. For example, the waypoint could end up on the other side of the highway, where traffic drives in the opposite direction.

Since the remaining waypoints will be concentrated around crossroads and curves, it is in fact quite likely that at least a few of these problems will occur.

The route on the Garmin might end up with strange loops as a result. Therefore, it is pretty essential to check the final result, either in MapSource or on your GPS device, to prevent unpleasant surprises.

1 4 5 6 7 8 12