Les mots « sensationnel », « impressionnant », qu’on emploie couramment aujourd’hui, sont de ces mots qui peignent une époque. Nous ne supportons plus la durée. Nous ne savons plus féconder l’ennui. Notre nature a horreur du vide.

PAUL VALÉRY – LE BILAN DE L’INTELLIGENCE

Publié le par me | Laisser un commentaire

Pluie et orage

Pluie et orage, le matin, en marchant le long d’une rivière.

Publié dans Uncategorized | Laisser un commentaire

Roland Garros

Terre ocre battue,
Service et balle de match ;
Bientôt les vacances.

Publié dans haïku | Laisser un commentaire

Chiffrage homomorphique

Je viens de lire un article sur Slashdot intitulé IBM Researchers Open Source Homomorphic Crypto Library qui me rappelle un autre article que j’avais précédemment lu sur ce sujet de chiffrage homomorphique Alice and Bob in Cipherspace.

Le chiffrage homomorphique est une méthode qui permet à une personne tierce de faire une opération sur des données chiffrés, donc sans avoir accès à la valeur non-chiffrée.

Cela ouvre la voie à la possibilité de pouvoir faire faire des opérations lourdes et complexes sur des machines distantes (« cloud ») sur des données dont on souhaite garder le secret.

L’exemple le plus simple d’un chiffrage homomorphique est le suivant :

Continuer la lecture

Publié dans Uncategorized | Laisser un commentaire

How to dump the content of PHP sessions files

Here is a handy CLI oneliner to inspect the content of a user’s session file:

# php -r 'session_start();session_decode(file_get_contents($argv[1]));var_export($_SESSION);' /path/to/php/session/sess_707484e735ad7aa9a108b23ad20cc46f
Publié dans system | Laisser un commentaire

Libération a 40 ans

Le 5 Février 1973 naissait le journal Libération.

Le 5 Février 2013, Libération ressort la première édition du journal.

Une phrase retient mon attention dans cette première édition :

Qui d’entre nous, en lisant son journal du matin, n’a pas l’impression d’être le jouet des marchands de publicité, des politiciens ?

Cette question a 40 ans, et pourtant elle apparaît tellement d’actualité.

On lit de moins en moins son journal le matin, mais on lit de plus en plus son journal sur Internet : sur les sites des journaux papier, des sites d’actualité, des agrégateurs de flux d’info, etc. Le journal papier comme support se perd, mais le contenu, la matière, l’information persiste et perdure sur d’autres supports.

Le support de l’information change, et avec elle, la publicité change aussi de support.

La publicité est omniprésente sur Internet : résultats sur un moteur de recherche, bannières/encarts/cadres publicitaire sur les sites d’information, spot publicitaire avant les vidéos, etc.

La publicité c’est très bien adaptée à ce changement de support, peut-être même mieux que le contenu lui même.

Qui d’entre nous, en surfant sur Internet, n’a pas l’impression d’être le jouet des marchands de publicité ?

 

Publié dans Uncategorized | Laisser un commentaire

You can spend your whole life doing no more than preparing for the life and thinking.

Terrance Hayes

Publié le par me | Laisser un commentaire

Locking in PHP to serialize execution of critical sections

Sometimes, execution of some code in parallel can lead to troubles: this is known as race-conditions, where parallel execution of some specific operations leads to corruption and/or unexpected results.

In these cases, the solution is to use locking techniques to force sections of code to execute sequentially rather than in parallel.

Note: for those not familiar with locking, it is important to understand that the same locking algorithm should be implemented by each party that will be executing a critical section! Locking is useless if only one party implements it.

Here I’ll show two techniques in PHP (one for local locking, and one for cross-server locking).

Continuer la lecture

Publié dans Uncategorized | Laisser un commentaire

WDC WD1002FAEX-00Z3A0 with Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH)

Dear lazy web,

Are there any known incompatibilities between Western Digital SATA disks (WD1002FAEX / Firmware version 05.01D05) and ICH9 SATA controlers?

I have a remote server (don’t have physical access to it) with an ICH9 SATA controler and two different disks  in a MD RAID1 volume: one Hitachi and one WD.

The problem is that I have poor write performance and iostat is always reporting a 100% utilization (%util field) on the Western Digital disk, while the Hitachi (HDT721010SLA360) does not reports such high %util usages.

The WD disk as been changed with another (same model) WD disk, and I’m still having 100% utilization on this disk.

Could there be an incompatibility between theses WD disks and ICH9 controlers?

Initialy the server was running with two Hitachi disks, and one of them failed, so it was replaced by these WD disk. Since then, I’m stuck with theses 100% util usages on this disk.

Publié dans system | Laisser un commentaire

Rollout your own DomainKeys-like signature verification in PHP

Reading documentation on DKIM I found it usefull to be able to distribute public keys through DNS to allow recipient to check signed content against it.

So, here is a couple of DomainKeysSigner and DomainKeysVerifier PHP classes that implement the sign and verify operations, with the verify operation fetching the public key through a custom DNS TXT record.

To start with, you need a public/private RSA key that you can obtain with openssl:

# openssl genrsa -out my.service.example.net.private.key 1024

Extract the public key:

# openssl rsa -in private.key -text -pubout

Now, you need to setup a DNS TXT record for your host/domain containing the base64 key from the previous command, without the « —–BEGIN PUBLIC KEY—– » and « —–END PUBLIC KEY—– » tags.

Let say you wan’t to set the key on « foo.example.net »:

foo.example.net. IN TXT "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCyvgpjWK2w6FmlFxdxcSBwP0P50jsIUB3ZV0xYXolLF0jipXdjN/TgZjBAlRYlF7u/iXW7WmrbU/mwpdlyiK0+dZvwZMGUzqBOC1ULz5i8xPVidutkBhMMWFovipibnvU6TePJjMdeBTlEDpi1p4/V66yOxJ8sU1nYCTYJIqaX1QIDAQAB"

Now you can use the DNSPubKeySigner and DNSPubKeyVerifier classes to sign and verify a data signature with the public key fetched from the DNS TXT record.

– https://github.com/eguaj/DNSPubKeyVerifier

Publié dans code, system | Laisser un commentaire