Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
425 lines (282 sloc) 12.8 KB

Debian Wheezy on Lenovo Carbon X1 ultrabook

Wifi firmware

Put a copy of the iwlwifi package on a USB stick so that the installation program can get onto the network:

BIOS boot options

Do a normal install using the amd64 DVD-1 ISO image, copied to a USB stick using dd. Set the boot methods in the BIOS to "legacy only". Beware that changing this option can break an existing installation!

Shell aliases

# FIXME make private dotfiles repo in ~/work/dotfiles-private

echo 'source $HOME/work/bin/bash-aliases-x1' >> $HOME/.bashrc


Edit /etc/apt/sources.list as follows:

deb stable main contrib non-free
deb wheezy-updates main contrib non-free
deb wheezy/updates main contrib non-free
deb wheezy contrib
deb wheezy main non-free
# deb wheezy main
deb wheezy main

deb-src stable main contrib non-free
deb-src wheezy-updates main contrib non-free


sudo apt-get update
sudo apt-get dist-upgrade


wget -q -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-4.3

sudo adduser carlo vboxusers # log out and log back in

Useful packages

sudo apt-get update

sudo apt-get install unison2.32.52-gtk meld vim-gtk build-essential git colordiff          \
                     ghc rsync sshfs xinput ipython python-nose python-networkx            \
                     python-setuptools python-numpy python-scipy graphviz ecryptfs-utils   \
                     cryptsetup pavucontrol screen durep baobab keepassx xinput htop       \
                     transmission-gtk gnupg vlc mplayer gstreamer0.10-plugins-base         \
                     gstreamer0.10-plugins-good gstreamer0.10-fluendo-mp3                  \
                     gstreamer0.10-ffmpeg calibre conky-all geeqie libjpeg-progs           \
                     tcsh inkscape mpop flac moreutils xchat-gnome tcl-tclreadline         \
                     genisoimage gitk rdiff-backup unrar ffmpeg wmctrl exiftags            \
                     iotop mencoder audacity pdftk                            \
                     kino vorbis-tools ffmpeg2theora iftop pdf2djvu cpphs parted           \
                     libgetopt-tabular-perl libzmq-dev python-zmq libblas-dev libblas3     \
                     liblapack-dev liblapack3 fort77 gfortran gfortran-multilib ack-grep   \
                     libdata-dump-perl libdata-printer-perl stress winpdb strace djview    \
                     libhdf5-serial-dev btrfs-tools emacs24 beep openjdk-7-jdk autoconf    \
                     python-appindicator libappindicator3-1 libappindicator3-dev           \
                     gir1.2-appindicator3-0.1 llvm libgc-dev ocaml camlp5                  \
                     liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev                        \
                     liblablgtk-extras-ocaml-dev liblablgtksourceview2-ocaml-dev           \
                     liblablgtkmathview-ocaml-dev hevea texlive-fonts-recommended          \
                     texlive-latex-extra texlive-math-extra libav-tools normalize-audio    \
                     cmake network-manager-vpnc sqlitebrowser mediainfo pwgen

sudo apt-get install ghc ghc-doc ghc-haddock ghc-prof haskell-doc haskell-platform \
                     haskell-platform-doc libghc-mtl-prof libghc-primitive-prof \

sudo apt-get install deb-multimedia-keyring
sudo apt-get update
sudo apt-get install avidemux mpeg2dec sox

sudo apt-get install apt-file
sudo apt-file update

# Google chrome, manual download.
sudo dpkg -i Downloads/google-chrome-stable_current_amd64.deb

Source nice shell stuff

Add to .bashrc:

. $HOME/work/github/dotfiles/.bashrc-extra
. $HOME/work/private-dotfiles/bash-extra

Encrypt home directory

If not using an encrypted LVM, run this as root (do not sudo):

ecryptfs-migrate-home -u carlo


Manualy download, then:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo dpkg -i skype-debian_4.2.0.11-1_i386.deb
sudo apt-get -f install
sudo apt-get install libpulse0:i386

To configure the headset, first start skype and pavucontrol:

pavucontrol &
skype &

Start a test call in Skype, change the recording input and output of the Skype application (in pavucontrol) to the USB headset.

Thunderbird binary tarball

To avoid errors about the xul library on Debian wheezy:

sudo apt-get install ia32-libs-gtk

On Debian testing there are these errors:

XPCOMGlueLoad error for file /home/carlo/opt/thunderbird-24.1.0/ cannot open shared object file: No such file or directory

XPCOMGlueLoad error for file /home/carlo/opt/thunderbird-24.1.0/ cannot open shared object file: No such file or directory
Couldn't load XPCOM.

so fix with:

sudo apt-get install libdbus-glib-1-2:i386 libgtk2.0-0:i386

Run from my own binary tarball:


Something is wrong with my Thunderbird profile as it tries to run firefox no matter what:

$ grep firefox .thunderbird/l3fwjt8m.default/*js
user_pref("", "/opt/firefox/firefox");
user_pref("", "/opt/firefox/firefox");
user_pref("", "/opt/firefox/firefox");

so here is an ugly work-around:

sudo mkdir -p /opt/firefox
sudo ln -s /usr/bin/google-chrome /opt/firefox/firefox


sudo dpkg -i d/dropbox_1.6.0_amd64.deb

Newer kernel

Webcam may not work by default, so just build a newer kernel with the uvc video things turned on:

sudo apt-get install libncurses5 libncurses5-dev kernel-package
cd ~/opt
wget -c
cd /usr/src
sudo su -
tar Jxf /home/carlo/opt/linux-3.13.7.tar.xz
cd linux-3.13.7
make mrproper
make clean
wget -O .config
make oldconfig
make-kpkg --rootcmd fakeroot --config menuconfig --initrd --us --uc -j 4 kernel_image
cd ..
dpkg -i linux-image-3.13.7_3.13.7-10.00.Custom_amd64.deb

Reboot, check that the built-in webcam works.

Python bits

sudo python
sudo pip install youtube-dl
sudo pip install pyflakes
sudo pip install markdown
sudo pip install jinja2 tornado # for latest ipython

MATE desktop

wget -qO - | sudo apt-key add -
sudo apt-get update
sudo apt-get install mate-desktop-environment-extra


Sometimes necessary to blow away cabal and ghc directories if changing overall versions:

rm -fr .cabal .ghc # if necessary

Build GHC 7.6.3 and Haskell Platform 2013

Download source from

sudo apt-get install ghc libncurses5 libncurses5-dev    \
                     xsltproc docbook-xsl hscolour      \
                     libgl1-mesa-dev                    \
                     libglc-dev                         \
                     freeglut3-dev                      \
                     libedit-dev                        \
                     libglw1-mesa libglw1-mesa-dev      \
                     happy alex

cd ~/opt
rm -fr ghc-7.6.3_build/*
cd ghc-7.6.3
make clean
./configure --prefix=$HOME/opt/ghc-7.6.3_build &> configure.log

Check configure.log to see if the HTML documentation will be built.

make && make install
echo 'export PATH=$HOME/opt/ghc-7.6.3_build/bin:$PATH' >> $HOME/.bashrc
cd ..

Get a new shell or set the $PATH manually, make sure that the new GHC binary is the default:

$ which ghc

Download the Haskell Platform from

cd ~/opt
tar zxf haskell-platform-2013.2.0.0.tar.gz
cd haskell-platform-2013.2.0.0
./configure --prefix=$HOME/opt/haskell-platform-2013.2.0.0_build/
make && make install
echo 'export PATH=$HOME/opt/haskell-platform-2013.2.0.0_build/bin:$PATH' >> $HOME/.bashrc
cd ~

Get a new shell or set the $PATH manually.


Install a newer cabal binary:

echo 'export PATH=$HOME/.cabal/bin:$PATH' >> ~/.bashrc

cabal update

Some of the cabal defaults are inappropriate.

sed -i 's/-- documentation: False/documentation: True/g'         ~/.cabal/config
sed -i 's/-- library-profiling: False/library-profiling: True/g' ~/.cabal/config

sed -i 's/-- jobs:/jobs: $ncpus/g' ~/.cabal/config

Now install the latest cabal:

cabal install --haddock-hyperlink-source cabal-install
cabal update

When running cabal install, always add the --haddock-hyperlink-source option:

cabal install --haddock-hyperlink-source

Apparently this is a known issue, has been open for two years: I guess everyone else is using online documentation only? Handy:

alias ci='cabal install --haddock-hyperlink-source'

My Haskell stuff


cd ~/work/github/checker

Camera scripts

cd ~/work/github/camera-scripts

Haskell other

Need ghci-ng to get haskell-mode to work:

ci ghci-ng

Haskell and Vim integration

See for details on making all these plugins work.


ci hoogle ghc-mod hdevtools
hoogle data

Pathogen (for ease of installing Vim modules):

mkdir -p ~/.vim/autoload ~/.vim/bundle;
curl -Sso ~/.vim/autoload/pathogen.vim

Ensure that these lines are in ~/.vimrc:

execute pathogen#infect()
syntax on
filetype plugin indent on


cd ~/.vim/bundle
git clone
cd ~


Prerequisite for ghc-mod:

git clone ~/.vim/bundle/vimproc.vim
cd ~/.vim/bundle/vimproc.vim


Install ghcmod-vim:

cd ~/.vim/bundle/
git clone

Add a symlink so that it works with .lhs files as well:

cd ~/.vim/bundle/ghcmod-vim/after/ftplugin
ln -s haskell/ lhaskell




sudo apt-get install octave

Minc toolkit

sudo apt-get install cmake cmake-curses-gui
sudo apt-get install \
             build-essential g++ \
             cmake cmake-curses-gui \
             bison flex \
             freeglut3 freeglut3-dev \
             libxi6 libxi-dev libxmu6 libxmu-dev libxmu-headers

git clone --recursive git:// minc-toolkit
cd minc-toolkit
rm -fr build
mkdir build
cd build

ccmake ..  # hit 'c'
           # go down to MT_BUILD_SHARED_LIBS,  hit enter to turn 'ON'
           # go down to MT_BUILD_VISUAL_TOOLS, hit enter to turn 'ON'
           # hit 'c'
           # hit 'g'
make &> make.log   # check the log!
sudo make install

TODO - the rest

# XMonad
sudo apt-get install libxrandr-dev trayer
cabal update
cabal install xmonad xmonad-contrib xmonad-extras xmonad-utils

# Edit /usr/share/xsessions/xmonadcarlo.desktop

[Desktop Entry]
Comment=This session starts xmonad

# As normal user:
xmonad --recompile


## pyminc
# git clone FIXME
cd pyminc
sudo python install

## nipype
sudo pip install nibabel
sudo pip install traits traitsui
cd nipype
sudo rm -fr build && sudo python install