Blog of Sylvain Le Gall

Aller au contenu | Aller au menu | Aller à la recherche

Wednesday 1 September 2010

OCaml 3.12 with Debian Sid right now!

Some careful readers of Planet OCamlCore should wonder why the OCaml packages in Debian has not yet been upgraded to 3.12.0. For the Planet Debian readers, this is the latest version of the Objective Caml programming language.

The answer is simple: Debian Squeeze froze on 6th August. This means that Debian folks focus on fixing release critical bugs and avoid doing big transitions in unstable (Sid). In particular, the Debian OCaml maintainers has decided to keep OCaml 3.11.2 for Squeeze, because the delay was really too short: OCaml 3.12 was out on 2nd August.

A great work has already been done by S. Glondu and the rest of the Debian OCaml maintainers to spot possible problems. The result was a series of bugs submitted to the Debian BTS. This effort has started quite early and have been updated with various OCaml release candidates.

S. Glondu has also built an unofficial Debian repository of OCaml 3.12.0 packages here.

Let's use it to experiment with OCaml 3.12.0.

schroot setup

Following my last post about schroot and CentOS, we will use a schroot to isolate our installation of unofficial OCaml 3.12.0 packages.

approx

approx is a debian caching proxy server for Debian archive files. It is very effective and simple to setup. It is already on my server (Debian Lenny, approx v3.3.0). I just have to add a single line to create a proxy for ocaml 3.12 packages:

 $ echo "ocaml-312   http://ocaml.debian.net/debian/ocaml-3.12.0" >> /etc/approx/approx.conf
 $ invoke-rc.d approx restart

approx is written in OCaml, if you want to know how I come to it.

debootstrap and schroot

We create a chroot environment with Debian Sid:

# PROXY = host where approx is installed, debian/ points to official Debian repository of 
# your choice. 
$ debootstrap sid sid-amd64-ocaml312 http://PROXY:9999/debian

We create a section for sid-amd64-ocaml312 in /etc/schroot/schroot.conf (Debian Lenny):

[sid-amd64-ocaml312]
description=Debian sid/amd64 with OCaml 3.12.0
type=directory
location=/srv/chroot/sid-amd64-ocaml312
priority=3
users=XXX
root-groups=root
run-setup-scripts=true
run-exec-scripts=true

Replace XXX by your login.

And we install additional softwares:

 $ schroot -c sid-amd64-ocaml312 apt-get update
 $ schroot -c sid-amd64-ocaml312 apt-get install vim-nox sudo

OCaml 3.12 packages

Now we can start the setup to access OCaml 3.12.0 packages.

The repository is signed by S. Glondu GPG key (see here). We need to get it and inject it into apt:

$ gpg --recv-key 49881AD3 
gpg: requête de la clé 49881AD3 du serveur hkp keys.gnupg.net
gpg: clé 49881AD3: « Stéphane Glondu <steph@glondu.net> » n'a pas changé
gpg:        Quantité totale traitée: 1
gpg:                      inchangée: 1
$ gpg -a --export 49881AD3 > glondu.gpg
$ schroot -c sid-amd64-ocaml312 apt-key add glondu.gpg

The following part is done in the schroot:

$ schroot -c sid-amd64-ocaml312
# PROXY = host where approx is installed
(sid-amd64-ocaml312)$ echo "deb http://PROXY:9999/ocaml-312 sid main" >> /etc/apt/sources.list
(sid-amd64-ocaml312)$ cat <<EOF >> /etc/apt/preferences
Package: *
Pin: release l=ocaml
Pin-Priority: 1001
EOF
(sid-amd64-ocaml312)$ apt-get update 
...
(sid-amd64-ocaml312)$ apt-cache policy ocaml
  Installé : (aucun)
  Candidat : 3.12.0-1~38
 Table de version :
     3.12.0-1~38 0
       1001 http://atto/ocaml-312/ sid/main amd64 Packages
     3.11.2-1 0
        500 http://atto/debian/ sid/main amd64 Packages
(sid-amd64-ocaml312)$ apt-get install ocaml-nox libtype-conv-camlp4-dev libounit-ocaml-dev...

That's it. The apt-policy command shows that OCaml 3.12 for the ocaml-312 repository has an higher priority for installation.

Good luck playing with OCaml 3.12.0.

Wednesday 14 July 2010

Project children has forked

The new project shares the same code base, but this branch is a total rewrite of the project children.

Clementine is born on 8th July 2010, at 12:01 Paris time. She is now at home with her mother, father and brother. She is very peaceful and hardly cry once or twice in a day: at bath time and around 5am for her night lunch.

Clementine by Bernard Le Gall

I will probably lack of time in the coming month. Expect some delays with the OCaml forge, other OCaml projects I maintain and my OCaml Debian packages.

Thursday 1 July 2010

5 years old CD-RW...

This blog post is a kind of followup of a previous blog post about reading 10 years old CD-R.

Today, I get a new shiny ASRock ION 330 to play with, in itself this PC has nothing particular. As usual, I begin by using System Rescue CD to check bad blocks on the hard drive, before working with it (badblocks -v -s -w -c 4096 /dev/sda). Once done, I will check the memory (memtest). This is my standard procedure when receiving a new PC.

But I don't have my System Rescue CD at hand. No problem, I download it and and write it on an old CD-RW, bought 5 years ago but still sealed into his blister. For your information, this is a Memorex CD-RW 700MB 16-24x. I blank it (wodim blank=all). I write it at speed 16x, because I don't know how to lower the speed. After writing the CD, I re-read it to check everything is fine (readom dev=/dev/cdrw1 f=test.iso).

Ooops:

$ readom dev=/dev/cdrw1 f=test.iso
[...] 
Errno: 5 (Input/output error), read_g1 scsi sendcmd: no error
CDB:  28 00 00 01 3C 00 00 00 40 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 03 00 00 00 00 0A 00 00 00 00 11 05 00 00
Sense Key: 0x3 Medium Error, Segment 0
Sense Code: 0x11 Qual 0x05 (l-ec uncorrectable error) Fru 0x0
Sense flags: Blk 0 (not valid) 
cmd finished after 6.614s timeout 40s
readom: Input/output error. Cannot read source disk
readom: Retrying from sector 80896.
.............
readom: Error on sector 80908 corrected after 9 tries. Total of 0 errors.
..............---

OK, I re-blank it (wodim blank=fast) and rewrite it. The CD seems to be readable this time. But when I try to boot with it my new ASRock, it fails.

Enough is enough, I get an heavy used Verbatim 8cm CD-RW. Just to show you how old he is: the first ISO written on it was "Debian Sarge". And the magic happens: it works on the first try!!!!

You will probably think that I work for Verbatim. This is not true but I must admit that first-price CD-RW/CD-R seems to be very low quality and don't hold data in time. This is probably related to the chemical compounds of the CD. The failing Memorex CD-RW will end up in a trash and I will continue to use my 5 years old Verbatim CD-RW.

Dear reader, in order to find a way not to dump this failing CD-RW, do you know a way to make it to work?

What you should now about the failing CD-RW:

  • there are no scratches on the surface
  • the CD-RW has never been used before this morning
  • I keep it out of the direct sunlight
  • it was stored next to the Verbatim CD-RW

Tuesday 27 April 2010

32 year old

... or as some fellow DD said, one year ago: "j'ai 1000 ans".

So what happened during last year, the DVCS way:

$> cd "Sylvain Le Gall"

$> darcs whatsnew

hunk life.txt 0
+ Yvain, my son, talks and walks, this is quite amazing to see your
+ child growing up.  My wife is pregnant, release expected in July
+ ;-)
+ 
+ I traveled quite a lot this year: Spain, Tunisia, Belgium,
+ Roscoff and Huelgoat (Brittany) 

hunk debian.txt 0
+ I went to Debconf 9 and attended Debcamp before. I met a lot of
+ very interesting people there. I spent the Debcamp time to
+ implement Zack proposal to compute OCaml package dependencies
+ using dh-ocaml. It WORKS ;-) It was a pleasure to work with Mehdi
+ Dogguy and Stephane Glondu on this subject.
+ 
+ The dh-ocaml work allowed me to be the co-author, with Stephane
+ and Mehdi, of Zack's article on the subject. 
+ My first publication!
+ 
+ I went to FOSDEM 2010 and helped attend the Debian booth. Quite a
+ nice experience I was there with my good old Open Brick NG (need
+ to blog about it one day).
+ 
+ Found some time to enable the LLVM OCaml bindings in LLVM Debian
+ package.
+ 
+ Voted for the first  OCaml-aware DPL! (NB: this was not the
+ reason for my vote)

hunk work.txt 0
+ I worked on extending a tool that I delivered before. OCaml is
+ quite a good language when it comes to do maintenance. You can
+ extend something and have dozens of compiler errors where your
+ changes propagate. Once every error has been corrected, your
+ changes are OK. Of course, this requires to use OCaml types,
+ pattern matching and a bit of unit testing.
+ 
+ I was delighted when Jun Furuse ask me if he can organize 
+ OCaml Meeting 2010 in Japan. The first OCaml Meeting spin-off. 
+ 
+ OASIS has been growing quite a lot since the year before and got
+ enough importance. Thus I decided to give a talk about it at CAML
+ Consortium in December and then at OCaml Meeting 2010. 
+ 
+ I decided to have some English training. I was missing some oral
+ fluency.
+ 
+ I organized the OCaml Meeting 2010 in April. It was quite a lot
+ of work, especially to prepare my own presentation, but the
+ meeting was a success and probably my best birthday gift with the
+ OCaml Hacking Day organized just after.

$> darcs record -a
What is the patch name? "32 year old"

Unfortunately, this release is late. My birthday was on April 16th, but it was OCaml Meeting this day, which was my top level priority at this time.

See you next year!

Friday 30 January 2009

OCaml Meeting, FOSDEM and holiday

Next week will be quiet busy. I will travel a lot. Of course, I am talking about OCaml Meeting and FOSDEM.

The OCaml Meeting subscription is over and we reach a quiet good number of attendees: 45. This is the approximate number of people who come last year. There is now some details to finish (dinner for the previous day, schedule for talks...) but enough time left. The only thing I hope for the meeting is that it generates the same effect as last year: another impulse in the OCaml community. Many people are working continuously on OCaml but last year event has generated a lot of post-event discussion and many people started different project. Some of these projects are still alive, some are not as vivid as they deserve.

I enjoy being at FOSDEM last year, but I only stay 1 day and it was not enough. I will be able to stay during the 2 days and attend more Debian conference than last year.

I will visit Brussels and Ghent just after. Belgium is a really nice country and it has been a long time I haven't take a break.

I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

Saturday 5 April 2008

OpenOffice.org fonts too big in XFCE

UI fonts of OpenOffice.org Writer and XFCE thunar are really not the same

... years of seeing this ugly font and being force to scale the OpenOffice.org UI display to 80%.

I just found the solution!

All his related to a X settings: Xft.dpi. People are suggesting around to set it to 96 or something like that. I just decide to use the one i can find xdpyinfo (does it make sense?) and send the result to X settings using xrbd.

Here is the script $HOME/bin/xfce4-xft.sh:

#!/bin/sh

xrdb -query Xft.dpi | grep Xft.dpi > /dev/null && exit 0
RESOLUTION=`xdpyinfo | grep resolution | sed "s/.* \\([0-9][0-9]*\\)x.*/\\1/"`
TMP=`mktemp`
trap "rm -f $TMP" EXIT
echo "Xft.dpi: $RESOLUTION" > $TMP
xrdb -merge $TMP

Copy/paste/chmod a+x this file.

And then add a file $HOME/.config/autostart/xfce4-xft.desktop to autostart the previous script:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=XFCE-XFT
Comment=Fix XFCE Xft.dpi settings
Exec=/home/gildor/bin/xfce4-xft.sh
StartupNotify=false
Terminal=false
Hidden=false

(replace /home/gildor/ by your own home directory)

Thats it. Your Xft.dpi will be fixed depending on the configuration of your X server. This allow you to have a laptop and a desktop with different screen resolution.

I am waiting the email from bugzilla.xfce.org to submit this script to XFCE bug tracking.

Enjoy.

Update:

Following the comment of this entry, another better solution is to use openoffice.org-gtk which works out-of-the-box with a clean UI. I don't even have to force OO to gnome style.

Thanks to Dan Callahan, Vasilis and Corsac for their suggestion.

Monday 25 February 2008

Back from FOSDEM

I have spent one day and a half this week-end at FOSDEM. This was not as great as expected, but mostly because i don't have the time to stay the whole sunday. Next year, I will stay the whole week-end in order to have time to attend all the speak i should be interested in.

The beer event was overcrowded, but all the beer i found there was great (in particular the Floris Pear). It was also a great time to have a demonstration of the XO OLPC laptop. This little thing is funny, but i don't get the way the UI should be used. Another bad point, is that the first console allow to login as root by pressing "Enter" (at least on the one i try). I suppose this kind of device is not intended to be secured.

I also have time to talk with some Debian people and some other people -- in particular one who was thinking that Windows 2000 is the best ever OS. At least, it means that there were people from different horizons -- and this is a good thing.

During Saturday, i spend half of the day in the big amphitheater (Janson). The talk about Tux with Shades (Linux in Hollywood) was impressive, regarding the trailer they show us... The talk about FreeBSD was interesting -- but not impressive as a trailer.

I spend Saturday afternoon in the Debian devroom, following all the different talks. I miss the one from MadCoder about managing packages with git... That's a shame because i really want to see this one.

Since my train was at 12am on Sunday, i choose to only pay a visit to the different booths. I have the pleasure to have a demonstration of the EeePC on the Debian booth that really please me. I found the UI more easy to understand than the one from XO. Speaking with the person demonstrating the laptop, she explained me that EeePC is more "standard desktop" and XO more "creative desktop". Conclusion: i am not creative ;-)

Also talking about everything around talks and the meeting, i think Bruxelles is a really nice city for this kind of events. ULB is not near the center of Bruxelles but there are enough transportation. There was really a lot of people attending FOSDEM, and this is a good thing. I also have the pleasure to find some people from the OCaml Meeting.

Tuesday 15 January 2008

Born on january the first.

After 2 weeks of my new life, i just found time again to write this entry.

I think that some people were enjoying the new year when my wife and I were also waiting for our baby.

He is born at 3:30 am on 2008/01/01.

Happy new year!

Wednesday 5 December 2007

Thinkpad X60s configuration (ipw3945, network-manager, hda-intel...)

I spend quite a long time to fully configure my new Thinkpad X60s laptop. This will be my work computer and i wish to use Debian Etch on it. Since it is for my job, i want to use a stable debian release. The aim of this laptop is to always have something that works -- to keep focus on my job.

The configuration was tricky because there is a lot of people reporting that everything works with this laptop, but not a lot of people describing problems they encounter. Here is a list:

Sound:

   hda_intel: azx_get_response timeout, switching to polling mode…
   hda_intel: azx_get_response timeout, switching to single_cmd mode…

It prevents to have the sound working. The problem is related to the modem. You need to be sure that the modem is enabled in the BIOS.

ipw3945:

The WIFI driver of etch doesn't work well. To fix this, you must get the version 1.2.2 of ipw3945-source and rebuild it with module-assistant. I also use firmware-ipw3945 from unstable (v0.7) but I am not sure this is a firmware issue.

network-manager disconnects every 10 seconds or so:

This bug was pretty annoying. The wifi connection was good with wpasupplicant alone (or at least seems to be OK). With network-manager-gnome i keep getting messages about connection and disconnection every 10 seconds.

The solution is to remove everything which is related to bluetooth. This really improves the situation a lot! (i.e. i am not having disconnection messages for at least the time i am writing this blog entry).

 apt-get remove --Purge bluez-utils bluetooth

in file /etc/modprobe.d/myblacklist:

 blacklist bluetooth

and run:

 update-initramfs -u

Update:

As stated in a comment, this is not really an issue related to bluetooth. Using a kernel "with preemption enabled" is enough. The issue in fact as almost nothing to do with bluetooth, because there is no bluetooth module in the laptop.

"linux is an HDD killer":

You need to copy /etc/acpi/start.d/90-hdparm.sh from unstable and place it in /etc/acpi/{suspend|resume|start}.d. This prevents an increase of the Load_Cycle_Count.

Now the laptop seems stable, the wifi connection is up and running -- let's start working (again).

Tuesday 4 December 2007

Solving the dmraid and "attempt to access beyond end of device" problem

Yesterday, i decided to activate the so-called RAID 0 support on my P4P800 mainboard, to increase the performance of my 2 Seagate SATA disk -- bought for this purpose. The first unfortunate event was to discover that there is 3 levels of hardware RAID: controller, accelerator and fake. Of course fake RAID is not the better category and it is the one provided by my mainboard. Once, i have understood that i must use the package dmraid to activate my RAID, i fall into a syslog flood of messages concerning "attempt to access beyond end of device".

The problem is simple, the partition table are stored on the first disk of the RAID. Linux believes that he can reach the end of the device defined in the partition table of the first disk. But since, the partition table is for the whole RAID, it cannot access the last partition.

In fact, the solution is quite simple and described here . You must add files to udev and hal rules to ignore the partition found in the partition table of the first disk:

/etc/udev/rules.d/000dmraid.rules

KERNEL=="sda1", OPTIONS+="ignore_device"
KERNEL=="sda2", OPTIONS+="ignore_device"
KERNEL=="sda3", OPTIONS+="ignore_device"

(where sda1/2/3 are the partition stored on my RAID)

/etc/hal/fdi/preprobe/000dmraid.fdi

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
    <match key="scsi.model" string="ST3160811AS">
      <merge key="info.ignore" type="bool">true</merge>
    </match>
  </device>
</deviceinfo>

(where ST3160811AS is my two Seagate disks)

You should not ignore the whole disk in udev -- as i think it is suggested in the spanish web page (i don't speak spanish so i really don't know what it explains). After adding this two files, you must update your initrd:

update-initramfs -u

If you have problem with this configuration (you have ignored too much things), you can go back to the former initrd from grub command line, by editing the menu entry and editing the standard initrd to add ".bak" at the end.



At least, i got what i want:

~$ sudo hdparm -Tt /dev/mapper/isw_dhgabfaiad_RAID_Volume1

/dev/mapper/isw_dhgabfaiad_RAID_Volume1:
 Timing cached reads:   1354 MB in  2.00 seconds = 676.78 MB/sec
 Timing buffered disk reads:  426 MB in  3.01 seconds = 141.51 MB/sec

Not that bad for an old P4.

Sunday 21 October 2007

Reading a 10 years old CD-R

This week-end, i decided to copy a collection of CD-R back to my hard drive, to make new copies. Everyone knows, that a CD-R only live for 10 years. After this date, the data on it are more difficult to read. So it's the time to know what brand of CD-R has the greatest lifetime.

I begin to write CD-R sometimes around 1997. From this date, i keep using the same scheme to do this task: use high-end CD recorder (Plextor), good quality disc, always write at the minimum speed (ranging from 4x to 16x for the latest CD-R -- because sometime you cannot go under a defined speed), keep data on a separate partition to prevent buffer underun (10 years ago this was mandatory). The way i do this has almost not changed, expect maybe for the buffer underun, which doesn't happen anymore on modern hardware.

They have been in the same place at the same date. They have always been kept out of direct sunlight exposure, in 18-25°C environment (i.e. near my computer). I didn't often use them. None have "scratches" on theirs surface. I have written the name of the CD with a permanent marker (Stabilo).

For reading back the data I use a DVD-Recorder (Plextor PX-716UF) that can lower its speed if there are too many errors during the read.

The result is somehow what you should think:

  • Verbatim CD-R DataLifePlus metalAzo (blue surface): lost something like 5 files on 50 CD-R
  • Kodak DS (gold surface): 0 lost on 2 CD-R
  • Memorex CD-R (gold surface): 20 files lost on 2 CD-R

The Verbatim and Kodak can be read at full speed. I think the data on this two media are really well conservated. Even, if i have lost some data from the Verbatim medium, i think it is a really good rate for a 10 year old CD-R. The Kodak medium seems also good, but i don't have enough of them to be sure that i won't have the same error rate as Verbatim. Memorex CD-R is by far the worst media. I think all the data i have on these CD-R are lost. It takes me something like 1 hour to conclude that the first disc i try was totally destroyed.

At the time i have bought Verbatim medium, it was the best medium around. I gave a try to the Memorex medium to reduce the price per unit.

Conclusion: i have lost 15 CD-R with their content because 10 years ago i was thinking that i will save 2-3F (0,5€) by replacing Verbatim with Memorex...

Thursday 6 September 2007

Captcha and Spamtimeout

After some holiday, i was really afraid of the amount of spam i got on this blog.

As usual, i need to take "not good" decision to stop it. So i have activated captcha and spamtimeout plugin for dotclear. I hope that this time, it will work -- and that spam will stop filling this blog.

Tuesday 19 June 2007

Comments are open again

Trying spamplemousse, a plugin for dotclear... Hope this work

Saturday 16 June 2007

Experimenting with Linux-Vserver

After my disappointing xen experiments, i try to use vserver. The way it handles virtualization is just a lot more simple than xen. The problem with this is that you only get linux installation. All is running upon the same kernel, every guest is separated using security context. It has advantage over chrooted env (i have also try this, but it is not worth to write a blog entry for it): it can use natively several IP/hostname.

It is a lot less fun than Xen: you cannot run windows concurrently with linux at native speed. But it is a lot more stable. I did some test and it show me that it has more or less the same stability as the Linux kernel. For now, i am able run my server for 9 days. I think this is stable.

Concerning my other need:

  • i reuse the same X/XDMCP scheme as with Xen
  • i set up a framebuffer (no problem)
  • i can share my sound card (just have to copy dev entry of the sound card to the "/dev/" of the vserver)
  • network is stable -- but there is some problem.

Just to give a quick summary of my network problem :

  • some firewall rules are strange to write, because you have no originating NIC device for it
  • you have to limit every duplicated daemon (host/guests) to listen to only IP address of host
  • eth2 and my USB printer seems to conflict, eth0 and my sound card seems to conflict

I have concerns about the last item! I think it is related to possible not enough good driver of the NIC. I need to investigate on this point (i.e. move to linux 2.6.21).

Monday 28 May 2007

Experimenting with Xen -- End

I spent the last three weeks to do test concerning stability and features of Xen. Well, i must say that i am not convinced, as some people thinks, that xen virtualization is ready for stable server.

Just for reminding, my previous post: there is no easy way to activate real framebuffer with xen. I try vesafb and intelfb. The first one doesn't work at all, the second one made a kernel oops (not at the beginning, you must wait a little before it). So i stick to standard console. I need to remove fbgetty because it uses framebuffer, and crashes (oops) with Xen (not at the beginning...).

I continue using my X configuration, expect that i move it to a xdmcp-chooser init script. This help me to "stop" it when my domU was not started. I still have some problems with the fact that after a time, if XDMCP fails, it restarts, switching to vt7 in the same time.

Now my real problem: stability of xen when playing around with PCI peripherals.

I try to hide my soundcard in dom0 and unhide it in a domU. This sound pretty well... But the computer seems to keep segfaulting after 24hours. So, i switch back to standard, non xen, configuration. It works for a week (at least). I also try to upgrade my BIOS, don't use ACPI, APIC et al -- but it doesn't work. Conclusion: my soundcard was a problem. In fact, the real problem comes from the fact that the sound card shared his IRQ with NIC and IDE controller. When running in a non-xen, the kernel see the conflict and rearranged IRQ. With Xen + sound card hide, there is no conflict and it finishes by a "oops".

Another, not so real, problem: performance.

I run a courier based imap server, including sqwebmail a webmail CGI. Running under xen configuration, it was almost like my previous computer (VIA C3 1GHz / 512MB / USB 2.0 HD and my current computer is Core 2 Duo T7600 / 2GB / SATA drive). When i test it with non-xen configuration, it was twice as fast. The main reason: courier use Maildir which contains a lot of small files. This implies a lot of IO, where xen is not very efficient.

Conclusion: Xen is not ready for my "production" environment. I think it is a good product to test things and to consolidate server which are not bound to hardware components (sound card, NIC). I don't think Xen is a good solution to build a "hardware" isolation.

As usual, i will use my favorite development scheme KISS (Keep It Simple and Stupid): build chrooted environment.