send internet traffic over a proxy with tsocks

Sometimes it happens that you can’t use your services cause they deal with blocked ports. For exampel you use mysql on the commandline and it is by some reason denied. A proxy can help you. Tsocks helps you to use a proxy. Tsocks is a library for intercepting outgoing network connections and redirecting them through a SOCKS server.

install tsocks with

sudo apt-get install tsocks

Configure the file /etc/tsocks.conf

# the proxys address
server =
# the server type
server_type = 5
# the proxys port
server_port = 3306

and finally call your command like this:

tsocks mysql -h myHost -u myUser -pPassword