Older blog entries for hulten (starting at number 5)

31 Oct 2010 (updated 31 Oct 2010 at 16:21 UTC) »

I had accidentally deleted /var/lib/dpkg/info/ from one of my Debian GNU/Linux systems, with the consequence that APT misses relevant metadata. I vaguely remember having done this before and I might do it stupidly again. Therefore I wrote a script which seems to fix this.

# Repare dpkg database in /var/lib/dpkg/info/ from /var/lib/dpkg/status.
echo File ${STATUS} will be used to read which packages you have 
echo New info/* files will be moved into ${INFO}/.
mkdir ${INFO}
for PACKAGE in `grep ^Package ${STATUS} | awk '{print $2}'`; do
    echo Processing ${PACKAGE}...
    aptitude download ${PACKAGE} || continue
    dpkg-deb -e `ls ${PACKAGE}*.deb` || continue
    for CTRLFILE in *; do mv ${CTRLFILE} 
../${INFO}/${PACKAGE}.${CTRLFILE}; done
    cd ${BASEDIR}/
    rm ${PACKAGE}*.deb

This can be ran as a normal user. If you then move all files from dpkg-info/ to /var/lib/dpkg/info/ APT should work well again. You should change the script if you already have a large amount of deb files in /var/cache/apt/archives/.

Do whatever you want with the script. The script is as-is, without any waranties.

Update: This method does not restore the *.list files, thus leaving me without all necessary dpkg metadata.

27 May 2010 (updated 27 May 2010 at 20:36 UTC) »

More free access to medicines

Pharmacy multinational Glaxo decided to offer free access to several potential malaria cures (that is, the patents). On the Wall Street Journal they call it a Linux Approach. Now certainly this is wrongly put in multiple ways. While using the term Linux operating system, they actually mean GNU/Linux. Furthermore they use the term open-source instead of free software. This kind of language is very common nowadays. If people know exactly what is meant by it, it might not be that relevant. People do know which software is meant when the term open-source or free software is used and because of the fact that the set of OSI approved licences are almost identical to the FSF approved licences, these software are mostly the same.

However, this kind of language neglects an important issue, namely that of freedom. The GNU system was originally created with the idea that users would have freedom to use, adapt and redistribute the software in anyway they feel like, and this still is the core idea of free software. This is why it is important to use the terms free software and GNU/Linux.

It seems that I digress... but I'm not. Also in the case of patents it is important that people have the freedom to derive other work from inventions. A temporary monopoly on an invention, with the intent to develop it for the good of society, is morally allowed under certain conditions. In this way inventors feel the urge (a financial stimulance) to produce more inventions and also to develop them and make them public (through a patent registration). But there are several things which should never be patented so that a single company has a monopoly on that patent. One type of such an invention is medicines.

But at this point it is allowed to patent medicines. As long there is no legislation against these kind of moral practices, we should do something to help make patents more free. But pharmaceutical companies want to make a profit. What should these companies do when they want to make money and be moral (give to society) as well? Glaxo did a first move to get back the respect of society. The medicines that they liberated (as it seems) can now also be used by other pharmaceutical companies for the development of derivative medicines, probably without making it free! In the Guardian article I cannot find anything which shows that they thought about this problem. Maybe they did and will use that only for other medicines (for instance against HIV). So, is there a solution for this problem? Yes, there is.

In the Wall Street Journal article not only the words Linux and open-source should not have been used, but it should also have made clear that copyright is something different from patents. Copyright is used for works of art, while patents are for inventions. But it did make me think about certain aspects of free software and free patents (read for both: Free as in free speach, not free beer). In free software we use the concept of copyleft, like in the GNU GPL. Now, such a thing should be used for medicines as well. Then such an invention may be freely used for anyone, as long as all derivative inventions are also free in precisely the same way. Also they must not be trade secrets and the license must be non-revokable.

As long as patents on medicines are allowed by governments, this is a good way to make available more and more medicines for low costs, so that everyone can pay for them. Also this kind of patent license can be used for all types of inventions, giving even more to society than their health. But let's start with that.

10 May 2010 (updated 10 May 2010 at 12:01 UTC) »
The real ocean

For half a year I work at the KNMI now, working an modelling of the ocean biogeochemistry, tending to use only free software. Now for something in the context of my work which is mostly unrelated to computing: a cruise over the Atlantic to collect measurements!

Two cruises have been planned for the GEOTRACES project for this year. One will cover the course Reykjavíc--Hamilton and the second the course Hamilton--Fortaleza. Before the start of these cruises the equipment had to be tested on a shorter cruise, which I joined. This small cruise started from Texel and the original plan was to go to Reykjavíc (Iceland). Here the researchers for the bigger cruises would get on the ship. However, in view of the volcanic activity on Iceland and all the air traffic problems resulting from it, it was decided to go to Scotland instead.

We planned to leave the port at Texel on the 22nd of April but, as often happens with preparations, things got delayed. Added to this, we needed high tide to sail out to sea. This is why we left on Friday the 23rd of April. The North Sea was calm and the sun was shining. It was my birthday, so we ate pie and I got a book which was later signed by everyone on board.

The next day the weather was grayer and I got sea sick in such a way that I did have a chance to participate in or observe any activities on board.

On the third day, April 25, the Very Large and the Ultra Clean sampling systems were let down and pulled up successfully. Both systems contain 24 samplers, each twelve litres in volume. The Ultra Clean is especially useful for the measurement of metal concentrations, because the system is mostly made of plastic to prevent the water from getting into contact with metal.

Leslie and Steven explained the CO2 measurements to me. They measured the alkalinity and DIC (Dissolved Inorganic Carbon), from which concentrations of carbon dioxide, bicarbonate and carbonate can be calculated. The most ingenious I found the measurement of DIC, for which first all ions are converted to carbon dioxide by means of an acid. The resulting liquid is radiated by light with the specific wavelength where carbon dioxide molecules are ionised. Two electrons are measured per molecule. The electric current is integrated by a measurement device. The resulting charge can then be used to calculate the number of mole of carbon dioxide, which is the same as the DIC concentration from the sample.

In the evening there were two lectures; one presented by me about the modelling of trajectories in the ocean, and the other by Gregory about the measurement of concentrations of silicium.

On the fourth day the sampling systems were let down a bit deeper: about one kilometre. An electric connector of the Very Large sampling system seemed to be leaking. After the replacement of a rubber ring there was no more leakage.

In the end we managed to test everything with success. It was interesting to see how the samples were taken, what can go wrong and how some of it is analysed. This gives insight in how difficult it can be to determine the properties of the ocean and how sparse data points are compared to the enormous size of the ocean and the number of available data in models. Also it gives an idea where errors in measurements can arise. In the morning of the fifth day, April 27, we sailed into Scrabster, a harbour on the far North of Scotland. Half a dozen people went off board and new scientists went on board for the cruise to Bermuda.

9 Nov 2009 (updated 9 Nov 2009 at 20:23 UTC) »

A month ago I started a PhD at the KNMI (Dutch wheather and climate institute). Before this I worked as an workstation administrator at the KNMI. Now I am a user.

During my time as an administrator I wrote a few articles for the IT department. These were about the introduction of more free software, open hardware, the configuration management tool Puppet and a bit about the new GNU/Linux distribution. This entry is an update to the practical status of a few of these subjects.

At least the users of my department, Mondial Climate, are proponents of the introduction of free software. It seemed that my paper about free software was received well at a meeting between end users and administrators. Probably it will take a while before we can say goodbye to all proprietary software, but I believe that we will be making progress in the near future.

The open hardware issue is likely to be rediscussed as soon as new hardware is needed. At this moment the IT department has enough new workstations, unfortunately all equipped with Nvidia cards.

The introduction of the new GNU/Linux distribution goes slowly. I for one am already running the new distribution, with much more free, as well as up-to-date, software than any other user at the KNMI.

20 Aug 2009 (updated 12 Dec 2014 at 15:01 UTC) »
The government and Free Software

I work at the Dutch Meteorological Institute (KNMI), a government institute. The Dutch government several times said that they wished to use more Open Source Software and Open Standards, but forces seem to exist which prevents the actual embracement of this. I was asked to write a plan concerning our troubles with the Linux-driver for the Nvidia cards that are part of the workstations of the KNMI.

Obviously, the problem is the use and acceptance of non-free software (and hardware). However, users want 3D acceleration (Google Earth, Nexuiz, visualisation of models). Is ATI a viable alternative? They went open spec. No, the free (as in speech) drivers are not completed yet.

The obvious alternative is the onboard Intel GMA X3000 and higher series. Even with the newest GMA X4500 series the performance is not nearly as good as of recent Nvidia and Ati cards. However, I am sure that it is more than enough for most users. I will convince them that it is better to buy Intel GMA's, so that we can use Free Software!

update: Sadly, I was not able to convince them. This is partly related with agreements between KNMI and vendors, and the GNU/Linux administrators at the institute do not have much influence on that. Now, five years later, I left KNMI for a new job in France, and KNMI administrators are still having the same problems...

28 Jul 2009 (updated 28 Jul 2009 at 20:29 UTC) »
Play a movie on TV through an Nvidia card

Even in these days of RandR and the modular Xorg, some people still have trouble playing a video through their computer on their television. Specifically the proprietary Nvidia cards cause problems. There are even users who think that using proprietary drivers for their Nvidia cards is the only way to use TV-out. That is not true and I for one even find it less troubling when you use the nv driver, which is free software.

While running Xorg with the nv display driver, I installed the little utility nvtv (slightly patched). Put nvtvd in your default runlevel. I wrote the following shell script, called mplayot for playing a movie on my television:

echo mplayer-on-tv v0.3.7
# Pause your music
mpc pause
nvtv -r 800,600 -s Large -t -C CONVERT --set \\
    TVPositionX:-3,0 || echo Problem with nvtv!
if ! [ `ps -C xscreensaver | wc -l` = 1 ]; then
        killall xscreensaver
# Put xorg blanking of display to two hours
xset s 7200
mplayer -fs -osdlevel 1 -vo xv -spuaa 4 \\
    -screenw 800  -screenh 600 -ao alsa "$@" &&\
# Put it back to 10 minutes
xset s 600
# This fixes some display problems
xrandr -s 640x512
xrandr -s 1280x1024
if [ $XSCRSAV = "YES" ]; then
        xscreensaver &

This just works.

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!