*nix

Fix locale errors “can’t set the locale; make sure $LC_* and $LANG are correct”

update-locale LC_ALL="en_US.UTF-8"

Bootstrap a chef node

knife bootstrap myhost.home.lan -x myUsername -P myPassword --sudo --use-sudo-password

Remove all kernels except the active one

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Install Java (Ubuntu)

sudo -s
cd /opt
curl -L -O -H "Cookie: oraclelicense=accept-securebackup-cookie" -k "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/server-jre-8u60-linux-x64.tar.gz"

tar xfzv server-jre-8u60-linux-x64.tar.gz
update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_60/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_60/bin/javac 1

update-alternatives --set "javac" "/opt/jdk1.8.0_60/bin/javac"
update-alternatives --set "java" "/opt/jdk1.8.0_60/bin/java"

echo "JAVA_HOME=/opt/jdk1.8.0_60" >> /etc/environment
export JAVA_HOME=/opt/jdk1.8.0_60
sed -i "s|^PATH=.*|PATH=$PATH:$JAVA_HOME/bin|" /etc/environment