Thursday, August 31, 2006

Mail server design considerations

Creating a decent mail server is more difficult than it first appears. There are a number of issues which require consideration:
  • no mail that has been accepted should be lost if power is lost or the server is restarted
  • mail messages should never need to be kept fully in memory - they can reach many MB each
  • only one copy of each message should be stored on disc, regardless of number of recipients
  • the delivery of messages for remote hosts that cannot be delivered now (e.g. due to network problems) should be reattempted after a delay of a set number of minutes or hours
  • each message should get a unique id so it can be tracked by the administrator

Labels:

Monday, August 28, 2006

Kamaelia mail server

I have made a simple mail server for Kamaelia. Currently it can receive mail and store it but not forward it on. See /Sketches/RJL/SMTP/ in SVN.
The server's design follows the normal SimpleServer format except that each SMTPServer instance links itself to a shared QualityStorage component which handles saving messages (the 'quality' being that it confirms write-completition). A separate delivery component copies (hard links) messages into local mailboxes.



Mail server component topology

Mail server topology (when finished)


Labels: ,

Thursday, August 24, 2006

HTTP Spider

HTTP Spider has been added to my catalgoue of Kamaelia examples.
Given an initial URL it downloads that page and then, by a breadth-first search, all pages that are linked to by downloaded pages. It can be limited to only download pages with a given prefix.

This example is fairly basic, not saving any pages to disc nor honouring robots.txt files, but it demonstrates the principal and could be adapted to look for 404s or to index a website for searching fairly easily.



HTTP Spider

Wednesday, August 23, 2006

Freeview on Linux (v4l-dvb)

Up-to-date instructions for using a Freecom DVB-T USB stick on linux are now on my website.




I recently ordered a Freecom DVB-T (freeview) USB2 stick. Getting it working on Windows XP was fairly easy but Ubuntu was a different matter. These instructions also allow you to install v4l-dvb on Ubuntu if you have a different adaptor (but then you'll need to find the right firmware yourself).

(These instructions are for the UK only and are followed at your own risk.)

Plug in the USB stick then enter these commands to the terminal:

sudo apt-get install dvb-utils mercurial build-essential linux-headers-$(uname -r)
hg clone http://linuxtv.org/hg/v4l-dvb
cd v4l-dvb
hg update -C 4501
make
sudo make install

# if you aren't using the same adaptor as me, omit the next 2 lines
wget http://thadathil.net:8000/dvb/fw/dvb-usb/dvb-usb-wt220u-fc03.fw
sudo cp dvb-usb-wt220u-fc03.fw /lib/firmware/$(uname -r)/

sudo reboot
Note: the hg update -C ensures that you use a version of v4l-dvb that I know works (some later revisions do not work for me). At your own peril, omit it and so use the latest version.
Your USB stick's LED should be amber upon restart meaning it's working but not tuned in. I'm using Kaffeine as my player - open it now.
kaffeine
It should detect you have DVB and copy some files into your home directory. Now close Kaffeine.
Then you need to find the name of the transmitter nearest to you using WolfBane. I'll assume you are closest to Rowridge.
cd ~/.kde/share/apps/kaffeine/dvb-t/
cp uk-Rowridge uk-OriginalRowridge
nano uk-Rowridge
Round the frequency to 3 significant figures, e.g.
# Rowridge, Isle of Wight
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 490000000 8MHz 3/4 NONE QAM16 2k 1/32 NONE
Now start kaffeine again, select uk-Rowridge (if that's your transmitter) and tell it to scan for channels. Add the channels it finds, close the scanning window and pick a channel. Your USB stick's LED should be green.

And that's all there is to it.

Labels: , ,

Tuesday, August 22, 2006

Bad ubuntu

Ubuntu has been lax in its software testing - in the last few days it rolled out a broken X.org x-server package which renders PCs console-only upon reboot. Thinking it was something I'd done I spent some time trying old kernels etc. - eventually I found an article explaining the cause and solution (using apt to downgrade to an older version). Unfortunately another bug also cropped up as a result of this - Python/Tkinter no longer works. It gives an obscure error message about not knowing what colour "Black" is and dies. I finally tracked this down (with Google) to changes I'd made to xorg.conf while trying to fix it.

IOI and Exam Results

I've returned from the IOI in Mexico, having had a great time. I gained the top Bronze Medal (only 1 mark off a silver!) which I'm quite pleased with. I also received my exam results when I got home.

A-levels:
Physics - A
Computing - A
Maths - A
Further Maths - A
ICT - A
General Studies - B

AS-levels:
Critical Thinking - A

STEP papers: (advanced mathematics papers)
STEP 1 - Distiction (1)
STEP 2 - Distiction (1)

And I also successfully completed a Cisco (CCNA 1-4) course.

I've achieved the grades required to get into university - studying Mathematics and Computer Science at Oxford.

Tuesday, August 08, 2006

Online documentation

Online documentation for the Kamaelia components I've made is now available. These contain the doc-strings from the files they reference but also visual diagrams and links to other pages not possible in the plain text source-code files.

Labels: