From the monthly archives:

December 2009

Shwartzian Transform

December 24, 2009

I was trying to merge sort a list of files based on their last modified date when someone said to me “do a schwartzian”. Now, I had no idea what they were talking about so off to google I went.
It’s basically this (shamelessly ripped from the excellent Wikipedia article):

Read the full article →

Finding which package a file belongs to on Debian

December 14, 2009

With Debian there is a handy utility called apt-file which allows you to see which package owns a file even if it is not currently installed.
I used it earlier to find where “mysql_config” lived so I could upgrade DBD::mysql.
aptitude install apt-file && apt-file update then apt-file search filename

Read the full article →

Running a unix command as a background process

December 14, 2009

If you run a command and it takes a long time on unix it blocks the current terminal, however, if you hit CTRL – Z it pauses the job, then if you type bg it resumes the job in the background freeing up the current terminal.
Also, if you prepend a & before executing the command [...]

Read the full article →

Tweetfactor – An experiment using Ruby, Sinatra, Twitter and Redis

December 8, 2009

I stumbled across a blog post by digitalhobbit about building a little Sinatra App on top of the Twitter Streaming API.
I followed that guide and made the core of Tweetfactor a couple of weeks ago. Actually getting the thing deployed, however, was pretty involved for me, having never used Rack/Passenger/God etc. etc.

Read the full article →

Kill A Process Using It’s PID File

December 7, 2009

Quick Tip: kill $(cat /var/run/redis.pid)
I needed to do that earlier and didn’t know how.
EDIT: Turns out you can just do this as well: kill `cat /var/run/redis.pid`

Read the full article →