Got Ruby on Rails and Tracks working

Tracks screenshot

Tracks screenshot,
originally uploaded by msabramo.

It took a while to get it working, but I finally managed to install Ruby on Rails and then Tracks, a RoR web application for GtD on my PowerBook.

Some hints for getting it working on Tiger:

  • I used a MySQL 4.1 installer from here – my version is mysql Ver 14.7 Distrib 4.1.10, for apple-darwin8.2.0 (powerpc)
  • I used the Ruby on Rails for Tiger installer at this page. I also needed to follow the instructions at the bottom of the page to install the “mysql” gem, which is not part of the aforementioned RoR installer. Specifically, I did:
    sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql

    Note that if you don’t supply --with-mysql-dir, the install of the mysql gem is likely to fail with ERROR: While executing gem … (RuntimeError) ERROR: Failed to build gem native extension. That’s what happened to me at least on Mac OS X Tiger. Interestingly, I was able to install the mysql gem without that option on a FreeBSD server – I don’t know why.

  • I used ruby-1.8.2 (comes with Tiger), rails-0.13.1, redcloth-3.0.3, and mysql-2.6. Use the gem list command to see what you have and sudo gem update to update.
  • I used Tracks 1.03, which I got from here. I unzipped the file in $HOME/Sites
  • I followed the Tracks install instructions in doc/README_FOR_APP for copying the config/{database,settings}.yml.tmpl files to config/{database,settings}.yml, creating a “tracks” database in mysql and populating it with data using the sql scripts in the db directory.
  • I fired up the WEBrick server by running this from the “tracks” root directory: ruby script/server --environment=production
  • Then I went to and created my account and now tracks is available at — this is with WEBrick — I haven’t attempted to mess with Apache and FastCGI yet. I’ll save that for another day.

A Cappella concert

A Cappella concert

A Cappella concert,
originally uploaded by msabramo.

Wow, the Treo camera sucks. 🙂

Went to see Nina‘s a cappella group, The Special Guests tonight. Interestingly, the guy sitting in front of me was renowned Stanford computer scientist, Donald Knuth. My favorite song: “Africa” by Toto.

Renaming digital photos with their date and timestamp

If you own a digital camera, you’re probably generating lots of photos and videos with uninformative filenames like “IMG\_0002.JPG” and “MVI\_0003.AVI“. It’s not easy to view these files chronologically, especially if you mix photos and videos or files from different cameras.

If you’re on Windows, a freeware program called Stamp extracts the date/time each photo was originally shot from camera-generated metadata (e.g.: EXIF), then adds a timestamp to the beginning of each filename. After running Stamp, you can sort your photos and videos by filename to view them in true chronological order – even if they come from different cameras. E.g.:

IMG_0002.JPG   -->   2003-12-25 @09-01-24 IMG_0002.JPG
IMG_0004.JPG   -->   2003-12-25 @10-23-48 IMG_0004.JPG
MVI_0001.AVI   -->   2003-12-25 @08-58-17 MVI_0001.AVI
MVI_0003.AVI   -->   2003-12-25 @09-06-35 MVI_0003.AVI

If you don’t use Windows or if you prefer a simple utility with a command-line interface, take a look at the open-source program jhead.