In OSX Lion I set ssh proxy to connect to work. All I do is
a) in terminal
ssh -D 8080 -f -C -q -N work_host_machine
b) System prefereces, proxy, set socks proxy
Step b) needs to be performed by hand, but can it be set and unset through shell or script?