I am hacking on the iTunes database format, and I needed to do some quick conversions between hexadecimal and decimal representations. I am decent at it by inspection, but the bigger numbers tend to take me more time than a few keystrokes.
These perl one-liners go both ways. Just add an argument. There is probably already some unix command that will do this, too, but I did not spend time looking for it.
perl -e 'printf "%d\n", hex( shift )' perl -e 'printf "%X\n", shift'
alias d2h="perl -e 'printf qq|%X\n|, int( shift )'" alias h2d="perl -e 'printf qq|%d\n|, hex( shift )'"