Saturday, February 25, 2006

KML to GPS

The Sea Otter Classic is a big bike event in California. I wanted to preride the mountain bike course. In partnership with Motion Based they have cool maps and a Google Earth downloadable KMZ file so you can see the route in Google Earth. Here's the steps I took to get that data into my GPS so I could follow the route easily.
  • Download the KMZ
  • Load it into Google Earth
  • Save as KML
  • Use this KML to GPX converter to get some GPX (do it online or download the java app). I did mine online.
  • Now use gpsbabel to convert this into something smaller.
    gpsbabel -r -i gpx -f MTB\ XC.gpx -x simplify,count=50 -o kml -F sml.kml
  • Load that into Google Earth, does it look o.k.? Tweak values until it does, then export to your GPS device (mine's a Garmin Fore Trex 201)
    gpsbabel -r -i gpx -f MTB\ XC.gpx -x simplify,count=50 -o garmin -F /dev/cu.KeySerial1
  • Now it should show up as a route on your GPS device.
I'm still bringing a printed MAP just in case!

Thursday, February 23, 2006

Inject gaim logs into gmail

I love the new chat feature in gmail, and I doubly love the fact that my chat history is nicely searchable. For a while now I've wanted to import all my old chats into gmail so I can search over them too. This weekend I sat down and wrote gaim logs mailer. Gaim is an open source multi protocol chat client with god awful almost non-existent insecure password management. It takes your logs and sends them to an email address of your choice. It's driven by a config file in ~/.gaim/logsmailerrc and keeps track of which logs it's mailed so it wont mail them again. You can run this every night if you want. Here's an example logsmailerrc.

I still have three todo items for it:
- make it parse yahoo messenger client logs (which are lamely obfuscated)- make it keep a timestamp/md5sum of when the file was sent so that if more stuff gets added to the file it's resent.
- make it upload adium logs too

There is one problem:
- even though the date is correct in the email, gmail seems to index based on the date received. So you can't do before: or after: searches and find your messages.

If you use this to email your own account, and then fetch that via POP3 it might have better luck with the dates. I also heard if I send it directly to gmail using IMAP and use IMAP APPEND then gmail should preserve the timestamps:
You want to use the optional INTERNALDATE argument in order to set the
"received time" to the time of the message, assuming that's the date
problem you were having. Otherwise, you need a Date: header that is
correct for the "message time".