Count web server hits per IP address

If you have ever need to do a quick and ready count of hits per IP address from your server logs, then this is a handy one liner:

cut -d ' ' -f 1 logfile.log | sort -n | uniq -c

Where -d ' ' states that the fields are seperated by white space, -f 1 refers to the field containing the IP address in logfile.log

Create an encrypted tunnel to a proxy server

If you wish to encrypt the traffic from your machine to a web proxy, for example to secure your traffic as it passes through your ISP, the following is a good start:

ssh -fN -L localport:localhost:remoteport proxyserver

This uses ssh to connect localport on localhost to remoteport on proxyserver. Then all you need to do is set your browser proxy settings to use localhost as the proxy server, using port localport. For example, assuming you wish to use port 8080 on localhost to connect to a proxy server running on port 3128 on www.someproxyserver.com, the following should work:

ssh -fN -L 8080:localhost:3128 www.someproxyserver.com

This assumes you do have a user account on www.someproxyserver.com that grants you access to a ssh server!