Modified to work on both Ubuntu and Debian Wheezy