Some interesting links

Here’s some random URLs I thought might be interesting:

Browse Happy
A website explaining why Internet Explorer is unsafe for use on the web. Unlike most other websites of its kind it is not favoring any particular ‘alternative'(read: broadly safe) browser, but instead provides a list of alternatives and a possitive description of each.

sorttable: Make all your tables sortable
This site has a nifty looking piece of Java script which instantly allows any table on the web-page to be sorted by any column by defining it to be of the class ‘sortable’. Since this is Java-script the sorting is done client-side so no need to resubmit the page for re-ordering nor will it whore over the server its running on with lots of needless(at least as far as serving web-pages is concerned) sorts. Unofficial APT repositories
A place to share usefull (Unofficial) repositories for Debian.

Simple PHP Blog
The software my original Blog was using – no SQL needed, it’s all stored as text files. Easy to configure and update – just decompress and go. Fantastic! My only gripe is that most of the themes are fixed-width, and the only non fixed-width theme is not configurable wrt colours. Creating themes doesn’t appear to be very straight forward either, unfortunately. Maybe I’ll have to write my own blog software which only uses CSS for theming, so creating a new theme simply means modifying a CSS file… hmm, yet another project I’ll probably never finish.

Weighted wired & wireless network (and ifplugd)

I was looking for a way of preventing me from having to wait for DHCP to timeout when booting with no network cable attached (actually I was looking for the correct parameter to adjust the timeout and make it much less – but the solution I eventually found was much neater). Most of this comes from an article on the CLUG Wiki about roaming between wireless and wired networks.

First of all I installed ifplugd. Under Debian this was easy, I configured eth0 (my inbuilt wired card) as the only static interface, and ath0 (my inbuilt wireless card, using madwifi) as a dynamic interface so I could turn the wireless on and off using ifup and ifdown without it connecting to the network when it was in range without my permission (I’m not paranoid, I know they’re coming to get me ;) ).

# apt-get install ifplugd

I also changed -d10 to -d1 so that the interface goes down 1 second after the cable comes out instead of 10 as suggested on the CLUG Wiki (link above).

I then edited ‘/etc/network/interfaces’ to ensure that no ‘auto’ lines pointed to eth0 or ath0.

Starting ifplugd was then just a case of:

# ifdown eth0
# /etc/init.d/ifplugd restart

The install was tested by unpluging and re-pluging the network cable and listening for the ‘beep’s that ifplugd emits when it detects these changes.

I continued following the instructions on the CLUG Wiki to setup the priorities of the interfaces so that if both a wired and wireless connection were available it would use the wired one in preference to the wireless.

First I installed iproute:

# apt-get install iproute

Next I modified ‘/etc/network/interfaces’ to look like this:

# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
noauto eth0
iface eth0 inet dhcp
up /usr/local/sbin/route-prios $IFACE 1

# Wireless
noauto ath0
iface ath0 inet dhcp
wireless-essid omitted for security
wireless-key omitted for security
up /usr/local/sbin/route-prios $IFACE 10

Debain, madwifi-ng and module assistant

I installed Debian GNU/Linux on my laptop (over Arch Linux) last week, and used module-assistant to install the Madwifi driver for my atheros-based wireless card using The Debian Way(TM).

Here is just a quick note of the commands needed to install madwifi using module-assistant under Debain GNU/Linux:

# apt-get install madwifi-source madwifi-tools module-assistant
# m-a update
# m-a prepare
# m-a a-i madwifi
# modprobe ath_pci

…and that’s all there is to it. Not quite as easy as ‘emerge madwifi-driver’ or ‘pacman -S madwifi-ng’ but still fairly straight forward.

Hmm, Blog

I recently (re-)discovered I’d actually installed a blog script, and never written anything down! Oh well, no time like the present to start – I wonder how long I will be able to keep writing entries before I:

  1. get bored with the whole ‘blog’ idea
  2. simply forget about or neglect the blog to the point that it disappears from my mind (again!)
  3. I get distracted by some project or other.

I recently managed to set up a Debian-based mail server. I originally searched google and came up with a number of guides to doing this which looked quite good, albeit long but it’s a project I’ve been planning for a while so I decided to bite the bullet and have a go. After installing Debian and playing around with various different approaches for a bit, I discovered an entry on another blog at The Tech Terminal explaining how the author had setup a Debian Mail Server. This simply said that all I had to do was enter this:

# apt-get install courier-imap
# apt-get install postfix
# postconf -e 'home_mailbox = Maildir/'
# postconf -e 'mailbox_command ='
# /etc/init.d/postfix restart

at the command line. This was certainly a lot easier that the 8-page guide I had be following previously, and it worked :).

Using other guides to install spamassassin and squirrelmail and it was all working very nicely. Fetchmail and gotmail were easy to install and configure using the man pages so I didn’t need to enlist google’s help with them. I now have a single server with 2x40GB HDDs (configured for RAID 1 using a PCI PATA RAID card) which goes and fetches emails from my 2 POP accounts and my hotmail account and delivers them to my local user on the machine (for my purposes I decided LDAP was overkill and that dropping the mail to a local user’s Maildir made more sense). This means I can now access my mail using an IMAP client on either my desktop or laptop, or I can use a web-browser from any other location.

One small snag did run into is that Maildir creates a directory for each directory on the server (as you’d expect) but doesn’t nest them. I was expecting them to nest and it took a while (and some head-banging) for me to discover that Maildir actually uses a ‘.’ to represent sub-directories.
e.g. this structure:

: :-Mushroom
: :-Snake

becomes this Maildir structure: