Saturday, August 28, 2010

Change Terminal Dir to Current Finder Dir

From Switch Terminal dir to frontmost window of certain apps:
function ff { osascript -e 'tell application "Finder"'\
-e "if (${1-1} <= (count Finder windows)) then"\
-e "get POSIX path of (target of window ${1-1} as alias)"\
-e 'else' -e 'get POSIX path of (desktop as alias)'\
-e 'end if' -e 'end tell'; };\

function cdff { cd "`ff $@`"; };

Friday, August 20, 2010

External IP Address

curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z/<> :]//g'