python install with custom build directory

A custom build directory (e.g. --build-base=/tmp/foo) can only be specified for the build command, not the install command. However, build and install can be easily combined in one call:

python build -b /tmp/foo install

Fix Ubuntu Unity Grid/Tiling problems on T420

I had all sorts of problems on my Thinkpad T420 with Unity in Ubuntu 11.10, most notably that the grid/tiling feature did not work. I am using the on-board HD3000 graphics card with the i915 driver, but since my T420 has also a discrete graphics chip (which I had disabled in the BIOS) I also had the nvidia drivers installed.  However, this seemed to prevent the i915 drivers from loading correctly (e.g. glxgears did not run).  The work-around is to remove the nvdia-drivers and -settings packages:

sudo apt-get remove nvidia-settings nvidia-current

Reboot, and tiling should work again.

Reinstall all your packages after fresh install of Ubuntu

Sometimes you want to reinstall Ubuntu from scratch (i.e. instead of upgrading), but of course also reinstall all the packages that you had before. Beforereinstalling, dump your installed software with

dpkg --get-selections > installed-packages

and of course make sure you keep this file somewhere where it doesn’t get deleted during the install process. Then, after installing Ubuntu, reinstall all your packages with

# install dpkg which is not installed by default
sudo apt-get install dpkg

sudo dpkg --set-selections < installed-packages
sudo apt-get dselect-upgrade

Wait everything to install. Done.