Archive | March, 2007

Most useful BASH shortcuts

29 Mar

ctrl-r : search through your history
ctrl-a/ctrl-e : go to start/end of line
ctrl-w/alt- : delete previous word
ctrl-t : transpose/swap previous two characters
alt-t : transpose/swap previous two words
ctrl-y : previous delete (like paste)
!$ : “!$” means the last argument of previous command
!^ : “!^” means the first argument of previous command

$   : show all system variables

screen : command to de-couple running program from terminal

good vim tips:


Yahoo Mail IMAP

29 Mar

Along with the new Yahoo interface and now unlimited storage, Yahoo offers IMAP.

It’s quite handy!

grep on Solaris

23 Mar

Solaris doesn’t have recursive grep, instead you have to do something like:

 find . -name *.txt -exec grep  {} /dev/null  \\;

Install Perl modules using CPAN without Root access

22 Mar

Just need to set a few conf variables, you can do this when first setting up CPAN or if you already have:

$> perl -MCPAN -e shell
$> o conf                          # see current configuration
$> o conf makepl_arg  PREFIX=/somewhere/writable   # change the PREFIX
$> o conf make_install_arg INSTALLMAN3DIR=/somewhere/writable    # change where man's will go
$> o conf commit   # save

Now you should be able to do standard “install XML::XSLT” type commands and have all dependencies resolved etc.

Remember to include the /somewhere/writable path (@INC or lib) in your scripts.

XSLT – grouping or ordering elements

21 Mar

To do a rudimentary sort of elements :


For more advanced grouping see:

SVN Homedir (or CVS Homedir)

20 Mar

I read about keeping your home dir in Version Control here and decided to give it a go.

I’ve been using it for 3 months now, there are some definately some good things about it. I like keeping things like Word doc’s, timesheets, study notes in there. Big files are not so good (esp. if hosting from a slow link) and binaries are a pain. I prefer to keep these files in a Web Dav’d Apache setup (which allows a ‘Map Network Drive’/Webfolder from Windows Explorer).

I use it on Windows and Mac OSX. If you’re on Windows, you really need the TortoiseSVN client as well as Putty and Putty Agent set up. This will add nice icons to all files and give you a right-click context menu to deal with SVN. The Putty/Putty Agent will allow you to do it all password-less (using SSH-keys, like a ssh-keygen on Unix).

Now and then the Windows Subversion might say something about the directory being locked. You then have to drop to Cygwin and run a ‘svn cleanup .’ on the directory – this is the only real annoying thing i’ve found.

Split a newline separated element and do work on each…

15 Mar

Template to split input that has newlines in it.
Note the ‘append-pad’ template is also used (see other post) to nicely space things.

e.g. input is:

John Doe 1 Blacks Rd Beverly Hills California 90210

and you want to pass in something for the right hand side too, you pass it in | seperated.


Code that actually does the work below: