Geeks making the world a bit better.

Entries from June 2007

Doh! Wireless doesn’t work on my R60 laptop

Wireless actually works except for the campus network. I can connect to the network over at the Inn (by accident I assure you) but our campus network uses WEP and does not broadcast SSID. Something about that kills it. Lots of Googling hasn’t produced an answer. Michael suggests trying ndiswrapper.

Update: the following commands will make it work. Why? If I put them in /etc/networks/interfaces, they don’t seem to work. Ack.

sudo iwconfig ath0 essid OurSSID key XXXX-XXXX-XX mode Managed
sudo iwpriv ath0 authmode 2

Update 31 October 2007: Under Gutsy, I edited /etc/network/if-pre-up.d/wireless-tools and added
/sbin/iwpriv ath0 authmode 2 just after the first fi. That seems to work.

WiiWare!

Michael pointed me to announcements of WiiWare, a new facility from Nitendo allowing small developers (like us) to develop and distribute games for the Wii. I think the Wii will make a wonderful platform for accessible games.

My Logitech web-cam is faster on Feisty than on XP!

I was surprised and pleased to see that CVtypes, our python ctypes wrapper for OpenCV, actually worked with my Logitech QuickCam Pro 4000 right out of the box. Later when I started to seriously try it out I was disturbed to see I was only getting 10 frames per second. I tried setting the frame rate with the interface provided by highgui but that fails for the frame rate. Anyone know why? Then I discovered setpwc a command-line utility for viewing and setting parameters on cameras that use Phillips chips. It revealed my camera was set for 10 fps. It was easy to change the setting to 30Hz at 320×240 and now my OpenCV apps run at 30Hz. I was never able to go above 15Hz on Windows XP. This is great.

I used the command setpwc -f 30

cvtypes updated

I have updated the CVS repository at sourceforge with the updates sent by Viji Periapoilan and Sim Harbert of GaTech. Thanks guys.

Open web links from programs in Ubuntu

In both Python and VMware I’ve noticed that attempts to open a link in the browser failed with a very strange file:// link containing double quote characters. A bit of searching revealed this is a problem with the calling syntax from Firefox in System -> Preferences -> Preferred Applications. Changing from “Custom” to “Firefox” so the Command is firefox %s fixes things nicely.

Turn on the firewall!

Murray kindly pointed out that my ssh port was getting assaulted by various lower forms of life trying to guess a user name and password. Yikes! A bit of Googling revealed firestarter a nice GUI for iptables. A few rules limiting access appear to have shutdown the script kiddies.

Running Windows Apps on Ubuntu

I need to test our applications on several versions of Windows and the Flash development environment only runs there. My machines still dual-boot but that is a bother. So I decided to check out ways to run windows on Ubuntu. I first tried QEMU with the kernel accelerator. There are lots of fiddly command-line flags to get right but it worked pretty well. I successfully installed Windows XP though it took a long time. I discovered some tips about disabling ACPI and that sped things up quite a bit. Now full of confidence, I decided to install Flash CS3. The install took a while but it does when running native as well. Unfortunately, when I tried to run the Flash IDE, QEMU would crash hard with bus error, core dumped. I’ve posted a query on the QEMU forum but haven’t gotten a reply yet.

While waiting for a reply I decided to try the 30-day free evaluation offered by VMWare. The download and install went easily though their installer asks an amazing number of questions (thank God the defaults were right). I created the virtual machine, installed XP-sp2, got dozens of updates from Windows Update, and installed Flash CS3 in a couple of hours. I’m happy to report that Flash CS3 works fine running on VMWare Workstation 6 on Feisty 7.04. I’m particularly impressed with the responsiveness of the interface; it appears very usable. Sound isn’t working quite right because VMWare is using OSS which is inexplicably connected to the PC speaker for me. But I can hear it well enough and I see some hints around for how to get it connected to ALSA that I’m hopeful will work.

The VNC interface on VMWare is great! I connected to the virtual machine at work from my Road Runner connection at home and was able to run CS3 with what appeared to be tolerable responsiveness.

I think I’ll likely stay with VMWare. The academic price is only $100 which is lots more than free but affordable. VMWare is a quality product that has worked well for me in the past. This may be a case of getting what you pay for.

Moving /home to its own partition

I wanted to make /home its own partition to ease backups, synchronization, and future upgrades. This is how I did it. I’m no expert so beware of taking these as instructions. I got most of this from this post.

I used Add/Remove in the Applications menu and enabled Gnome Partition Editor under System Tools. Then it appeared in my System -> Administration menu. I used it to convert an empty NTFS partition to ext3. Very easy (and very easy to shoot yourself badly so be careful).

Then I mounted the new partition as /mnt/newhome and copied over my old home like this:

cd /home
sudo find . -depth -print0 | sudo cpio -–null -–sparse –-preserve-modification-time -pd /mnt/newhome

I then compared the two directories using diff -r -q /home/gb /mnt/newhome/gb and found several differences. The most worrisome of these was my Windows XP disk image made with qemu. This 2G file was empty in the copy. I copied it manually with cp and then it was fine. There were several other small differences in files that appear to change all the time. It probably would have been better to do this copying as another user or from the LiveCD.

When I was satisfied with the similarity of the folders, I continued following the directions:

sudo mv /home /oldhome
sudo mkdir /home
sudo umount /mnt/newhome
sudo mount /dev/sdb2 /home

and I edited /etc/fstab as instructed. That turned out to be a mistake! When I rebooted things came crashing down with a scary error message telling me that sdb2 did not have the right sort of magic number to be an ext3 partition. The cold hand of fear gripped my heart. Pete had warned me that he broke his install trying to move /home to a new partition. Would I suffer the same fate and have to endure the derision of a generation of hackers who weren’t born when I started using Unix?

I used Control-D to terminate the emergency shell to see what would happen. Boot continued and I got a login prompt. But, when I attempted to login it complained that /home/gb/ didn’t exist and suggested I use one of the failsafe sessions. I clicked on Options and selected the failsafe terminal session. From there I removed the empty /home directory, and mv’d /oldhome back to /home. Control-D again got me a new login prompt and I could once again login normally.

A quick look with df told me the horrible truth. For some reason the devices had gotten relabeled and what was formerly sdb2 was now sda2. Ack! I figured the UUID business in /etc/fstab must have something to do with it. A bit of reading revealed that UUID exists to cure this problem so I figured I needed to find out the UUID for my new partition. Again, Google and the helpful Ubuntu community came to the rescue and I learned that vol_id would tell me the UUID for a device. I found that and edited my fstab to make the line for my new partition read like this:

UUID=4f09f3c0-b924-4270-b281-1f5f1c1f4b81 /home ext3 nodev,nosuid 0 2

This is the same as suggested except it has the UUID= bit instead of /dev/sdb2. I repeated the rename of /home and creation of the /home directory as a mount point and rebooted again. The tightness in my chest abated as Feisty successfully booted and gave me a login prompt. Logging in revealed everything right with the world and my /home now on a separate partition.

Feisty forgets my Search Domains

When I type ssh gb-cs I mean ssh gb-cs.cs.unc.edu but I couldn’t get that to work consistently at home. I’d add it to the Search Domains section of the DNS tab in the Network Settings dialog but next time I hibernated or rebooted, it would be gone. This tip suggested adding a package and then making a simple change:

Using Synaptics Package Manager I got resolvconf. Then, sudo vi /etc/network/interfaces and I added dns-search cs.unc.edu after the iface line for the wireless interface.

This did not work for me. So I investigated the first proposed solution at the above page, but the file head he refers to has a comment in it that says don’t edit this file by hand so I decided that was a bad idea. The file tail in that same folder was empty and didn’t say that, so I edited it and added search cs.unc.edu. That seems to survive a reboot.

Recording the desktop

Pete says check out istanbul when I need to make a screencast. xvidcap is another possibility but it doesn’t seem to be in Synaptic Package Manager.