Month: September 2008

RescueTime – finally a time tracking app that does not suck

Posted by – September 25, 2008

I have long wanted to be able to track my usage pattern of applications on the computer. I wanted something that didn’t require dealing with a timer. The problem with a timer is that it requires remembering to start and stop it, also, it is not naturally fine-grained and doesn’t give you feedback on your non-work activities on the computer. Also, it prevents a more natural multi-tasking usage of the computer (yes, I know, multi-tasking is bad when you’re trying to get stuff done).

RescueTime may just finally be the solution I’ve been looking for. Interestingly, it is a Ruby on Rails web-app combined with small downloadable apps that are available for Mac, Windows, and Linux. The downloadable app runs in the background and tracks your time usage of your applications, and even differentiates between the windows/tabs of the application, useful for tracking which sites you are looking at the most, or which terminal window you are in. The time usage information is stored in YAML files (more proof that RescueTime is RoR-based) in ~/Library/RescueTime/Logs/Pending which makes it easy to script something extra.

In fact, someone made a Mac RescueTime Log Script that lets you log your meetings or phone calls to RescueTime by generating a YAML file and putting it in the Pending directory.

BTW, if anyone is having trouble with Terminal.app in OSX not reporting window title (in the YAML files it shows up as window_title: ‘empty’). You need to enable access for assistive devices in Universal Access in System Preferences.

EDIT: Above fixes the window_title: issue, BUT web app dashboard doesn’t actually differentiate between the window_titles with Terminal yet :(

EDIT: I have stopped using this program because I am not entirely comfortable with all the websites I visit being uploaded to their server. An offline version of this program would be nice.

splitting scanned book images in a pdf

Posted by – September 3, 2008

I had a pdf of a scanned book, unfortunately, each pdf page was two scanned book pages, and each page needed to be rotated too.

First, I used pdfimages to extract the scanned images, but you can probably do it with ghostscript or netpbm or one of the other tools out there.

# had to install poppler for pdfimages
sudo port install poppler
pdfimages input.pdf out # generates a series of pbm files, out-000.pbm etc

#rotate and split each page, return tiff file {i/pbm/tiff} replaces ‘pbm’ from the string with ‘tiff’
for i in out*pbm; do convert $i -rotate 90 -crop 50%x100% ${i/pbm/tiff}; done

#convert all tiffs into pdfs
for i in out*tiff; do tiff2pdf -o ${i/tiff/pdf} $i; done

#merge the pdfs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf out*pdf

That’s the command line approach to solving that problem.