Depends on what system you're on really. You should be able to do it in network preferences or you could export it in your local shell.
Debian. How would you do it on the shell?
The typical environment variable for socks proxies is SOCKS_SERVER, so: export SOCKS_SERVER=127.0.0.1:8000 in conjunction with ssh -D8000
Unfortunately many utilities don't support SOCKS or have non-standard flags, so you would need a wrapping program like tsocks to force TCP through your proxy.