All posts by albertw

Sometimes you can be proud of the EU

The start of 2010 has been an interesting time in the EU. Where, in stark contrast to most places, we seem to be coming up with good legislation and ideas.

February 22nd:
The EU Commission proposes a ban on all commercial fishing of Atlantic bluefin tuna by 2011. Predictably the Japanese are the ones who are protesting most. But you would expect that from a nation that seems to have a policy of making marine wildlife extinct. Release Here.

February 25th:
Since 2000 Israel has enjoyed a special relationship with the EU resulting in exemption of import duties. However the German water filtering company Brita imports good from the occupied west bank, and German customs, seeing the goods were manufactured in illegal settlements denied the company the preferential treatment they expected. This went to the German courts who asked the European Court of Justice for a decision. That decision, came on February 25th and clarified that since settlements in Palestinian territory are illegal under international law that goods from these areas cannot be classified as ‘Made in Israel’ and therefore cannot avail of preferential trade agreements with Israel.

March 10th:
The Anti-Counterfeiting Trade Agreement (ACTA) is a treaty that is being negotiated in secret outside of any established framework. No portions of the discussions have been made officially public and from the leaks it is clear that this is treaty is a very bad one. The Lisbon treaty that is now in force contained a provision intended to make the workings of the EU more transparent and to give the Parliament (the elected bit of the EU) more power, that provision required that the Parliament must have full and immediate access to information at all stages of international negotiations. They clearly didn’t have that with the ACTA so the Parliament voted, by 663 to 13, to demand that this information be made available to them. Not only that but they threaten to go to the Court of Justice if that doesn’t happen.

But the MEP’s didn’t stop there. They scupperd any plans of a so called three strike policy being automatically implemented also. And they also have called for investigations into the issue of warrant-less searches of data while crossing EU borders.

The full press release from the Parliament is here.

Monitoring a BT Voyager 2110

Recently out broadband usage seems to have gone up quite significantly. This, naturally, has been blamed on me. And the Mac. As Min put it “this only became an issue since the mac came into the house!”.

Now you can log into the web interface of the Voyager and get the bytes since it connected. You can also reset some network traffic counters in Status -> Traffic Stats, but none of these really give you a feel for whats happening over time. Enter MRTG. I’ve been using MRTG to monitor traffic on interfaces since college and it’s very good at it. By default it will communicate with a device by SNMP, however the Voyager does not appear to have an SNMP daemon.

Thankfully MRTG can also execute a command to get its data.

You can log into the Voyager using ssh with the admin user and your admin password. This gets you to a very basic shell but one thing you can run is ifconfig which will report on the network interfaces in the box including their TX and TX byte counts.

There doesnt appear to be an easy way to set up public key authentication with the voyager so I fell back on some old school tricks for automating logins – perl & expect.

This expect script will log into the Voyager and get your ifconfig output:

#!/usr/bin/expect -f
spawn ssh [email protected]
expect "password:"
sleep 1
expect "> "
sleep 1
send "ifconfig\n"
expect "> "
send "logout\n"

Next we need to grab the counters from there in a way that MRTG will understand. That is the recieved count on the first line, the transmitted count on the second, uptime is the third and the name is the fourth (mrtg docs). I just use the first and second. ppp_8_35_1 is the interface I need on my router, yours may be different. This perl script calls the expect script above to get the data.


my $flag=0;


foreach $_ (@op) {
    if ($_ =~ /ppp_8_35_1/ ){

    if ($flag == 1 &amp;&amp; $_ =~ /RX bytes:(\d+).*TX bytes:(\d+)/){
        print $1."\n";
        print $2."\n";
        print "0\n";
        print "0\n";

Next we need a configuration file for MRTG. Mine is below. The various options are explained in the mrtg docs

EnableIPv6: no
WorkDir: /var/www/mrtg

Interval: 5

Title[ppp]: Network traffic (ppp)
<h1>Network traffic (ppp)</h1>
Target[ppp]: <code>/usr/local/bin/</code>
Unscaled[ppp]: n
WithPeak[ppp]: ymw

It’s the just a matter of setting up a cron job for MRTG to get the data every 5 minutes:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/mrtg /usr/local/etc/bt.cfg > /dev/null 2>&amp;1

Over the course of a few hours you’ll see the patterns in your usage:
mrtg graph

30 day song challenge in one go

Right. Enough people have messaged me about this on facebook so rather than do the day by day thing, which I’ll get bored of by tomorrow, I’ll just list them all now. This is a bit of an oldskool list; i should do it again with more tunes from this century sometime 🙂

day 01 – your favorite song
Disarm – Smashing Pumpkins
day 02 – your least favorite song
Sinead – nothing compares 2u. Radio gets turned off when this comes on

day 03 – a song that makes you happy
Tequila – Terrorvision

day 04 – a song that makes you sad
Cure – pictures of you

day 05 – a song that reminds you of someone
Tom Petty – Learning to Fly

day 06 – a song that reminds you of somewhere
Garbage – Stupid Girl

day 07 – a song that reminds you of a certain event
Nelly Furtado – Turn Off The Light

day 08 – a song that you know all the words to
Cant find the Clancy Brothers version on youtube – The Boys of Wexford!

day 09 – a song that you can dance to
Nellie the Elephant. I can still picture Skippy holding on to the record player in the teachers club trying to stop it skipping while a roomful of Goths thumped the floor!

day 10 – a song that makes you fall asleep
Chris de Burgh – Don’t Pay The Ferryman

day 11 – a song from your favorite band
I am one – Smashing Pumpkins.
Could have picked any number of songs here.

day 12 – a song from a band you hate
Whipping Boy – any song will do, but here’s We Don’t Need Nobody Else

day 13 – a song that is a guilty pleasure
Whigfield – Saturday Night 🙂

day 14 – a song that no one would expect you to love
Ace of Base – The sign

day 15 – a song that describes you
Hard to answer without coming across as a total muppet.
So I better pick a good song at least. Levellers – One Way, this version from Glastonbury

day 16 – a song that you used to love but now hate
Madonna – Like a Prayer. Just got overplayed at the time.

day 17 – a song that you hear often on the radio
BellX1 – Great Defector

day 18 – a song that you wish you heard on the radio
Temple of Love – Sisters of Mercy

day 19 – a song from your favorite album
Cherub Rock – Smashing Pumpkins from Siamese dream.
Could also bee anything from Doolittle.

day 20 – a song that you listen to when you’re angry

day 21 – a song that you listen to when you’re happy
Something Happens – Hello Hello Hello Hello Hello Petrol

day 22 – a song that you listen to when you’re sad
In the rare auld times

day 23 – a song that you want to play at your wedding
And did! The Foundations – Buttercup (KOH!)

day 24 – a song that you want to play at your funeral
Salve Regina

followed by Prince Buster and Suggs! Madness Enjoy yourself

day 25 – a song that makes you laugh
Wierd Al – Yoda

day 26 – a song that you can play on an instrument
Well I used to be able to play most of it.
The Entertainer – Scott Joplin

day 27 – a song that you wish you could play
Joe Satriani – Surfing with the Alien

day 28 – a song that makes you feel guilty
No song makes me feel guilty. ?
day 29 – a song from your childhood
A-ha – Take on me

day 30 – your favorite song at this time last year
Eliza Doolittle – Pack Up