A new version of my pidgin plugin is out. It now supports the much requested /lmgtfy (or /stfw) commands. I put up a separate page for all the details.
STFW pidgin plugin version 1.1.0
Posted in pidgin, programming with tags lmgtfy, pidgin, plugin, stfw on 2009-09-19 by KimSTFW pidgin plugin
Posted in pidgin, programming with tags lmftfy, pidgin, plugin, stfw on 2009-09-13 by KimAre you getting tired of people who IM you with stupid questions, too? Most of the time they should just google it? If you’re using pidgin, you can now answer these questions automatically using the STFW-plugin for pidgin, that I developed. ;)
For more information, have a look at the plugin page.
Thanks
…to Michael Malcharek for inspiration and testing.
How to make metacity close a window when you double click on the upper left corner
Posted in linux on 2009-08-22 by KimWhen I switched from windows to linux this was the biggest annoyance I encountered. I couldn’t close a window by clicking on the menu icon in the upper left corner. There have been patches for metacity for quite a while now, but they have been rejected by gnome and haven’t found their way into any of the major distros either. So here is what you do if you simply can’t live without it and want to waste spend some time learning more about linux. If you’re using compiz, read this article.
- Create a new directory (let’s call it mymc) and cd to it
mkdir mymc
cd mymc - Install programs needed for building the package
sudo apt-get install fakeroot build-essential \
dpkg-dev devscripts - Download metacity sources
apt-get source metacity
cd metacity-2.25.144 - Get build dependencies for it
sudo apt-get build-dep metacity - Download the patch to the current dir.
- Install the patch program
sudo apt-get install patch - Apply the patch
patch -p0 <metacity-patch.diff - Build the package
dpkg-buildpackage -rfakeroot -uc -b
This might take a while… Your deb files will be in mymc. - Remove the currently installed metacity package
sudo apt-get remove metacity - Install your version instead and reinstall ubuntu-desktop
cd ..
sudo dpkg -i metacity_2.25.144-0ubuntu2.1_i386.deb
sudo apt-get install ubuntu-desktop - tell your package manager not to apply updates to it in the future
sudo aptitude hold metacity - Open gconf-editor, go to apps, then metacity, then general, add a key called “close_on_double_click_menu”, set type to boolean and value to true.
- Restart X and you’re done!
I tested this on a fresh install of Ubuntu 9.04 (Jaunty). Please tell me whether it worked for you too in the comments!
How to switch from ext3 to ext4
Posted in linux with tags convert, ext3, ext4, file system, grub, linux, migrate, performance, rsync on 2009-08-22 by KimThere are several how-tos out there on how to convert an ext3 file system to ext4. Those all use tune2fs to convert the file system in place, adding the features exclusive to ext4. While this is certainly the quickest approach, it doesn’t give you all the performance of a fresh installation with ext4, since the extends feature will only be used for new files. To get the most out of ext4, you should completly recreate the partition. I’ll show you how to do so savely:
Preparation
To make sure the data isn’t changing while we’re copying it, we boot from a Jaunty live CD. You’ll need to use the current version, since older versions of Ubuntu do not support ext4.
Burn the CD and boot from it.
You need to backup the data on your ext3 partition while preserving all the meta data (ownership, permissions etc). The best tool for this is rsync. Let’s assume your ext3 partition is /dev/sda1 and your backup partition is /dev/sdb1. The backup partition should use ext3 too, otherwise some meta data might be lost. Do not use FAT!
Backing up your data
Mount the devices (if they aren’t already)
sudo mkdir /media/ext3
sudo mkdir /media/backup
sudo mount -t ext3 /dev/sda1 /media/ext3/
sudo mount -t ext3 /dev/sdb1 /media/backup/
Create the backup
sudo rsync -axvh --progress /media/ext3/ /media/backup/
Reformat
This is the easiest part.
sudo umount /media/ext3/
sudo mke2fs -t ext4 /dev/sda1
Restoring your data from backup
Mount the new file system
sudo mkdir /media/ext4
sudo mount -t ext4 /dev/sda1 /media/ext4/
Restore the data
sudo rsync -axvh --progress /media/backup /media/ext4/
Since the backup isn’t needed anymore, unmount it.
sudo umount /media/backup/
Reinstall grub
If the partition you converted contains the /boot directory, you also need to reinstall grub.
sudo grub-install --root-directory=/media/ext4/ \
/dev/sda1
sudo grub
root (hd0,0)
setup (hd0)
Here, hd0,0 is the device/partition number that corresponds to sda1. The most reliable way to find out which partition number you need is the find command. Try
find /boot/grub/menu.lst
in grub.
Change fstab
- Open /etc/fstab as root.
- Change the entry for your partition from ext3 to ext4.
Change menu.lst
Those changes are only needed if the partition you converted is your root partition.
- Find out the new UUID.
ls -l /dev/disk/by-uuid | grep sda1
- Open /boot/grub/menu.lst as root.
- Change the UUID in the root= kernel option for every entry.
I did this on Ubuntu 9.04 (Jaunty). Did it work for you, too? Or did it mess up your harddrive and you want to kill me? ;) Tell me in the comments!
A chess clock for your browser
Posted in programming with tags chess, javascript, jquery, programming on 2009-08-20 by KimI recently finished work on my little chess clock project. It is a website that displays a chess clock that can be used from any javascript-enabled browser. It is very configurable, in that it has five different time control modes: sudden death, hourglass, overtime, Bronstein delay and Fisher delay.
On the technical side, I was surprised how easy and pleasant this was thanks to jquery. What I’d like to change some day though is the design, as it doesn’t really have one now. ;)
If you want to try it out, read the help first. Tell me what you think in the comments!
How to make compiz/gtk-window-decorator close a window when you double click the upper left corner.
Posted in linux with tags annoyance, compiz, gtk-window-decorator, linux on 2009-08-19 by KimWhen I switched from windows to linux this was the biggest annoyance I encountered. I couldn’t close a window by clicking on the menu icon in the upper left corner. I tried to live with it for a while, tried some workarounds, but I didn’t like it. After lots of digging, I finally found a patch for compiz/gtk-window-decorator. The patch was never accepted though, and I doubt it will ever make it into any of the major distros, so here is what you do if you simply can’t live without it and want to waste spend some time learning more about linux.
UPDATE: I just tried this under Ubuntu 9.10 with compiz 0.8.4 and it works flawlessly.
- create a new directory (let’s call it mycompiz) and cd to it
mkdir mycompiz
cd mycompiz - install programs needed for building the package
sudo apt-get install fakeroot build-essential \
dpkg-dev devscripts - download compiz-gnome sources
apt-get source compiz-gnome
cd compiz-0.8.2 - get build dependencies for it
sudo apt-get build-dep compiz-gnome compiz - download the patch to the current dir.
- install the patch program
sudo apt-get install patch - apply the patch
patch -p1 <double_click_to_close.diff - build the package
dpkg-buildpackage -rfakeroot -uc -b
This might take a while… Your deb files will be in mycompiz. - Remove the currently installed compiz-gnome and compiz packages
sudo apt-get remove compiz-gnome compiz - install your version instead
cd ..
sudo dpkg -i compiz-gnome_0.8.2-0ubuntu8.1_i386.deb
sudo dpkg -i compiz_0.8.2-0ubuntu8.1_all.deb - tell your package manager not to apply updates to it in the future
sudo aptitude hold compiz-gnome - open gconf-editor, go to apps, then gwd, add a key called “close_on_double_click_menu”, set type to boolean and value to true
- restart X and you’re done!
Please tell me whether this worked for you in the comments!
I wrote a similar article explaining how to do the same thing for metacity.