David Mentré's blog

Last entries

Sat 04 Jan 2014

Server upgrade to Wheezy: beware of Dovecot!

Yesterday I upgraded my Debian server from Debian 6 (Squeeze) to Debian 7 (Wheezy). Overall it went fairly well, most probably because I don't use that much software. Another reason is that two main packages I use, Nginx and PostgreSQL, were drawn from Squeeze backports so they were close to Wheezy version.

Having the important upgrade notes of all packages at the very beginning of the upgrade was very helpful.

I had nonetheless two big issues with Dovecot and PHP as CGI.


I had to upgrade from Dovecot 1.x to 2.0 configuration file. Dovecot 2 is supposed to be able to read Dovecot 1 configuration file but it did not work for me. First of all, I had to fix the import of the SSL certificates (easily done with help from README.Debian.gz). Secondly, I use non-standard ports and I was not able to easily fix it.

Overall, it was much easier to write a new Dovecot 2 configuration file from scratch. Using doveconf -c -n (also mentioned in README.Debian.gz) was very helpful to get the items to modify/add.

I don't see what Debian developers could have done better, the issue was at least well documented.


I am using Nginx web server so I had a custom init.d script to launch PHP as Fast CGI, Nginx and PHP communicating through a Unix socket. I don't know why but my PHP as CGI set-up was broken after the upgrade.

I easily fixed this issue by installing php5-fpm package and using the proper socket (/var/run/php5-fpm.sock) for the Nginx to PHP link. My server configuration is thus more standard and easy to maintain. Good! :-)

Feature wish for Debian 8

For next Debian, it would be useful to have a script that scans the installed packages and prints some notes telling if the upgrade can be done automatically or need manual intervention (and why, pointing to some further documentation to read). It would be very useful to know issues before starting the upgrade.

Tue 17 Dec 2013

Book review: Better Embedded System Software

better_embedded_system_software_cover.gif Better Embedded System Software is a very good book if you write software, and not only embedded software!

I discover this book when following the Toyota Unintended Acceleration case where Philip Koopman, the author of this book, was a plaintiff's expert. Philip Koopman is an Associate Professor at the Carnegie Mellon University.

Why is this book so good? Because it explains in daily words what should be the ideal software development process. And not only it details the ideal process, but it gives concrete, down to earth advices on how to improve your current process and software development habits.

The book is divided into 30 small chapters, following the order of the usual V cycle (overall process, requirements and architecture, design, implementation, verification and validation, critical system properties). The chapters are very short, about 10 pages, and relatively independent. This one of the great point of the book: it is easy to read a chapter, there is not need to allocate a long time slot for it. You can pick the chapter that is most interesting to you. And as the chapters are right to the point, you immediately get useful advices and you can immediately start to apply them on your own development.

The other great quality of this book is that the author has a strong background in embedded software development. Therefore the advices are realistic and graduated. The author knows that you are going to find barriers and limitations in your work environment and he helps against them. For example, there are two chapters on producing some documentation but not too much. Even if you cannot apply the whole set of advices, you nonetheless get some ideas on own to improve your current software and what could be done in later steps.

I am not an expert on all the topics presented in this book (that's why I bought it!) but for the domains I knew (e.g. concurrent programming), the advices seem balanced and appropriate.

Of course, 10 pages for a chapter is very short and some subjects are so wide that they would deserve a book on their own (e.g. safety and security). In that case, Koopman's book give useful pointers to continue your reading and the summary he gives is an excellent introduction to the topic.

As I said many times, we are currently making very bad software and we should improve this situation. Better Embedded System Software is the one the very few books that you should keep close to your table and consult on a regular basis.

If you cannot afford the book, some quite detailed slides on Avoiding the 43 Top software risks have been made available by Philip Koopman.

Sun 01 Dec 2013

The day I left GMail

On Saturday 2013-11-30 at 16:06 I left GMail. Now all (or at least most of them) of my emails are sent to my own email server based on Postfix, Dovecot and a Debian server.

It is increased burden to have to manage such a server. It was much easier for me to let Google administrators handle all the issues. But now at least I know where my emails are stored (in France) and how they are handled. I will less fear to see my Google GMail emails read by American spy agencies through PRISM program. Or at least, it will be a little more difficult for those agencies to access them. Hopefully, I won't have too many administration issues with this server.

Introduction aux méthodes formelles actualisée

Comme en 2010 et 2011, j'ai faire une intervention de 2h pour présenter les méthodes formelles à l'ESIR, école d'ingénieur de Rennes 1. J'ai un peu actualisé la présentation, je pense qu'elle est plus illustrée et j'ai introduit quelques démonstrations d'utilisation des outils. La présentation est disponible en PDF ou en source au format PowerPoint (licence Art Libre, sauf pour les illustrations, que j'ai pioché à droite et à gauche sur le web).

Note pour les libristes : la plupart des logiciels mentionnées sont libres.

Fri 15 Nov 2013

Présentation de l'internationalisation dans MapOSMatic

Lors du DevCamp de ce mercredi 13 novembre à la Cantine numérique Rennaise, je faisais une courte présentation de l'internationalisation (i18n) dans MapOSMatic : comment c'est fait en pratique dans le code, le processus de traduction mis en œuvre et les résultats obtenus. Les transparents sont disponibles sous formes de sources LibreOffice ou en version PDF.

Wed 13 Nov 2013

Mozilla published a guide to help configure TLS on web servers

In a blog post called "Navigating the TLS landscape", Mozilla announced its Security/Server Side TLS guide.

The main objective of this guide is to help SysAdmin configure their web server in order to improve security for web server clients. The guide gives the preferred configuration as well as justification for choices made, which is a very good thing. There is a strong emphasis on forward secrecy. Configuration parameters for several web servers are provided (Nginx, Apache, Haproxy, Stud, ...). It also provide some tips to check the configuration.

Next step: apply it on my own server!

Thu 07 Nov 2013

Carte des zones d'exclusion autour des centrales nucléaires françaises

Suite à l'accident de Fukushima, je m'intéresse un peu plus aux centrales nucléaires et à leurs risques. J'avais vu une carte de zones d'exclusions de 100 et 150 km autour des centrales japonaises. J'ai refait cette carte pour les centrales nucléaires françaises avec des zones d'exclusion de 30, 100 et 150 km.

30 km est la zone d'exclusion autour de Tchernobyl. Pour Fukushima, on a des poches de radioactivité importante au moins dans un rayon de 100 km.

Peu de villes moyennes sont à plus de 150 km d'une centrale. En Bretagne, Rennes et Brest le sont mais à Brest il y a les bombinettes nucléaires de nos sous-marins tactiques, donc je ne suis pas sûr que ce soir beaucoup mieux. :-]

Merci à OpenStreetMap pour le fond cartographique et Leaflet pour la carte glissante. ;-)

Introductory slides on Frama-C

I recently made at work slides to present Frama-C: what it is, the various plug-ins and how to use the two main ones, Value analysis and WP. The examples used in the slides are also available.

The attached version is updated after fixing minor issues found by frama-c-discuss mailing list readers.

Enjoy! (and let me know if you find them useful)

Fri 05 Jul 2013

Critique livre : Éloge de l'oisiveté

Bertrand Russell (image Wikipédia) Ce petit livre (32 pages, éditons Alia) est ancien, 1932, mais toujours étonnamment d'actualité. Bertrand Russell, le célèbre logicien, y expose ses idées sur le travail, l'utilité du travail pour la société et comment procurer plus de bonheur à tous.

Pour parler sérieusement, ce que je veux dire, c'est que le fait de croire que le TRAVAIL est une vertu est la cause de grands maux dans le monde moderne, et que la voie du bonheur et de la prospérité passe par une diminution méthodique du travail.

La réduction du temps de travail ! Voilà l'objectif de Bertrand Russell. Et il n'y va pas de main morte puisqu'il préconise 4h par jour. :-) Mais au-delà de cette proposition, Russell explique pourquoi travailler peu est nécessaire : pour avoir du temps pour des loisirs, pour développer des activités créatives, aussi bien artistiques que scientifiques, pour s'éduquer, etc. En résumé, pour faire de l'homme un être actif pour le bien de la société et pas seulement un être passif, juste bon à s'abrutir au travail et consommer sur le peu de temps qu'il lui reste.

1932 ! Il y a 80 ans, on parlait déjà de ces questions et je n'ai pas vraiment l'impression qu'on est vraiment progressé depuis. À une heure où l'automatisme est croissant, où la productivité est sens cesse améliorée, ou certains sont surchargés de travail alors que d'autres en demandent, nous devrions collectivement nous interroger sur la façon de répartir équitablement travail mais surtout richesse dans notre société ? Peut-être peut-on voir au-delà de l'horizon néo-libéral (bouché) qu'on nous présente que seule voie possible ? Bertrand Russell nous invite à y réfléchir intelligemment et de manière compréhensible.

La bonté est, de toutes les qualités morales, celle dont le monde a le plus besoin, or la bonté est le produit de l'aisance et de la sécurité, non d'une vie de galérien. Nous avons choisi, à la place, le surmenage pour les uns et la misère pour les autres : en cela, nous nous sommes montrés bien bêtes, mais il n'y a pas de raison pour persévérer dans notre bêtise indéfiniment.

Sat 29 Jun 2013

WE programming idea: opportunistic secure email exchanges

A long time ago, a French computer science magazine proposed programs ideas that ranges from a few hours to a complete WE. Here is an idea to elaborate on, even if it might take a little more than a WE to implement it fully. ;-)

Observation: secure email exchange with OpenPGP or S/MIME does not work

Like many others, I have tried to exchange secured (encrypted and strongly authenticated) emails with friends and other people, in my case in OpenPGP format using GnuPG free software. But, like many others, I have stopped because it simply does not work.

Why? Probably for several reasons:

  • One need to understand at least the basic principles of asymmetric cryptography: public and private keys. It is not that complicated (if you don't go into the fine details ;-) ) but it is probably already too much complicated for the average user;
  • One need to make ones key, load it into email program. If one has several computers, one needs to do this for each one of them. Making the key adds complicated steps. Loading it on each computer is cumbersome.
  • If you want to participate in the "web of trust" (for OpenPGP emails), you need to let your key signed by other people and sign other people keys. Once again, this is very complicated to understand for the average user;
  • Even if you don't want to participate in "web of trust", you need to check the fingerprint of your correspondents to gain strong authentication. Once again, a complicated step to understand and do;
  • Even if you have done all of this and understand it, each time you want to send an email you need to enter the password to unlock your private key. This is annoying.

Regarding S/MIME, you have overall the same complications. It can be a little simpler but as you need a Public Key Infrastructure (PKI), S/MIME usefulness is limited to a single administrative entity managed by trained system administrators, in other words a big company.

A proposal: opportunistic secure email exchange

The basic approach is pretty simple: make a plug-in to some email programs. The first time the plug-in is installed, it automatically creates a public and private key couple for each email address used by the user.

Then, each time a user A sends an email, the public key attached to A's email address is automatically sent with the email. Therefore, if the user communicates with another person B using the same kind of plug-in, the receiver detects that A is capable of using secure emails. At next email from B to A, the plug-in automatically attaches its own public key.

Therefore, after two emails exchanges between A and B, they both have the public key of the other person and thus can both exchange secure emails. When one sends an email, by detecting we have the public key of the correspondent, the email programs would automatically encrypt and sign the email.

Of course, with this scheme, you don't gain strong authentication of the remote party. A man-in-the-middle attack is still possible. But this does not prevent to use another cryptographic protocol to check afterwards that the remote user is really who he is pretending to be, like in ZRTP protocol.

But the danger nowadays is not man-in-the-middle-attack, is it continuous spying on servers like the USA's PRISM program. This opportunistic encryption scheme would allow the average user to use encryption. The emails would be stored encrypted on GMail, Microsoft or Yahoo servers and be in clear only on user's computer.

The WE programming idea

I think you now have understood this WE programming idea: implement such a plug-in doing opportunistic email encryption, e.g. as a Thunderbird plug-in. :-) All the libraries are there, like GnuPG's GnuPG Made Easy library to manage keys, encryption and authentication.

Anybody willing to take the challenge? ;-)

page 1 / 14