Disable Dashboard in MacOSX (10.7 to 10.9 tested)

In the Terminal app:

 $ defaults write com.apple.dashboard mcx-disabled -boolean true

Then, just kill the currently running Dashboard process (called from the Dock app)

 $ killall Dock

And voilĂ , done!

Turn of IPv6 on MacOSX (Mountain) Lion using command line

On MacOSX (Mountain) Lion, there is no way to turn IPv6 off using the Network settings.

If you don't know the exact interface name you want to turn IPv6 off, list all of them using:

networksetup -listallnetworkservices

Most of the time, you can just use the following commands for Ethernet and Wifi interfaces:

networksetup -setv6off Ethernet
networksetup -setv6off Wi-Fi

To enable again, use:

networksetup -setv6on Ethernet
networksetup -setv6on Wi-Fi

Python + Tornado - Variable length URL Parameters

If you want to catch variable length url parameters with tornado, first, you have to setup the correct regex routes:

(r"/some_method/?(?P<param_name>[A-Za-z0-9-]+)?/", FunctionHandler)

Don't forget to enclose the param groups (?P ... ) between question marks ?(?P ... )? to mark them as non-mendatory.

The function handler is like:

class FunctionHandler(tornado.web.RequestHandler):
    def get(self, **params):
        self.render("some_template_file.html",
            params          = params,
    )
    ...

Force Chrome to tunnel DNS requests through a SSH socks proxy

On your local machine, make the SSH connection :

ssh -D 8888 server

Force Chrome to use the ssh tunnel for DNS requests :

google-chrome --proxy-server="socks5://localhost:8888" 

You can check if it works by running this command on the ssh server :

tcpdump -i eth0 port 53

tcpdump will show dns trafic for any activity in Chrome.

Quickly generate a public/private SSH key (ie. to use with git)

In a linux command shell :

ssh-keygen -t rsa -b 4096 -C "email.address@domain.com"

This generates a public key ( ~/.ssh/idrsa ) and a private key ( ~/.ssh/idrsa.pub ) in your home directory.