Linksys WUSB54gv4 in Debian (Etch)

The wireless support in Debian 4.0ro (Etch) is lacking, unlike MEPIS.

I’m using the Linksys WUSB54gv4, which is distributed by Starhub, so I imagine, most cable users in Singapore would be familiar. There are a few solutions (e.g. ndiswrapper, using the official .inf files from Linksys; downloading the .deb file from Serial Monkey), all of which do not work, for me at least.

If you browse the original CD provided by Linksys, the .inf file for wusb54gv4 is named rt2500usb.inf, which made me assume (incorrectly, as I would find out later) that it was using the Ralink RT2500 chipset. The driver works fine in Windows XP, but somehow it did not work correctly in Linux when using ndiswrapper.

After much Google-ing, i found that it is actually using the RT2570 chipset. You can download the driver here, under section rt2570 (USB).

You will need the Linux headers (if not already installed):

#apt-get install linux-headers-2.6.18-4

Checkout the README after unzipping said driver.

  1. cd Module
  2. make
  3. make install
  4. modprobe rt2570
  5. ifconfig -a

I saw the blessed new (rausb0) interface after the last command. Now you can click:

Desktop > Administration > Networking

and setup rausb0 accordingly. I’m using WEP 128-bit hexadecimal encryption, it works fine.


SimplyMEPIS 6.5 Live CD

I finally got down to (re)setting up MEPIS on my sister’s laptop since performing my own install of Ruby/Rubygems previously.

I was ignorant to the beauty of apt, aptitude and synaptics. But I digress. It took 35 minutes from clicking the “MEPIS install” icon to seeing the new bootup screen. Not too bad! Of course the dialogs are a real walk in the park, the installer sets up practically everything nicely for you.

Once installed, I proceeded to setup the wireless connection, and I must say. The new MEPIS Network Assistant is a real joy to use. It’s a big improvement over the previous, and it even supports WPA! I didn’t test this though.

6.5 has practically everything a regular user could want. Firefox 2, OpenOffice, KSudoku, the GIMP, KSnapshot, Gaim (now Pidgin), Kate, KPDF (which works better than Adobe Acrobat Reader) and Ark. There’s probably a whole host of software that I missed out.

Of course there could be things like Katapult and SuperKaramba, but then I guess, I’m being picky. This is a great release. It even has the Live CD feature so you can boot it up to explore, make sure your hardware is detected correctly — it probably is, or would be, anyway. MEPIS has great hardware detection/support.

OK rave out.

Alternate Background in Lists

Konquerer’s file listing recently looked like an (unreadable) alternating blue/white color scheme.

I think it had something to do with kwin-baghira, because MacOS does alternate item coloring. I installed and removed it, and I guess the theme must have changed it. For 3 days I was wondering what happened. Google-ing didn’t help, or maybe I was using the wrong keywords.

I found it in the end.

KDE Start > Control Center > Appearance & Themes > Theme Manager > Colors > Widget Color > Alternate Background in Lists.

I changed it to an off-white or something.


Faux columns save the day!

I was trying to get a two column layout ready, but the left div (the sidenav) would not display nicely in IE or Firefox. As the sidenav had less “stuff” then the content div, it would be too short, and therefore ugly.

I was Google-ing around for “100% height divs in CSS” until I came across an obscure forum post advising to search for “faux columns”. Lo and behold.

This is the classic of course. And then I stumbled upon this.

I was trying out the 2nd one since it had all the images, css and html to play around with. And then I realized, I could do it on the sidenav instead:

#sidenav {
	background: url('images/sidenav/bg.gif') repeat;
	float: left;

This works perfectly well. So I removed all the extraneous CSS that didn’t work; e.g. setting the html and body heights to 100%; container divs to be block display etc.


Using enum where sensible

On database design here.

Having been schooled in the merits of normalization previously, I had always thought it sensible to use separate tables for dictionary fields. 2NF, 3NF, yes?

Now I have a [members] table where they have some title (Dr, Mr, Mrs, ..). I used to put those in a separate table, so when you retrieve data, you gotta do a join on the identifier… yes. Horror of horrors.

Table joins simply don’t scale as well even though you do indexing and index hinting, so use enum where sensible.

[members].[title] of type enum (‘Dr’,’Mr’,’Mrs’, ..). In my next post I’ll put out a MySQL enum helper for Code Igniter (CI). Given some table, the function returns a list of rows that are of enum data type, nicely separated out.

I’m currently using it with my CI_Smarty class. If you don’t want to learn Smarty syntax, feel free to use the default solution, it works fine as well.


Debian 4.0 (Etch i386) netinst

I made the mistake of downloading and installing the netinst version of Etch.

I’d setup MEPIS 6.0 on my sister’s laptop previously, so I imagined it would’ve been a breeze for Debian.

The installation went successfully, except for the network detection part, but I dismissed it thinking that I’d be able to setup once everything was complete. I was so wrong. I had no IP address, so I was bumbling around without network connectivity, and horrors of horrors, it was commandline-only.

I Google-d around looking for some solutions; thankfully there was a spare laptop for use. It turns out that my (new) company’s sysadmin setup the router to NOT assign IP addressed by DHCP. It also happened that he was not around during the time that I was fumbling around, so there was no one to answer my queries.

In the end, the solution was to add entries to:


These settings are initalized upon each boot, since I am afterall using it as a workstation, not a server.

I found there was this apt package manager that was supposed to let me get X, KDE and all those fancy GUI bells and whistles. But it wouldn’t work. My /etc/apt/sources.list looked like this:

deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20$

#deb etch/updates main contrib
#deb-src etch/updates main contrib

I was supposed to use the command:

# apt-get install kde

So that I could get KDE up and running. It turns out that you need to comment out the line with the CD-ROM,

and getting the message that there was no such package. Hmmm. To cut the long story short, you have to comment out the cdrom line and add in:

deb etch main non-free contrib

So we get our package listing for wherever is good for you:

# apt-get update
# apt-get install x-window-system x-window-system-core kde kdm kdebase --fix-missing

If you get errors like “md5 checksum mismatch”, it was probably a network issue, so repeat.

# startx

There’s a lengthy wait, but no worries, KDE will come up fine. You won’t be needing to use the wizard since you are currently logged in as ‘root’. Just log out, and then reboot:

# telinit 6

It took me two(!) days to get my desktop up to scratch (aptitude, automatix, gaim, iceweasel, katapult, skype, synaptic,, wine, ..) because of the initial network problem and my inept-ness with apt-*.

My advice? Download the 4GB+ ISO for your installs instead.

#debian-linux, #kde

Subversion help

Let’s suppose I’ve designated my Subversion repository to be /home/svn/.

Now I want to create a project “wordpress”:

# svnadmin create /home/svn/wordpress

Assuming you use Apache, make sure that “wordpress” is owned by the Apache user; e.g. nobody.

# chown -R nobody:nobody /home/svn/wordpress

Now go to the “wordpress” directory that you wish to Subversion.

# cd /home/kzhiwei/wordpress/

Note that this is distinct from the Subversion project folder that was created previously. Then import:

# svn import . file:///home/svn/wordpress

You should get a whole bunch of messages listing the files that have been imported from /home/kzhiwei/wordpress/ into /home/svn/wordpress/.