Tag Archive for 'ruby'

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 »

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 »

Password Generation

There are lots of ways of generating passwords. We can use dashboard widgets, desktop applications or even websites. I’ve recommended GRC’s password generator in the past (https://www.grc.com/passwords.htm) as it’s quick and easy.

The password below is random. Try refreshing the page!

_D:q5L6m[A!G|z9C[L9p|F+M8I{R#v3Q{V{G0Q0r

MORE »

Terminal, colour and Ruby

I use ruby for system administration tasks all the time and find a little colour always helps to highlight certain information. The only problem is I’ll forget which colour is represented by which number. The ruby script below prints out a nice box of all foreground and background colours. I’ve uploaded a screenshot of the output below so you can see how it looks. MORE »