Install Kile 2.0 in Ubuntu 9.04
Like many others, I am very frustrated with the new Kile and Ubuntu Janty has chosen it as default. It is ridiculously slow and the text doesn’t do dynamic word wrap (YES, it doesn’t!). There is a tool to “auto-wrap” but it screws up comments if you use % often as I do. After several months of frustration, I finally uninstalled it and reinstalled the old one. I am not a Linux expert and it is actually much easier than I thought. I probably would have done it couple months ago if I know it is that easy. Simply remove Kile from Synaptic and then download and run the correct version of debian package from this site.
btw, if you forgot to uninstall Kile 2.1 before reinstall 2.0, you may end up having some weird problems. One possible culprit is simply the configuration file is corrupted. A simplest solution is to copy a clean copy from some one else. The configuration file of Kile is ~/.kde/share/config/kilerc
Another note, after reinstalling 2.0, it is better to search kile in synaptic and apply force version from Package->Force Version… Otherwise, it will switch back to 2.1 after the next update.
Add comment June 28, 2009
tvtk conflict with compiz
I tried the following simple tvtk example but it kept hang my ubuntu 8.10 machine.
#!/usr/bin/env python from enthought.tvtk.api import tvtk cs=tvtk.ConeSource(resolution=100) mapper=tvtk.PolyDataMapper(input=cs.output) actor=tvtk.Actor(mapper=mapper) #create a renderer: renderer=tvtk.Renderer() # create a render window and hand it the renderer render_window = tvtk.RenderWindow(size=(400,400)) render_window.add_renderer(renderer) #dreate interactor and hand it the render window # this handles mouse interaction with window interactor=tvtk.RenderWindowInteractor(render_window=render_window) renderer.add_actor(actor) interactor.initialize() interactor.start()
It turns out that compiz is the trouble maker. The script will work if I switch back to metacity. This can be done by pressing ALT-F2 and then typing
metacity --replace
Just a side note, the code should be run in ipython with option -wthread.
Add comment March 6, 2009
ffmpeg and OpenCV
It spent me a day to get ffmpeg and OpenCV working together. There are quite a lot of guides on the web but some of them are probably outdated.
I have Ubuntu 8.10 installed and these two installation guides for ffmpeg and OpenCV work for me after a few tweaks.
1. For ffmpeg, one has to add –enable-shared as a config option. That is,
./configure --enable-shared --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid
2. I first got error message for using ffmpeg after installation.
ffmpeg: symbol lookup error: /usr/local/lib/libavcodec.so.52: undefined symbol: av_gcd
But adding
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
to .bashrc will do the trick.
3. Before installing OpenCV, I have to run
sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev
to avoid compilation error.
Add comment March 4, 2009
Transferring Ubuntu to New Harddrive
My old harddrive had 60 G for my Ubuntu partition and the free space left was less than 2 G (and it is going fast). I figured it was time for me to find a bigger home for my Linux partition. I followed the Backup and Restore post but it missed out a couple simple and very important steps. So I guess it is good to log these here.
Honestly, I think the backup procedure might work (though unlikely, at least I think one shouldn’t just copy the boot folder to a new harddrive) if I only had nothing but a Linux partition. Anyhow, I think it is good to keep a Windows partition even though I rarely go there.
As mentioned in the backup guide, it is important to restore grub. However, the grub restoration guide there didn’t work for me. Actually, I’m not even sure the restoration steps did help or not since I got exactly the same problem–Grub Error 17: Cannot Mount Selected Partition–before and after applying these steps.
Actually, the problem can be fixed easily as follows.
Use Ubuntu Live CD to get on a working OS, from menu->Places->xxG Media to mount your harddrive. Then type
sudo fdisk -l
to see your actual drive location. Most probable reason of grub error 17 is that you have a wrong device link of your drive (wrong info inherited from my previous harddrive in my case). In my case, I have
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6080 48837568+ 7 HPFS/NTFS
/dev/sda2 6081 60801 439546432+ 5 Extended
/dev/sda5 60045 60801 6080571 82 Linux swap / Solaris
/dev/sda6 6081 60044 433465767 83 Linux
My Linux partition sda6 corresponds to (hd0,5). If you have sdb5 and sdc4, they correspond to (hd1,4) and (hd2,3) and so on.
Edit boot/grub/menu.lst in your Linux partition, your drive mostly should be mounted to /media. If you are not certain, you can go to menu->System->Administration->System Monitor and select File System tab, it should display where your drive mount to. In my case, it is /media/disk. Then, edit grub menu by typing (or any other editor)
sudo vi /media/disk/boot/grub/menu.lst
Search for something like the following and
title Ubuntu 8.10, kernel 2.6.24-21-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-21-generic root=UUID=683edbfa-6d51-49f9-ae55-95f07a644b53 ro quiet splash
initrd /boot/initrd.img-2.6.24-21-generic
quiet
replace (hd0,4) by the correct drive link, which is (hd0,5) in my case.
Actually, that is not complete yet. If you reboot now, you will have another problem saying something like UUID=683edbfa-6d51-49f9-ae55-95f07a644b53 not found.
Instead, before rebooting, type ls -l /dev/disk/by-uuid
there should be a couple file with long names which link to one of your drive. For my case, I have
total 0
lrwxrwxrwx 1 root root 10 2009-02-04 08:04 6b453fda-b857-4ba1-a00b-74aadb2123c6 -> ../../sda5
lrwxrwxrwx 1 root root 10 2009-02-04 08:04 91f2ed9a-de11-4dfb-9ccc-46c0ae3e97cb -> ../../sda6
lrwxrwxrwx 1 root root 10 2009-02-04 08:04 960447000446E2BB -> ../../sda1
so, I should replace the uuid in menu.lst by 91f2ed9a-de11-4dfb-9ccc-46c0ae3e97cb. Everything should work fine with these changes.
2 comments February 4, 2009
OU recently acquired matlab for all students and faculty. However, to use at one, one needs to setup vpn. The defacto cisco vpn provided on the OU website is really dated. It doesn’t work with ubuntu unless one does some patches. I gave up after a few tries but instead I found one post mentioned about vpnc. And it is really easy to setup.
After installing it from synaptic, run
sudo vpnc
then input the following info (ur <4×4> and <password> needed of course)
Enter IPSec gateway address: soonerconnect-cox.ou.edu
Enter IPSec ID for soonerconnect-cox.ou.edu: users
Enter IPSec secret for users@soonerconnect-cox.ou.edu: ou-vpn
Enter username for soonerconnect-cox.ou.edu: <4×4>
Enter password for chen6802@soonerconnect-cox.ou.edu: <password>
One can setup even more conveniently as below if network-manager-vpnc is also installed. The version shown is Ubuntu 8.10.

Add comment December 14, 2008
Computer graphic course
I accidentally found a very interesting course from Berkeley today. The title is Mesh Generation and Geometry Processing in Graphics, Engineering, and Modeling by Jonathan Shewchuk.
Add comment November 6, 2008
Installing leJOS NXJ for Lego Mindstorm
I was trying to install leJOS to my Lego minstorm brick. I used ubuntu and got into trouble when I tried to flash the lego brick. I realized that the problem is that I didn’t have write permission to usb device. If I used sudo, I didn’t know how to export the environment variable NXJ_HOME.
I tried sudo export NXJ_HOME=~/lejos_nxj but it didn’t work. It turns out the solution is easy. What I need is simply
sudo -s
Add comment November 4, 2008
Video stuff in Ubuntu
Switching to Linux means relearning of many old skills. I finally got DVD Decrypter working again. I first tried installing it in a guest XP under virtualbox but it doesn’t work very well. It does do ripping but the output is all messed up somehow. On the other hand, installing using wine goes quite well despite my bad experience on wine. The only problem I faced was that decrypter didn’t recognize the drive at the beginning. But this can be easily solved (after some digging in the internet) by setting DVDDecrypter using NT4.0: open winecfg; under application tab, add application…
DVD Decrypter seems to fail for some DVDs but Ripit4me seems to take care of that.
I am still looking for a good tool to transcode MPEG2 video to Divx or Xvid under Ubuntu. I used to use guardian knot in WinXP. I am testing Avidemux right now. It seems doing the job okay.
Add comment October 31, 2008