From calomel.org
ssh and direct connect (SOCKS5) :
The following line will start the ssh client and connect to username@remote_machine.com.
Port 8080 on localhost (127.0.0.1) will listen for requests and send them to the remote machine.
The remote machine will then send the packets out as if they originated from itself.
ssh -C2qTnN -D 8080 username@remote_machine.com
Leave it running. And just configure the SOCKS5 proxy in the browser (localhost:8080)