I've known about the OpenStreetMap project for some time, but I've never taken advantage of it before. But as I was hunting around for a Linux mapping program (and found "qlandkarte gt"), I stumbled across OpenStreetMap-based maps that you could use off-line. And among those were detailed bike trail maps of Germany. But loading them on to my GPS proved a bit complicated because I don't have a Windows box around!
First, I found the maps here: http://openmtbmap.org/download/
Then I had to download 7zip in order to unpack the map files (which are bundled in a Windows executable). qlandkarte was immediately able to use these map files locally. And they looked very detailed and accurate! But how to get them on to my Garmin Etrex Vista C (an older handheld model)?
Unfortunately, Garmin only provides map loading software for Windows and Mac. There appears to be an open-source project to do this, but it didn't look well supported or easy. Since I have a Mac, I downloaded Basecamp (i found many recommendations to skip Garmin's RoadTrip project and use the more stable Basecamp).
Next, you have to convert the Windows maps into Mac maps (why oh why does Garmin have separate formats for different programs?). Garmin provides a converter program that runs under windows (http://www8.garmin.com/support/download_details.jsp?id=3897), but fortunately, there is an open-source project called Gmapibuilder that does the same thing.
Next, I ran the Garmin Map Manager on my Mac (came bundled with Basecamp) to load the maps into Basecamp. Then, I used Garmin's Map Installer applications (also bundled with Basecamp) to select my GPS unit and load a subset of the map on to it. I was happy to discover that I was able to pick a subset because my eTrex Vista C only has 24MB of memory and no expansion slots. So I was able to reduce the map to just the area that I wanted. And voila! I was done!
I got some good help in this process from openmtbmap.org, but since it seemed missing a couple steps, I thought I'd document it all here.
Sunday, August 29, 2010
Tuesday, April 6, 2010
chown in Python
The built-in chown in Python (in the os module) only uses uid/gid instead of username/groupname. So here's a couple of (simple) versions that can take usernames and groupnames. I can't remember where I borrowed some of this code from, but it was heavily inspired by code samples I found while google searching:
def chown(path,user,group):
uid = pwd.getpwnam(user)[2]
gid = grp.getgrnam(group)[2]
os.chown(path,uid,gid)
def chown_recursive(path,user,group):
if path is None or path in ['/','/root','/usr','/tmp','/bin','/sbin']:
raise Error("path isn't right...")
uid = pwd.getpwnam(user)[2]
gid = grp.getgrnam(group)[2]
os.chown(root, uid, gid)
for root, dirs, files in os.walk(path):
for name in dirs:
os.chown(os.path.join(root,name), uid, gid)
for name in files:
os.chown(os.path.join(root,name), uid, gid)
Wednesday, March 17, 2010
Repairing Corrupt MySQL Tables
Drat... My MythTV's MySQL database got corrupt somehow. I noticed some strange problems with the guide data over the past couple weeks and today, the guide data ran out. When I ran "mythfilldatabase" on the command-line, I noticed a weird error from MySQL suggesting the tables were corrupt.
A couple of google searches later, I found a great reference guide (http://www.thegeekstuff.com/2008/09/how-to-repair-corrupted-mysql-tables-using-myisamchk/) that discusses how to use myisamchk to find corrupt tables and then repair them. Worked like a champ.
A couple of google searches later, I found a great reference guide (http://www.thegeekstuff.com/2008/09/how-to-repair-corrupted-mysql-tables-using-myisamchk/) that discusses how to use myisamchk to find corrupt tables and then repair them. Worked like a champ.
cd /var/lib/mysql/mythconverg
myisamchk *.MYI
# in my case, only one table was corrupt
myisamchk -r CORRUPTTABLE.MYI
Monday, May 18, 2009
Reducing an LVM Volume Group that's missing disks
I put in a new hard drive and used "pvmove" to move all the physical extents (all the data) from the old drives to the new one. But then, I removed the drives without running vgreduce! Oops... Fortunately, vgreduce has a "--removemissing" flag that can remove all the missing physical volumes from a volume group and restore consistency. This is exactly what I needed since I was sure that there was no data left on those other volumes.
Tuesday, September 30, 2008
Jump-Starting a new Honda Odyssey
Yes, I'm the proud owner of a fairly new Honda Odyssey. And I did the stupid thing of leaving the lights on over part of the weekend. And when my wife went out to start the car, lo and behold, the battery was dead. Now on a car with so many electric features (there is only one key hole on the outside of the car, they expect you to use the automatic door locks for the rest of the doors), having a dead battery leaves you in a world of trouble!
It took some time to find a place that sells jumper cables. Fortunately, the local Obi (like Home Depot) has an automotive section. So I go out well before the sun rises this morning to jump start the car. And as soon as I attach the jumper cables from the good battery, the honda odyssey goes into "Help! I'm being stolen!" mode with horn a blaring. I'm sure my neighbors loved that!
Well, after almost 2 hours of frustration, I finally discovered that ADAC (the equivalent of AAA in Germany) will do a courtesy jump-start for AAA card holders overseas. And they were pretty prompt! The tech (who didn't speak hardly any English, but we were able to communicate) knew exactly how to disable the panic mode: put the key in the outside of the driver's door and lock and unlock the car. I guess my putting the key in the ignition wasn't good enough for the car, it needed to be in the outside door. I'm told that using the lock/unlock on the keyless entry would have had the same effect. But I'm disappointed that my car will always panic when I try and jump-start it from a dead battery. I guess I just can't jump start it in the dead of night without disturbing the neighbors for a few moments while I get that key into the door...
It took some time to find a place that sells jumper cables. Fortunately, the local Obi (like Home Depot) has an automotive section. So I go out well before the sun rises this morning to jump start the car. And as soon as I attach the jumper cables from the good battery, the honda odyssey goes into "Help! I'm being stolen!" mode with horn a blaring. I'm sure my neighbors loved that!
Well, after almost 2 hours of frustration, I finally discovered that ADAC (the equivalent of AAA in Germany) will do a courtesy jump-start for AAA card holders overseas. And they were pretty prompt! The tech (who didn't speak hardly any English, but we were able to communicate) knew exactly how to disable the panic mode: put the key in the outside of the driver's door and lock and unlock the car. I guess my putting the key in the ignition wasn't good enough for the car, it needed to be in the outside door. I'm told that using the lock/unlock on the keyless entry would have had the same effect. But I'm disappointed that my car will always panic when I try and jump-start it from a dead battery. I guess I just can't jump start it in the dead of night without disturbing the neighbors for a few moments while I get that key into the door...
Subscribe to:
Posts (Atom)