Overview

How to install a computer the way I like it

Introduction

The following explains how to install a machine just the way I like it. Some configuration files (e.g. ssh keys) are obviously private so I don't share them here. They are easily identified by reference to files in /home/tcorbettclark/Private/.

After installing the base OS the whole process takes about an hour.

Disk partitions

I install from scratch on every OS release, alternating between two 16G partitions, and using a third partition /localbackup to transfer data between the two (and for backups). I don't bother to keep a /home partition because of ever-changing user configuration files.

Mint derived from 14.04

Install Mint. Then sort our any office proxy settings e.g. by putting the following in /etc/environment:

http_proxy=http://proxy.localoffice:3128
https_proxy=https://proxy.localoffice:3128

and creating /etc/apt/apt.conf.d/00proxy containing:

Acquire::https::proxy "http://proxy.localoffice:3128/";
Acquire::http::proxy "http://proxy.localoffice:3128/";

Then update with:

sudo apt-get update
sudo apt-get upgrade

Reboot.

Immediate packages

sudo apt-get install encfs ntp byobu rdesktop mercurial git vim htop tree

(More software will be added later, such as Sublime Text and Dropbox.)

Fish

A much nicer shell than Bash:

sudo apt-add-repository ppa:fish-shell/release-2
sudo apt-get update
sudo apt-get install fish
chsh -s /usr/bin/fish
mkdir -p ~/.config/fish/functions
cp fish/functions/* ~/.config/fish/functions/
cp fish/config.fish ~/.config/fish/

Chrome

sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-get update
sudo apt-get install google-chrome-stable

Sign in, and let it sync apps, extensions, bookmarks, etc

Google Hangout for voice/video

Install Google voice and video plugin by logging into http://gmail.com and starting a hangout.

Dropbox for file syncing, sharing, and backups

Install Dropbox by following their instructions.

Obviously the http-proxy may not be required. Be prepared to hack dropbox daemon loading code to overcome limitations of urllib.urlopen and proxy when behind particularly annoying proxies.

(To speed up synchronising, seed the Dropbox directory from a local copy.)

Encfs for encrypting files on Dropbox

I use Encfs to encrypt certain files stored on Dropbox.

Mount my encrypted folder:

mkdir -p /home/tcorbettclark/Private
encfs /home/tcorbettclark/Dropbox/Private /home/tcorbettclark/Private

Note that absolute paths must be used.

Incidentally, unmount with:

fusermount -u /home/tcorbettclark/Dropbox/Private

Sublime text editor

Download and install Sublime Text:

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

Add the licence key by cutting and pasting into the sublime menu from:

/home/tcorbettclark/Private/install/License.sublime_license

Set as default editor:

echo 'export EDITOR="subl -w"' >> .bashrc

Define my preferred keybindings by seeding from

Install sublime's own package manager by following instructions on

Then add Sublime packages, e.g.:

Then set my preferences from

Also open a coffeescript file, go to Preferences->Settings - More->Syntax Specific - User and add { "tab_size": 2 }

Also may need to edit the "binDir" setting in CoffeeScript.sublime-settings.

ssh

Install:

sudo apt-get install openssh-server

Setup my keys using:

mkdir -p ~/.ssh
chmod 700 .ssh
cp /home/tcorbettclark/Private/install/ssh/* .ssh/
chmod 600 .ssh/*

Note that all private keys should be encrypted using:

openssl pkcs8 -topk8 -v2 des3 -in ~/.ssh/id_rsa.old -out ~/.ssh/id_rsa

Xterm

Allow meta-forward-word to work, and set fonts and colours:

  • Edit.Keyboard Shortcuts - disable all menu access
  • Set font to Ubuntu Mono size 11

Byobu

Use screen mode for ctrl-a:

byobu-ctrl-a screen

Configure the status bar by editing ~/.byobu/status e.g. to say:

tmux_left="hostname session"

Node

Get up to date version of node:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Install npm directly with:

curl -L https://npmjs.org/install.sh | sh

Optionally configure proxy for npm with:

npm config set proxy http://proxy.localoffice:3128
npm config set https-proxy http://proxy.localoffice:3128

Mercurial

cp hgrc ~/.hgrc

Git

git config --global user.name "Timothy Corbett-Clark"
git config --global user.email "timothy@corbettclark.com"
git config --global credential.helper cache
git config --global core.editor "subl -n -w"
git config --global color.ui true

Nose

Set defaults for python unittest runner:

cp noserc ~/.noserc

Virtualenv and friends

We will perform a little bootstrap dance to obtain the most recent versions of all Python packages (controlled with pip not apt):

sudo apt-get purge python-pip python-virtualenv virtualenvwrapper ipython
sudo apt-get install python-setuptools python2.7-dev

We install python2.7-dev so that some pip's can compile C from source.

Use easy_install to install pip to the system, and then pip to install virtualenv and invewrapper:

sudo easy_install pip
sudo pip install virtualenv invewrapper

Then to create a virtual env and install Python packages at user-level (i.e. no further global pip installs):

pew-new whatever
pip install --upgrade setuptools ipython nose coverage yanc flake8 grin

Note that it is usually a good idea to upgade setuptools as the packaged one will probably be out of date.

Some pip packages have deb dependencies. For example, to install pip package psycopg2, first do:

sudo apt-get install postgresql-server-dev-9.3

Xmonad for tiling window management

Install xmonad with gnome-panel

sudo apt-get install xmonad suckless-tools xcompmgr gnome-panel
mkdir ~/.xmonad
cp xmonad.hs ~/.xmonad/

See:

Add a little eye candy by running gnome-session-properties and add the following on startup:

xcompmgr -c -f -D 3 &

I like my windows to own their own menus, so:

sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt

Logout, select "Gnome xmonad", and log in again.

UPS (for APC SC420)

(Obviously optional).

Install:

sudo apt-get install apcupsd

Adjust /etc/apcupsd/apcupsd.conf:

UPSNAME home-ups
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/ttyUSB0 # although check logs

Enable configuration in /etc/default/apcupsd and start:

sudo /etc/init.d/apcupsd start

Wait a few seconds for /var/log/syslog to report starting up.

Test with sudo apcaccess status.