Fun aliases

tcsh is shown. You can usually just throw in an = for bash and similar shells. Aliases need to be on one line in a .aliases file or as set on the command line.

The current phase of the moon

alias moon 'perl -MAstro::MoonPhase -le "printf qq{The Moon is %.1f%% full},100*(phase)[1]"'

Fri Sep 12 20:14:58 PDT 2008
The Moon is 94.3% full

Convert HTML entities to numeric entities

alias he 'perl -MHTML::Entities -le "print HTML::Entities::encode_entities_numeric(decode_entities(+shift))"'

jinx@jasper[5]~>he ' '
jinx@jasper[6]~>he '©'

Correct CRLF line endings to plain line feed

Warning! Edits plain text files in place. If you run this on a binary file like a Word doc or an image, you are going to corrupt your file.

alias rnfix "perl -pi -e 's/\r\n?/\n/'"

jinx@jasper[8]~>rnfix myfile.txt

Setup your Perl module for distribution

alias buildit "rm -f META.yml ; make clean; rm -f MANIFEST; rm -f META.yml; make manifest ; perl Makefile.PL && make && make test; make manifest; make dist"

Some miscellaneous sanity savers

alias sl 'ls -laF'
alias to mail
alias mx 'chmod 755'
alias rm "rm -i"
alias cp "cp -i"
alias mv "mv -i"
alias x 'clear; echo "exiting..."; sleep 3; exit'
alias zipit 'gnutar czvpf'
alias unzipit 'gnutar xpfvz'

digg stumbleupon reddit Fark Technorati Faves