Archive for September, 2004

Wifi roaming with “waproamd”

Sunday, September 26th, 2004

I’ve just discovered waproamd, a tool to adjust the configuration of a wireless nic to the access point it is associated with.

waproamd is a roaming daemon for wireless IEEE 802.11 NICs supporting the Linux wireless extensions. It is intended to configure the WEP keys according to the networks found.

It works just as well without WEP, though. Below is a description for my setup without WEP.

The configuration of waproamd is in three tiers: waproamd, access points and interfaces.

Waproamd configuration is only one file: /etc/default/waproamd.

INTERFACES="ath0"
HOTPLUG_INTERFACES=""
ARGS="-M"

I my case the interface “ath0” is a cardbus card, so I add the “-M” option, just in case the card isn’t inserted when waproamd is started. It will monitor the card and react when it appears.

Then I have a script for each access point I use. They live in /etc/waproamd/scripts and their names are either the MAC address of the access point, or a name of the form essid:essid where the last “essid” is replaced with the name of the access point. The name might not be unique, though, so the MAC address option is probably the better way.

The access point scripts will have to be executable to work. They will be called with just one argument, either “start” og “stop”, and with a few environment variables: $ESSID and $IFACE for the detected ESSID and the network interface in question.

My scripts are all the same:

#!/bin/sh

case "$1" in
start)	ifup $IFACE=$IFACE-$ESSID ;;
stop)	ifdown $IFACE ;;
esac

In this way I can have a separate network interface configuration in /etc/network/interfaces for each (nic, essid) pair. If one day several access points on my list have the same ESSID, I’ll have to hardwire the name into the script, but until now it hasn’t been necessary.

In /etc/network/interfaces I have several stanzas for each nic, one for each access point. Many use DHCP, and just say

iface ath0-ESSID inet dhcp

where ESSID is replaced with the actual access point name, but a few combinations set up static IP addresses and other options.

I love my internet connection

Saturday, September 25th, 2004

I have my internet connection through a community network called Bryggenet, which serves a part of Copenhagen with internet, cable and telephony services. The connection is a shared 62Mbit/s line, brought to my house through a 100Mbit/s network

25 september 2004, 09:50

$ apt-get update
Fetched 9470kB in 3s (2420kB/s)
$ apt-get dist-upgrade
Need to get 95.8MB of archives.
Fetched 95.8MB in 17s (5453kB/s)

Ups, I forgot to mention the price of this connection: $25/month, flat fee.

10 oktober 2004, 18:00

$ apt-get update
Fetched 9491kB in 3s (2499kB/s)
$ apt-get dist-upgrade
Need to get 62.4MB of archives.
Fetched 62.4MB in 13s (4625kB/s)

Sawfish and the Gnome “Run Application” dialog

Friday, September 24th, 2004

It has long annoyed me that I couldn’t attach a keyboard short cut to the Gnome panels “Run Application” dialog in Sawfish.

When people ask on the net about it, the answer is usually “Press Alt-F2”, but that only works in metacity, not in sawfish.

In earlier versions of Gnome there was a gnome-run program, but that has gone.

Then, on this blog, I found an explanation and a little program that opens the “Run Application” dialog. All that’s missing is to use add a Sawfish binding to the program, using the sawfish function run-shell-command.

Download a copy of gnome-run.c here. The program is a simple X11 program, compiled with:

gcc gnome-run.c -o gnome-run -L/usr/X11R6/lib -lX11

Looking at the program, I would expect to be able to do it directly from sawfish, but somehow it didn’t work. What I tried was this:

(send-client-message 'root (x-atom '_GNOME_PANEL_ACTION)
     [(x-atom '_GNOME_PANEL_ACTION_RUN_DIALOG) 0] 32)

but, alas, it didn’t work. Would have been neat, though 🙂

Printing from Mozilla Thunderbird through Xprint

Thursday, September 23rd, 2004

I finally managed to print emails decently from Mozilla Thunderbird with the Xprint backend. Until now it has always come out too big, too small, in the wrong fonts or something else. It has never printed anything presentable.

The necessary instruction on how to make it work are here.

First of all, remove the copies of the PostScript fonts that Xprint keeps for itself. On my Debian systems they’re found at /usr/share/Xprint/xserver/C/print/models/PSdefault/fonts. Just remove the directory. It has to be done as root.

Then go to your Mozilla Thunderbird preferences directory. It’ll be something like ~/.mozilla-thunderbird/default.XXX/ where the last three ‘X’ are individual. There ought to be a chrome sub-folder here, and in that you’ll have to place a file called userContent.css. Just edit it with any editor of your choice. Create it if it doesn’t exist. It has to contain this text:

@media print {
   body, table {
       color: black;
       font-family: 'Times New Roman', times, serif;
       font-size: 12pt;
   }
   tt, pre {
       font-family: 'Courier New', courier, typewriter, monospace;
   }
   :link, :visited {
       color: black !important;
       text-decoration: underline !important;
   }
   .moz-text-plain {
       font-family: 'Courier New',courier,monospace !important;
   }
}

It might seem like black magic if you’re not accustomed to Cascading Style Sheets, but it tells Mozilla Thunderbird what fonts and sizes to use for printing.

Last thing is to exit Mozilla Thunderbird and restart it to get the style sheet to take effect.