Archive for the ‘coding’ Category

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…)

Modified CSS Bundle for TextMate

If you use TextMate when you’re coding for the web you’ll probably have at least tried out Jim Jeffer’s CSS Bundle, which was inspired by an article by Jina Bolton. If not check it out!

When I first downloaded it I was impressed but not exactly blown away as the snippets don’t really leverage the true power of TextMate’s bundle system. I had to get to work to make things a lot smoother. (more…)

puts Ruby.in_colour!

When I’m making a script for someone I always think it’s nice to add a bit of colour to anything output by Ruby. Not to be garish… We don’t want command line filth reminiscent of Geocities after all! But if there’s an obvious exception that ends our fun it’s good to highlight that. (more…)

Repair permissions on network home folders

I had a problem to fix a few months back where by something like 1000 users had totally bricked their home folder permissions. Trying to propagate permissions from Workgroup Manager (it was a 10.4.11 server) kept hanging and would only fix home folders up to the letter “d.” It was at this point I was called in to write a script so a colleague could repair the permissions without running the risk of annihilating the home folders from the command line. (more…)

iTunes and lsof

A while back I wanted to know what people were listening to if they were sharing my iTunes library. I used lsof in a little bash script to find out. (more…)

Steal iChat Buddy Image

This is an old script I’ve had lying around in my Code folder for a while now. It’s still pretty useful, even in Leopard. It basically takes a buddy’s image of your choice and uses it as your own. Furthermore, it attempts to save a copy of the buddy image on your desktop. It can be quite entertaining if not functional on occasions. (more…)

SSH Remote Desktop Selection

A while back I was asked by a colleague if I could automate starting a number of SSH connections based on the current selection in ARD. This may seem pointless given that you can run UNIX commands in ARD but it is not. With SSH you get an interactive shell; quite different from just being able to send commands and receive a sample of the response! (more…)

Applescript to Quit Process

I often find my ARDAgent process goes haywire what with all the IPSEC tunnels I work with. It became a chore having to relaunch it from the CLI or using Activity Monitor so I blasted out a clumsy Applescript to do it for me. (more…)