"we are aware, and regret, that our website does not comply with many WCAG/508 requirements"). If you are using com_extcalendar on your site, check whether it's safe, or replace it with a better calendar.
I/O error, and I dropped into an
unusable remote terminal with no working commands. Fortunately, apache2 was
still up and running, and the web service has been working without
interruption since the hard drive crash, albeit with no syncs from
www-master.
Today, Sergio visited
the campus and had a look. It was a XFS crash, which got cleanly repaired
using an install CD. We have an empty partition in the box, and will probably
move the system to it temporarily, and back to the RAID, but on ext3. When
the box was back online, I just had to resume the upgrade process, make mdadm
happy and update lilo.conf before rebooting into the new
kernel.
This box uses LILO for some obscure reason I can't remember too clearly
anymore. The box has just one partition on a md array, on two SCSI disks on
a aic7xxx-based controller. Can anyone hint me why GRUB would have failed on
us back in sarge, and if any fixes in the etch version would
work any better? Using LILO here is error prone, and basically feels like a
step back. Anyway, www.es.debian.org
is now back up and running with updated content.
Sindominio.net had its bi-annual
upgrading party last monday, but unfortunately I wasn't able to help much
as when I tried to log into the server, I must have caught the system in the
middle of some key lib upgrade or something, and again I was locked in a
unusable shell which would only segfault. Given my previous experience, I
assumed that something had gone wrong and the box would need to be fixed at
the console, and after 20 minutes I gave up helping on that front. Until I
noticed, quite a long while later that I was still getting mail from the
server. I managed to log in to discover the upgrade was done, with just
a few bits remaining to be done. The major issues were encountered with our
pam and ldap setup, plus
nscd kept dying
causing quite a lot of mayhem all over the place. Great work from Seajob,
Syvic, nogates, apardo and the rest of the people who handled it! With etch,
we can finally move back to an official Debian kernel, something we've been
longing to do for a long time. The only pending upgrade issue is that we need
to move from our old jabber server to either the traditional
jabberd 1.x or
ejabberd; our
current implementation is no longer supported in Debian.
The last of the etch upgrades stories involves
Sofcatal 's servers. The box was
running on a CentOS 4.4, which was moved
away into a subdir just after booting Debian-Installer, and then lobotomised
so it would run as a Linux-VServer
under a new Debian etch install. I'll probably write more details about it
soon though, as it could be a maybe less scary alternative to Guillem's
debtakeover.
Yay for etch!


The lunar eclipse, as seen from the Catalan countryside. Pics by Jordi Jover.
Many were quite tired by 3 or so, so we started setting up tents and went
to sleep by 4. Sunday was a slow day, dedicated to cleaning up our stuff and
eating leftovers cooked on a new fire. We were back in Val ncia at 8PM or so
and even after showering and cleaning my hair with shampoo, my head still
smelled like smoke. Actually, I think it might still smell a tiny bit
today.
In short, a lovely weekend, which I hope to repeat next year. Too bad
the lunar eclipse bit will be missing for quite a few more years. :)


The lunar eclipse, as seen from the Catalan countryside. Pics by Jordi Jover.
Many were quite tired by 3 or so, so we started setting up tents and went
to sleep by 4. Sunday was a slow day, dedicated to cleaning up our stuff and
eating leftovers cooked on a new fire. We were back in Val ncia at 8PM or so
and even after showering and cleaning my hair with shampoo, my head still
smelled like smoke. Actually, I think it might still smell a tiny bit
today.
In short, a lovely weekend, which I hope to repeat next year. Too bad
the lunar eclipse bit will be missing for quite a few more years. :)
sudo grml-crypt start /media/usb4/cryptoloop $MOUNTPOINTGotcha: don’t confuse sudo’s “password” prompt with grml-crypt’s “Enter LUKS passphrase” prompt, the cryptoloop password won’t bring you anywhere on the sudo prompt. Preparing the CA directory For the CA, create a dedicated directory in the mounted cryptoloop file system. You’re originally supposed to copy the entire EasyRSA directory tree in there, but I’d recommend to only link the files from your system’s EasyRSA directory to automatically take advantage of distribution updates. You’ll need at least these links:
lrwxrwxrwx 1 mh mh 56 Dec 25 23:23 openssl.cnf -> /usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf lrwxrwxrwx 1 mh mh 52 Dec 25 23:22 pkitool -> /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool lrwxrwxrwx 1 mh mh 60 Dec 25 23:23 whichopensslcnf -> /usr/share/doc/openvpn/examples/easy-rsa/2.0/whichopensslcnf
Configuring your CA The only thing you cannot link is the vars file which contains your CA’s local settings:ln -s /usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf . ln -s /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool . ln -s /usr/share/doc/openvpn/examples/easy-rsa/2.0/whichopensslcnf .
Comments have been removed from this file. Better copy the file from /usr/share/doc/openvpn/examples/easy-rsa/2.0/vars and edit it to your needs. I added the two PKCS11 variables since you won’t otherwise be able to issue certificate requests. Creating the CA Next, decide on a shell instance where you will do most operations, and source vars in there. Next, run /usr/share/doc/openvpn/examples/easy-rsa/2.0/clean-all. If you do this in a directory of an already-in-use EasyRSA CA, you’ll need to restore your backup. To actually initialize the CA, run pkitool --initca --pass. If you do not give the --pass parameter, you’ll create a CA that can issue certificates without asking for a passphrase, which might not be a brilliant idea. Choose a reasonably secure pass phrase. Creating Certificates - the simple and suboptimal way You can now simply proceed to create an arbitrary number of pairs of “private” keys and associated certificate by simply calling pkitool <clientname> and/or pkitool --server <servername>. Depending on your security policy, you can mandate the private keys to be protected by a passphrase (adding --pass to the command lines), but you’ll have the expense of being asked for the passphrase every time you start a new openvpn daemon. Creating Certificates the Right Way I have put the “private” in quotes since the keys created this way are not really private: The key was created on the box hosting the CA, was stored on the local (crypted) file system and needs to be moved to the target system via a secure channel. Doing so the right way is harder than expected, so it is usually the better way to keep the private key really private by creating it directly on the target system. On the target system, you need OpenVPN installed, and openssl. After the certificate was created, you can remove openssl again. Creating a private key is part of a key-pair generation process that also leaves a certificate request. The contents of the certificate request is public, and you can safely move it to the CA box and convert it to a certificate by signing the request. You only need to make sure that nobody exchanges your target system’s certificate request for her own before you sign it as you might end up certifying a wrong identity. For the rest of this document we’re going to assume that you have ssh access to the target system and have verified the ssh host key, so that you can be reasonably sure to be connected to the right system. To create a certificate request, you can use this script, which I have called create-easyrsa-cert-req:export EASY_RSA=“$(pwd)” export OPENSSL=“openssl” export PKCS11TOOL=“pkcs11-tool” export GREP=“grep” export KEY_CONFIG=$($EASY_RSA/whichopensslcnf $EASY_RSA) export KEY_DIR=“$EASY_RSA/keys” # Issue rm -rf warning echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR export KEY_SIZE=1024 export CA_EXPIRE=3650 export KEY_EXPIRE=3650 export KEY_COUNTRY=“DE” export KEY_PROVINCE=“” export KEY_CITY=“” export KEY_ORG=“Zugschlus.de” export KEY_EMAIL=“mh+easyrsa-mh-openvpn@zugschlus.de” export PKCS11_MODULE_PATH=“dummy” export PKCS11_PIN=“dummy”
When called without parameters, it creates a certificate request for an OpenVPN client certificate, and when you call it with “server” as parameter, it will create a server certificate request. In any case, it will leave two files in the current directory. They are named after the current host name, and have the extensions .csr and .key. The .key file is your private key. keep it private! The .csr file is the certificate request which you can now move to the keys subdirectory of your CA directory via scp or other means such as an USB stick. To do the actual signing, invoke pkitool --sign <hostname> and enter the CA passphrase. You can ignore the error message that there was no .key file to chmod. Gotcha, when signing a server certificate, use pkitool --server --sign <hostname>. Move Certificate to the target host You can now move the certificate to the target system. Since you’re probably going to need the root certificate and the certificate revocation list as well, you can move the .key file (if created on the CA system), the .crt file, and ca.crt to the target system. These files are public, so there is no need for a secure channel. Revoking Certificates Since an OpenVPN server’s only means of authentication is to check whether the certificate presented by a client is signed by the “right” CA, the only way to revoke VPN access is to revoke the certificate. This is also done on the CA system by calling /usr/share/doc/openvpn/examples/easy-rsa/2.0/revoke-full <client-name>. This creates a crl.pem file which contains a list of all revoked certificates. You need to have a mechanism to distribute that list to all systems that might need it, and it is recommended to have this automated. Remember, if you do not distribute the .crl file, the systems are not going to know about revoked certificates.#!/bin/bash set -u TMPDIR=“/tmp” export OPENSSL=“openssl” export PKCS11TOOL=“pkcs11-tool” export GREP=“grep” export KEY_CONFIG=“/usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf” export KEY_DIR=“$TMPDIR/keys.$$” mkdir -p $KEY_DIR export KEY_SIZE=1024 export KEY_EXPIRE=3650 export KEY_COUNTRY=“DE” export KEY_PROVINCE=“” export KEY_CITY=“” export KEY_ORG=“Zugschlus” export KEY_OU=“$(hostname --fqdn)” export KEY_EMAIL=“mh+$(hostname)-ovpn-cert@zugschlus.de” export DEBUG=1 umask 077 if [ “$ 1:-foo ” != “server” ]; then /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool --csr $(hostname) else /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool --csr --server $(hostname) fi mv $TMPDIR/keys.$$/* . rm -rf $TMPDIR/keys.$$

The ruins of the Roman Antonine Baths
After Carthage, we went to Sidi Bou Said, a small touristic town, which had
the peculiarity and beauty of having all windows and doors painted in a
beautiful light blue colour. Our last stop for the day was in Tunis, where we
visited the most amazing medina of the whole week. Unlike the new medina in
Jasmine Hammamet, this one was literally packed with people going up and down
the maze of very narrow streets. Every few metres you'd come across a new,
attractive smell coming from the few salons de th or spice, leather
or perfume shops. Here we finally started developing our haggling skills, and
managed to get a few items for reasonable amounts.

Streets of Sidi Bou Said
Back at our hotel, everyone tried to get a quick dinner and go early to
bed, as next morning we were taking a bus for our trip around the South. There
was time to call yet another time to the Airport, to find out that one of the
luggage pieces had been found. While there was no news about my suitcase, we
shared a taxi to the airport to pick the found suitcase, and see if mine was
actually there by any chance. Unluckily, it wasn't, so I wouldn't have any
clothes for the desert visit. Some people in the group were kind enough to
lend me some t-shirts and pants. For my underwear, I actually resorted to using
some of Bel n's (no kidding, it was way too sexy :P), while mine dried up
after some manual washing.
The alarm clock went off at 5:15 or so, and soon after we were ready in the
hall with our small bags. When the bus was ready to pick us up, the guide
said we weren't allowed in, as we weren't on the list. WTF? We were nearly the
first ones to book and pay for it! So he finally let us in, for a short while,
until he realised there was no space for everyone, so he demanded that we
got off. Of course, we didn't, and a long and very disgusting argument started
between the guide, us and a few people who had seen us pay for our trip, and
were trying to support us. To make a long story short, we ended up stepping
down when I noticed the bus driver calling the police, and after Rejeb, our
guide, told us the other bus would be waiting for us at the travel agency if
we quickly took a taxi there. We of course knew that was a fantasy to get the
bus moving, but dealing with the police at 6:30AM wasn't on my list of
activities for the day, so we finally gave up to let the rest of the people
get in time to their visits, as they were very tightly scheduled to make
everything fit in two days.
Nobody was waiting for us at the travel agency, but we were promised our
money back, which did happen in the evening; our plans for Thursday and Friday
were a bit broken though, and the rest of the morning was spent looking for
alternatives. When we had managed to book a new trip in a different agency for
Saturday, we took the bus to Nabeul, the capital of the province, well known
for their medina specialised in pottery.
In Nabeul, we lived a tourist trap which I found to be quite original. Not
having walked 3 metres into the city walls, some young dude stops us and tells
us that he knows us, as he works in the restaurant of our hotel . I totally
didn't remember his face at all, but why not? So he quickly tells us Nabeul
has good carpet workshops, and her sister is working in one which is regulated
by the Government, and you can only visit two days a week. Coincidentally,
Thursday is one of them! So he literally grabs us by the arm and takes us to
one of the streets perpendicular to the main market street, and we enter a
carpet shop. To the right, his sister probably being like 45 years
older, is knitting a nice carpet on the loom. And a few seconds after, we're
taken upstairs, where a Teletienda show starts before us. Without being
asked if we want to buy a carpet, some other dude starts to unroll carpets
and more carpets before us, talking in some very basic Spanish. While we're
offered jasmine tea, which is really nice, Ali the brother quickly excuses
himself and vanishes, leaving us with the salesman, which continues unrolling
more and more before us, now helped by someone else. When 10 minutes later
we convince them that we won't buy any carpet, he asks a donative for his
young employee, who has unrolled and will now roll back a zillion carpets.
Back in the hotel, we have dinner with a pair of Catalans from our flight,
and when we tell us about the carpet place, they tell us they went over the
same story like one hour before us!
On Friday, we got some advice on other places to visit, and decided to go
up to Cape Bon and visit Kerkuan, the only important remainings of a
Punic city which, when conquered by the Romans, was destroyed to the
grounds, but not rebuilt on top (they were busy with Carthage). Romans did an
excellent job when destroying cities, and the result is a site which still
lets you see perfectly how a small town (around 1,500) looked like 2,000 years
ago.

Ruins of a Kerkuan neighbourhood, with their red bathrooms nearly intact
To reach Kerkuan we had taken the bus up to Nabeul and then our
first luagge to Kelibia, where we took a taxi (after no less than
half an hour arguing in French with the taxi driver to settle on a rate for
a ride to Kerkuan and then to the tip of the Cape in El Haouaria. Luagges
are undoubtedly the best way to travel medium distances for very little money,
while getting mixed with locals. During our ride up North, we chatted with
a nursing student from Kelibia who was going back to her town for the weekend.
She was really open, like most of the people we found in Tunisia, and we ended
up exchanging our post addresses; we still need to send her a postcard from
Val ncia soonish. This area wasn't so touristic, so the roads, while totally
acceptable, weren't as good as the highway from Tunis to Sfax we were
used to.
We had seen some bits of the local driving skills , but the luagge driver
performed some of the most extreme overtakings I've ever seen. These happened
every three of four minutes, so after a while I was actually amused about
what was going on. We would overtake two lorries on one go when there was
absolutely no visibility; if things went too far, people would just slow down
to let the overtaker get back into his lane on time, and those coming ahead
would just use their headlamps to make them know it was just a bit too
close.
The taxi driver, annoyed at us, took us to Kerkuan but didn't wait for us;
he immediately left, leaving us without any transportation in the middle of
nowhere. After a visit at the site, we walked around 2.5 kilometres back to
the main road, where we decided it was too late and risky to continue the
journey up to El Haouaria, so we waited on the road gutter for a taxi. The
first one which stopped was, to our surprise, the same bastard who left us
one hour before, who stopped, laughing at us a little. Luckily some other
taxi came by in the correct direction, and soon forgot about that man.
After a taxi, luagge and bus ride, we were back in Hammamet, and the
desert group had already got back from the two day trip. We were asked over
and over what happened, what did we do, etc. People who hadn't talked to us
before would come over and see; we were really surprised about the warm
welcome we had. After dinner, we improvised a customes party, and many people
managed to dress up in Tunisian/arabic fashions using bed sheets and so on. We
had to wake up at 5AM next morning, but didn't go to bed until 2AM.
Nothing could go wrong this time. We had our tickets, we had confirmed we
would be going on Sunday the night before, so at 6:15, our new guide came in,
and came straight towards me. He said something in German, and after I told
him I spoke absolutely no German, he said huh, well you know the bus is full
of Germans, and my indications will be in German? . Pretty incredible, but
again a fuckup by the agency. My ticket said, clearly: Sahara safari. Bus +
4x4. (ALL)
. Turns out ALL meant Allemand, not everything included ,
although we had requested English pretty clearly. This was quite a minor
problem though, after having no clothes for a whole week and having been left
behind two days before.
I think we were really lucky getting that German group, though. We were
only 16 people on the minibus, making the stops a lot faster than the normal
ones, where 55 persons need to get out and in of the bus. We had our own
Routard guide for Tunisia, so we could read about the places we were
about to visit before getting ther. Also, I surprisingly knew much of what
our guide was talking about, just missing the details he talked about oil
production in Tunisia compared to Spain's, among other topics . When the
landscape was becoming drier and drier, Bel n and I spotted something dark far
away ahead in the completely straight road. As it became bigger, I started
thinking it might be the #1 place to visit for me in Tunisia: El Djem's
impressive Roman amphitheatre.
When we got off the bus, I was totally excited. Before me, the walls of
an incredibly well preserved, huge Roman building; in fact, the best Roman
ruins in the whole continent. El Djem's amphitheatre was the third biggest
of the Roman empire with 35,000 seats, only surpased by Rome's and Capua's.
It remained mostly intact until the 17th century, when some of its stones
were used to build the city and some of the treasures taken to the
Great Mosque of Kairouan, but when it took more damage was during two
consequent wars, when the Turks didn't have many problems to blow part of
the wall away using cannons to end up a siege of the city.

The Roman amphitheatre of El Djem
The underground tunnels are intact, and it's difficult to not have
flashes of Gladiator while
walking under the arena's trapdoors. Sadly, there was little time to spend
there, and we had to continue the journey after just 45 minutes. I would have
spent half of the day there.
From here, the landscape truly started to get drier and more desertic.
The south of Tunisia is a giant olive field, until you reach the Great
South, where it's dry enough that the only thing that grows in the
land are rocks. Hours later we arrived in Matm ta, the very famous
troglodyte village of small holes in the ground. Although I was
curious about being there, watching how organised and massive tourism has
destroyed these Berber's ways of life dissapointed me greatly. Our guide
stopped the bus in one of the pits, which was decorated with white and
light blue. In the first room, an old woman was grinding something in a
small, stone mill. The dwellers of the few pits still used by their
original inhabitants now make a living by letting people into their homes
and getting dinar as a payment for taking photographs. What the woman was
doing was just a bit of theatre, part of the show. After this first room, we
got into the middle of the pit, which had a series of other passages to some
rooms, some of which were simply open so we could get in and have a look.
I felt a little bit like violating someone's privacy, and wondered how much
the house had changed in the last years.

Inside a troglodyte underground house in Matm ta
After our visit, we continued up the mountains of Matm ta, and after
going by a giant "WELCOME TO MATMATA" sign drawn in white in the middle of
a mountain, Hollywood style (!), we stopped for a brief photo-stop
(sic). Indeed, the view was quite impressive, and is universally famous as
one of the filming spots of Tatoonie scenes in
Star Wars: A New Hope.
Speaking of famous places, a few minutes later we stopped at the top of one
of the hills, were we'd have lunch in the Hotel Sidi Driss, a place of
pilgrimage for Star Wars fans, as it was the troglodyte pit which served
as the Skywalker's home. The place is full of references to the film saga,
and one of the open pits is full of set pieces stuck into the walls. We were
served couscous, which wasn't bad, but was cooked and served in the most
genuine fast-food fashion. Everyone there gets couscous to eat, apparently,
and it's the same in many other touristic places in the area.

Matm ta's lunar landscape
From here, our journey headed straight West, in the middle of the
rocky desert, until after some time, you could start to see lines of palm tree
branches planted here and there, a sign that rocks would soon disappear, being
replaced by sand and dunes. As when we were approaching El Djem, at some
point a huge, dark spot appeared on the horizon.
Douz, probably named after some 12th French batallion which stayed there,
is a small town in the very limit of the Sahara desert, built right next
to a huge oasis, exclusively dedicated to palm tree plantations, making dates
production a big source of income, along with, of course tourism. The travel
agencies use Douz as the starting point for several-day trips into the
desert, camel rides and stuff like this. Our guide offered us getting a camel
and carriage ride in Tozeus for 20 dinar, but Bel n and I declined. He didn't
seem to be too happy about it, and had no problem commenting this in German
and Arab with the driver (Spanisch and Spanien were clear
to me). We learned that the agency (or the guide) makes around 3 Dinar for
everyone who contracts the camel rides, after speaking to one native young
kid who worked in the camel place. While our German trip mates got dressed
in berber fashion, we opted to walk into the desert and play around in the
sand on our own. I discovered a few desert insects which were unlike anything
I've seen anywhere, and their diminute trails were all over the dunes.
Looking West, the view was astonishing, with only thousands of kilometres of
yellow dunes ahead us.

The evening sun over the dunes
After they came back, we were taken to our hotel, which was really
impressive. After leaving our stuff in our room, we headed back to the
desert, which was like 300 metres away, to see the sunset over the Great
Dune . There's a street which literally serves as the frontier between the
rocky ground and the sand desert. From there, you could see many lines of
palm tree branches, which are planted by locals in a futile attempt to stop
the inexorable advance of the desert. Women in Douz and other towns in the
desert limit spend their days sweeping the entrances to their homes, as sand
gets in really fast. A small village next to Douz even had to be abandoned and
rebuilt in some other place, with the old one being finally devoured by the
dunes.
When it got dark, we still had some time to kill before dinner, and we
discovered a hammam in our hotel. I got in, and saw there was a bored young
man inside. He informed us about the prices, and after some short deliberation,
we realised we'd spent half of the camel money in some Arab relaxation; while
I got a really cool massage, Bel n enjoyed a Turkish bath. I spoke to the
guy for a while, and he said not that many people used that hammam. He actually
handed the list of services since 2002, which easily fitted in one piece of
paper. People don't know what they are missing; he explained that most of the
hotel's clients just showed no interest in the baths. I wonder how
Fins or Norwegians would react, given their sauna culture. The dinner and
breakfast in that hotel was absolutely awesome, and I actually ate too much
to have an easy sleep.
Next morning we had to be ready at 5:30. That's pushing my limits. The bus
started crossing the Chott Jerid when it was still quite dark. The
chotts are dry, salt lakes in the middle of the desert, which during
some seasons do get some water, sometimes from the underground. The Chott
Jerid is the biggest of the three chotts in the area, and the views are
fantastic. It's like a giant, totally flat muddy sea which reflects light
creating dangerous mirages of oasis-like dark patterns. Before the
construction of the recent road that links Douz and Tozeur, crossing the
chott was so risky that many people died in the attempt. We had the unique
opportunity to see the sun rise over the salty horizon.

Sunrise at the Chott Jerid
Again, on our way to Tozeur, we were offered a carriage ride for ten dinar,
and again we declined. The guide then asked us if we had no money or what.
So in Tozeur we basically wanted to walk around the oasis fields, and ended
up talking most of the time with some old man who sold drums and desert
roses.
On a 4x4, we went up North to Chebika, a really cool town with a small
oasis of thermal water, which I guess was around 40 C. The short walk to
the wall where the oasis surfaced was packed with children who insistently
begged for money or offered necklaces and other items. It was difficult to
make them understand you didn't want anything. We then went up the mountain
behind Chebika through a road which had its own piece of history. It seems
that during WWII, Rommel suffered an Allied siege in Chebika, with a range
of mountains behind their backs. The Allies gave him one month to surrender,
and he took his time to answer. During that time, he ordered his engineers to
design and build a road which would let them escape Chebika through the
steep mountains, and they managed. When the ultimatum expired, the Allies
apparently found out Chebika had been abandoned by the Germans, including
tanks and most of their equipment. So, on the way up, a few kilometres away
from the Algerian border, there was another typical visit to the biggest
oasis waterfall in Tunisia, which was several metres high.

The oasis at Chebika
Our Sahara trip would soon end, and after lunch we headed Northeast on
our way to Hammamet. On our way back, we stopped in Kairouan, one of the
key Islam pilgrimace spots, with the Great Mosque as the biggest attraction.
Unluckily, as we arrived after lunch, we didn't had a chance to see it.
Apparently it is really impressive. We haggled a bit for a pair of
babouches and a small leather couch in the medina.
We came back to our hotel around 7, and found most of the people around
the hall. After the obligatory update on how it went, we went to bed
as we were exhausted, and of course we had to get up really early to
head to the airport. The airport was at that early time of the morning a
total chaos, and while people stood in the checkin lines, I tried to find
out what was going on with my still lost luggage.
I went back to the lost luggage window, which would be closed for 5 more
minutes. When they finally opened, they told me once again they had no clue
about what was going on with my luggage. I finally understood they had
no clue: my tracking number wasn't in their database. I asked
them if I could have a look at the unreclaimed luggage storage room. They
kindly opened a small door for me, and invited me to go inside and have a look.
The view was gross: hundreds of lost bags all over the place. As I was in a
bit of a hurry (I actually had to get back to Barcelona), I asked him where
to find the bags of one week ago, and he nearly bursted into laugher. Okay,
I had to look all over the place, scanning every piece of luggage in an
attempt to spot mine. There were bags of absolutely every type in there.
In one of the corridors, I sensed a disgusting smell, and figured out some
poor guy may have food or something in one of their lost bags, which was
rotting in that horrible room. So wrong: soon after I found myself nearly
stepping on a puddle of shit, as if someone had literally dumped it right
there. Oh my... luckily my search was nearly over and unsuccessful, and I
got back to Barcelona with the hope of finding my bag in El Prat. After looking
in their two storage rooms I realised I'd probably not see the luggage again,
which is a real pain in the ass.
A few hours of train later we were back in Val ncia, with a feeling of
having spent 3 or 4 weeks in Tunisia, not just 8 days. Really a great place
to visit, not only for their cultural treasures, both current and ancient, but
for the openness of their people. I hope I'll be back at some point!
#!/usr/bin/python
#
# Copyright (C) 2007 Enrico Zini <enrico@debian.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# From python-debian
from debian_bundle import debtags
# From python-apt
import apt
aptCache = apt.Cache()
pkg = 'debtags'
# Read the debtags database
db = debtags.DB()
tagFilter = re.compile(r"^special::.+$ ^.+::TODO$")
db.read(open('/var/lib/debtags/package-tags', "r"), lambda x: not tagFilter.match(x))
# Get the tags of the package
tagset = db.tagsOfPackage(pkg)
# Get the list of packages that have some tag in common with pkg
nextpkgs = set()
for pkg, tags in db.iterPackagesTags():
if tagset & tags:
nextpkgs.add(pkg)
# Score every package by the number of tags it has in common with pkg
def pkgscore(pkg):
score = 0
for tag in db.tagsOfPackage(pkg):
if tag in tagset:
score += 1
return score
# Show the top 20 related packages in reverse score order
display = sorted(nextpkgs, key=pkgscore, reverse=True)[:20]
for num, pkg in enumerate(display):
aptpkg = aptCache[pkg]
desc = aptpkg.rawDescription.split("\n")[0]
print "%2d) %s - %s" % (num + 1, pkg, desc)
Now, imagine an application that allows you to move from package to package
using the list of similar packages. You are using this application and moving
from tag to tag.
Can the list of previous packages you visited be used when computing similar
tags to make the selection even smarter?
Have a look:
#!/usr/bin/python
#
# Copyright (C) 2007 Enrico Zini <enrico@debian.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# From python-debian
from debian_bundle import debtags
# From python-apt
import apt
aptCache = apt.Cache()
# Read the Debtags database
db = debtags.DB()
tagFilter = re.compile(r"^special::.+$ ^.+::TODO$")
db.read(open(options.tagdb, "r"), lambda x: not tagFilter.match(x))
# Maximum number of previous packages to remember
maxlen = 3
# Initial package selection
trail = [ 'debtags' ]
# Loop until the user chooses to quit
done = False
while not done:
# Compute a package weight according to how old it is in the
# trail
pkgweight =
for idx, pkg in enumerate(trail):
pkgweight[pkg] = 1.-(idx/maxlen)
# For every tag, find the number of packages in trail that have the tag
tagscores =
for pkg in trail:
for tag in db.tagsOfPackage(pkg):
if tag in tagscores:
tagscores[tag] += pkgweight[pkg]
else:
tagscores[tag] = pkgweight[pkg]
# Divide every tag score by the number of packages in the trail,
# obtaining a 'tag weight'. A package can be later scored by summing
# the weight of all its tags.
for tag in tagscores.iterkeys():
tagscores[tag] = float(tagscores[tag]) / float(len(trail))
# Find the merged tagset of the packages in trail
trailtags = set(tagscores.keys())
# Get the list of packages whose tagsets intersect the trail tagset
nextpkgs = set()
for pkg, tags in db.iterPackagesTags():
if trailtags & tags:
nextpkgs.add(pkg)
# Score every package by the sum of the weight of its tags
def pkgscore(pkg):
score = 0.0
for tag in db.tagsOfPackage(pkg):
if tag in tagscores:
score += tagscores[tag]
return score
# Show the first 20 packages in reverse score order
display = sorted(nextpkgs, key=pkgscore, reverse=True)[:20]
for num, pkg in enumerate(display):
aptpkg = aptCache[pkg]
desc = aptpkg.rawDescription.split("\n")[0]
print "%2d) %s - %s" % (num + 1, pkg, desc)
# Ask the user to choose a new package
while True:
ans = raw_input("> ").strip()
if ans[0] == 'q':
done = True
break
elif ans.isdigit():
num = int(ans) - 1
if num < len(display):
# TODO: on a different kind of interface, display the full
# description of pkg
trail = [display[num]] + trail[:maxlen]
break
else:
print "The number is too high"
Who wants to make a GUI out of this?
Next.