Monthly Archives: December 2009

Create Encrypted Partition

I use encrypted partitions on all my external hard disks.  This is how I did it:

  1. Install the cryptsetup package.
  2. # aptitude install cryptsetup

  3. Create a partition on the empty external hard disk. Assume the device name is /dev/sdb
  4. # cfdisk /dev/sdb

  5. Setup the encryption on the partition created.  The device name for my newly created partition is /dev/sdb1.  During the setup, you’ll be prompted to give a password to decrypt the partition.
  6. # cryptsetup luksFormat /dev/sdb1
    # cryptsetup luksOpen /dev/sdb1 tempName

  7. Create an extended-3 filesystem.
  8. # mkfs.ext3 /dev/mapper/tempName

  9. Give it a volume name. Mine is called “EXT-80GB”
  10. # tune2fs -L EXT-80GB /dev/mapper/tempName

  11. Close the encrypted partition.
  12. # cryptsetup luksClose tempName

  13. Encryption setup is now completed.  Unplug and plug in the external hard disk, pmount will detect it.  You’ll be prompted to key in your password to decrypt the partition.
  14. End.

Compiz-0.8.4 on Debian lenny

The compiz package in lenny has a serious problem: some sort of race condition making the gnome-terminal not redrawn correctly. Since I use gnome-terminal extensively (coding using vim), compiz in lenny is unusable.

Today, I decided to compile and install compiz from source. After some trial and error, I’ve done it. Below are the steps taken:

  1. Install required tools to compile compiz.
  2. # aptitude install build-essential libxcomposite-dev libpng12-dev libsm-dev libxrandr-dev libxdamage-dev libxinerama-dev libstartup-notification0-dev libgconf2-dev libgl1-mesa-dev libglu1-mesa-dev libmetacity-dev librsvg2-dev libdbus-1-dev libdbus-glib-1-dev libgnome-desktop-dev libgnome-window-settings-dev gitweb curl autoconf automake automake1.9 libtool intltool libxslt1-dev xsltproc libwnck-dev python-dev python-pyrex

  3. Download the official release tar balls from  Then, unzip and untar them.
  4. Compilation must follow the sequence given in the compiz installation guide.
  5. compiz, bcop, libcompizconfig, compizconfig-python, ccsm, compiz-fusion-plugins-main, others

  6. The first package to compile is compiz.  In my case, the directory is called “compiz-0.8.4”.  Open a terminal, change into that directory and run the following command:
  7. $ ./configure --prefix=$HOME/bin/compiz-0.8.4
    $ make install

    The default installation directory is “/usr/local”.  Because there is no uninstall option, I decided to install it into “$HOME/bin/compiz-0.8.4”.  Thus, I can just remove the whole directory if I don’t want it anymore.

  8. To compile all other packages (except ccsm and simple-ccsm), change into each of the directory and run the following command:
  9. $ export PKG_CONFIG_PATH=$HOME/bin/compiz-0.8.4/lib/pkgconfig
    $ export PKG_CONFIG_PATH=$HOME/bin/compiz-0.8.4/share/pkgconfig:$PKG_CONFIG_PATH
    $ ./configure --prefix=$HOME/bin/compiz-0.8.4
    $ make install

  10. For ccsm and simple-ccsm, run the following command:
  11. $ python install --prefix=$HOME/bin/compiz-0.8.4

  12. Now, it’s time to run it.
  13. $ export PATH=$HOME/bin/compiz-0.8.4/bin:$PATH
    $ export LD_LIBRARY_PATH=$HOME/bin/compiz-0.8.4/lib:$LD_LIBRARY_PATH
    $ export PYTHONPATH=$HOME/bin/compiz-0.8.4/lib/python2.5/site-packages:$PYTHONPATH
    $ compiz --replace ccp & emerald --replace &

  14. For me, the last command always fail and leaving me with no window manager at all (no window border, cannot move windows).  Fear not, just run the last command a second time and compiz should be up and running.
  15. Just in case it failed again, you can recall the default metacity window manager with the following command:
  16. $ metacity --replace &

  17. Do take a look at the official installation guide here:
  18. The end.