Monthly Archives: January 2009

Whatsmyip from the Command Line

Nice little one liner to obtain your WAN IP address.   curl http://www.whatismyip.com/automation/n09230945.asp ; echo Then alias that badboy E.g.:   alias whatsmyip='curl http://www.whatismyip.com/automation/n09230945.asp ; echo' Happy day.
Posted in programming | Leave a comment

cp a symlink to multiple directories

Today I wanted to copy a symlink to many different directories. So I tried the following: for f in `find . -regex ''.*cp.*snippets''` ; do cp bbb.html $f/ ; done Which returned: cp: cannot stat `bbb.html': No such file or directory bbb.html is a symlink and the default behavior of cp (I think) is to try and copy the [...]
Posted in osx, shell, sysadmin, tips | Leave a comment

quick(er) way to symlink your `pwd`

I learned the other day about a neat shortcut for tilde expansion in bash. $ ls ~-/ The neat thing about this expansion is that it does tab completion. What this lead me to discover is that you can also do ~N, where n is a number refering to your directory stack. (the bash man page says [...]
Posted in programming | Leave a comment