Skip to content

Instantly share code, notes, and snippets.

@ByteCommander
ByteCommander / upgrade-pip.sh
Last active August 29, 2015 14:23
Script that should upgrade old pip-versions shipped with Ubuntu to the latest version available from PyPI
#! /bin/bash
upgrade_pip2 () {
# Installs latest version of pip for Python2, if any version is already installed
if pip2 &> /dev/null
then
echo "*** Uninstalling old version of pip for Python2..."
sudo apt-get remove python-pip -qq
echo "*** Installing/upgrading setuptools for Python2..."
sudo apt-get install python-setuptools -qq
@ByteCommander
ByteCommander / powerbtn.sh
Last active July 14, 2016 10:25
restart Firefox instead of shutting down when power button is pressed
#!/bin/bash
seconds=5
targetuser="bytecommander"
killprocess="firefox"
startprocess="firefox"
mytempfile="/tmp/powerbtn-touched"
if [ -e /tmp/powerbtn-touched ] &&
[ $(date +%s --date="$seconds seconds ago") -lt $(date +%s -r "$mytempfile") ]
### Keybase proof
I hereby claim:
* I am bytecommander on github.
* I am bytecommander (https://keybase.io/bytecommander) on keybase.
* I have a public key ASA8Xs1CXdl_4wiRy3K14NeqNPGQK18MrXNllj-Z8Pmt9wo
To claim this, I am signing this object: