Author Archive

Apologies and absence

I thought it appropriate to formalise an apology regarding my absence from the intertubes of late.

I have been diagnosed with gastritis and as a result have been away from my technological love. I’m still a Mac/UNIX fan boy and still have a fascination with all things technological, mathematical and technical. I just need a bit of time to recuperate and get back to fighting fitness.

Five star playlist in iTunes

If you’re anything like me you use all sorts of tricks to bounce tracks from playlist to playlist in iTunes with smart playlists picking up rated tracks that you haven’t listened to and pushing them to you iPhone etc. Well, today I decided to manually manage tracks on my iPhone and as a result started tinkering with iPhone only playlists. (more…)

Selectively emptying a Postfix mail queue

One of the mail servers I manage was blocked up to the hilt with sixteen thousand emails sent to a specific recipient. This meant no one could send or receive email in the office until Postfix had delivered the messages. Only problem was these messages weren’t going anywhere. To make matters worse, the queue contained important emails that had to be delivered! (more…)

New Terminal tab with pwd

Just a quick snippet I’m using to open a new tab in Terminal. It accepts a single, optional argument which will override cd’ing to the working directory.

#!/usr/bin/env bash
 
if [[ $# -eq 0 ]]; then
	dir=`pwd`
else
	dir=$1
fi
 
/usr/bin/osascript \
-e "tell app \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down" \
-e "tell app \"Terminal\" to do script \"cd $dir\" in front window" \
-e "tell app \"System Events\" to tell process \"Terminal\" to keystroke \"l\" using control down"

I’ve put the shell script in “/usr/local/bin” as this is in my $PATH. I’ve named the script “tab” so whenever in Terminal I can enter “tab” to open a new tab with the current working directory ready and waiting. Very useful when working with Rails and multiple shells.

Smart empty text field automatically

UPDATE: This code needs some work still!

I think everyone has seen a form on a web page that has text fields that automatically empty when they receive focus. I’ve added this functionality to countless fields over the years and the behaviour I used to to this has evolved more and more. Using Prototype and the following script you can have fields intelligently empty themselves. (more…)

Enabling Apache’s mod_deflate

If you’re running an Apache web server and you want to speed up your visitor’s browsing you can enable mod_deflate, which has replaced mod_gzip in Apache 2.

You’ll probably find your mod_default module is already installed and available with just a couple of lines of configuration. (more…)

Plists in Ruby

I’m currently working on tweaking Apple’s lazy GUI design by alphabetising VPN connections in both System Preferences and the VPN Connection menu. This is definitely only intended for Leopard and I wont be testing it in Tiger or supporting it. It’s just for my own personal use as I have 40 odd VPN connections. The initial proof of concept code is below. I still need to work on getting things to work reliably and smoothly. (more…)

Installing yum and git on a MediaTemple (dv) 3.5

I recently decided to install Git on my (dv) 3.5 and found an article written by the guys at MediaTemple, my hosts, with instructions on how to do it (isn’t it nice when someone else does the hard graft for you?!) Unfortunately, the article was old and inaccurate. Luckily, with a bit of digging around I managed to get yum installed, updated and ready for Git. (more…)