Hack of the Day: Versioned Tomboy notes

I have a “TODO” tomboy note that I constantly update with little notes, things to pick up at the store, etc. However I don’t like the fact that my history isn’t saved. In one case I had a URL I had plunked in my TODO but hadn’t kept anywhere else. I went to find it recently, and I had deleted it from my note. Luckily I had a backup with the old version of the note, and I was saved.

It would be nice to have a versioning plugin for tomboy (like a wiki) but I’m too lazy to code the solution, so I came up with an Awesome Hack instead: CVS and cron. I turned my ~/.tomboy into a CVS repository, and set up a cron job that would scan my notes every hour and commit to the repository. Now if I want to go back in time I can browse through the revisions.

Having an actual versioning plugin would be preferable to all this, but barring that this is a decent enough stopgap measure.

Creating GPS route maps from google maps

This is an expansion of the excellent work done by Mr. Davis at his Open Source GPS HOW TO page. He has a google maps hack here that allows one to make a GPX xml file by clicking on intersections. This is a very quick way to make a route map.

I wanted to expand on his work in two ways:

  1. I wanted to fill in waypoint names for items that were left blank, and
  2. I wanted to automatically check for waypoint name duplication, because duplicates cause data to be overwritten in Etrex GPS devices.

I wrote a python script that does both things. All one has to do now is:

  1. Create a map on his website
  2. Name major waypoints on the map (I like to name intersections using the name of the street I’ll be turning on to)
  3. Save the GPX file to disk
  4. Run gpxrecode.py [inputfile] [outputfile]

gpxrecode removes the leading number and hyphen from the waypoint name. If the waypoint is blank it gives it the same name as the last one. If the waypoint is already in a cache of waypoints, it adds a number to the end of the name. The cache is maintained between runs of the program, so multiple routes shouldn’t clobber each-other’s names.

Source after the break.

Continue reading “Creating GPS route maps from google maps”

BEWARE: Thinkpads don’t like just any old hard drive!

I bought a cheap Samsung hard drive on newegg.com over the weekend, and it arrived today. I booted up the system, and…

*BEEP* *BEEP*
ERROR 2010: Warning: Your internal hard disk drive (HDD) may not function correctly on this system. Ensure that your HDD is supported on this system and that the latest HDD firmware is installed. Press to continue

It turns out that, although Thinkpads use PATA hard drives, they are very picky about which ones. This is because the later T43 models use an SATA to PATA bridge chipset to convert between the Sonoma chipset and the much more affordable PATA drive standard.

What this means is that drives have to be specially coded to work with this bridge, and the Thinkpad has a little internal list that makes sure that the drive is known as compatible. If your drive isn’t on this list, the Thinkpad beeps at you on every boot.

I might be able to get my beautiful new drive to work, but right now I’m having trouble getting GRUB to figure out where it is. This is because GRUB needs the BIOS drive listing, and naturally the BIOS isn’t recognizing the drive. Linux sees it fine, though.

I got it to boot, but I still worry that something will go wrong. The two big warnings on the wiki are “slow” and “unreliable.” So far it is definitely not slow, but I’ll have to wait a few days for the “unreliable” part.

Update:
So it’s looking ok for now. I’m going to give it a couple weeks before I really trash the old one.
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 108G 49G 55G 47% /

I’d rather have to put up with 160$, two beeps and pushing escape every boot for 120gigs; as opposed to 300$ for 100 IBM-sanctioned gigs.

linux tip: Wireless internet disconnects a lot

Problem: Downloading bittorrents over wireless cards causes frequent connection drops, requiring removal and reinsertion of the driver module to restore the connection. Specifically, I have an Intel wireless card and I use the ipw2200 driver.

Solution:
The GNOME applet that detects the wireless signal is the cause of the problem. Remove the applet from the panel and the card should stay connected. There are still connection drops from time to time, but not nearly as often

flashing firmware without windows

I was having trouble getting my dvd burner to burn at maximum speed (8x) so I decided to take a chance and flash my firmware. I didn’t destroy my drive, but the upgraded firmware didn’t change anything so it’s kind of a letdown. I’m posting my method here for future reference.

Usually bios flashing is done from a floppy, but I have a modern laptop so I have no floppy. Flashing can also be done from a cdrom, but it’s a very bad idea to flash your CD drive from the CD drive!

My solution involved creating a small, ten megabyte vfat partition on my hard drive. If you don’t like the sound of that, stop reading. This is not a howto, just a set of notes. If you blow up your computer with these instructions, it’s not my fault.

1. burn a freedos cd as-is.
2. /sbin/swapoff /dev/hdaX to turn off my swap (oh yeah baby)
3. using /sbin/fdisk, delete my swap partition
4. recreate my swap partition, but leave off two of the blocks or so (about 10-16 megs)
5. create a partition of type 0xb (windows 95 32bit)
6. reboot to init new partition
7. /sbin/mkswap /dev/hdaX’ to reinit my new, slightly smaller swap
8. /sbin/swapon /dev/hdaX’
9. /sbin/mkfs.vfat /dev/hdaY to create new vfat partition
10. mount the vfat partition, copy the freedos command.com there (just in case) and all of the flashing utils / images
11. reboot with freedos cd
12. boot option 1, and then “safe mode”
13. change to c: (voila, now we are on the HD!)
14. run c:\command.com just in case (now we aren’t using the cdrom)
15. do flashing shit
16. reboot and pray you still have a cdrom

I think that’s everything.