Bash: Resolving Symlinks to Shellscripts

Here's a way to resolve symlinks that call a bash shellscript. The Problem I like to be able to use something like this in my bash scripts:SCRIPTDIR=$(dirname $0) Which is great for a reference to where the script is, but it suffers from the problem that…

Linux: Changing UIDs and GIDs for a user

Just had to do a quick switch over of UID [http://en.wikipedia.org/wiki/User_identifier_(Unix)] and GIDs [http://en.wikipedia.org/wiki/Group_identifier_(Unix)] for a couple of users. I'm using Puppet [http://reductivelabs.com/trac/puppet] to manage server configurations and it'…

Mac OSX tip: ls command color output

If you have OSX tiger simply grab the fileutils from fink with fink install fileutils Then add the following to your .profile: export LS_OPTIONS='--color=auto' eval "`/sw/bin/dircolors`" alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -lah'…

Django: Switching between development branches

Cyril [http://cyril.doussin.name/] and I have been using new forms admin for some stuff we are working on for fun whilst we are here at SXSWi. One of the issues is that if you're developing several different Django sites you won't necessary want to…

From the command line to your clipboard and vice versa

Found a neat trick the other day via github.com [http://github.com], in their instructions for copying public keys. pbcopy (pasteboard copy) on mac OSX is a command that puts it's input into the clipboard so you can paste the output anywhere. In this example the output…

Extracting a single file from a tar backup

Like an idiot I accidentally overwrote a file for this blog when uploading some other stuff; accidents happen. Anyway, I have backups (you do have backups right?) and I needed to grab a single file out of the latest tar. Fortunately this is really straight forward and rather than unpacking…