Catégorie: "Linux"

-bash: /bin/ls: No such file or directory

September 19th, 2006

If you have done a mistake/lost the /lib/ directory. Example :

mv lib lib.

And you are stuck without anything working :

# ls
-bash: /bin/ls: No such file or directory

Don't waste your time in a reinstallation, there is a trick :

/lib./ --library-path /bin/ mv /lib. /lib/

It invokes the program loader directly and the problem will be fixed (of course, you can use this command to call many programs).

Ma vie (piouf)

Mai 25th, 2006

De retour en France début avril, ces deux derniers mois ont été consacrés à la recherche d'un boulot et d'un appartement.
J'ai maintenant les deux et qui ont tout pour me plaire.
Niveau de l'appartement, je me suis installé avec mon amie dans un trois pièces situé à Paris (20 ème) près de la place de Nation. Super appartement, content et bien chez nous dedans. Bon, le seul problème est que l'on a pas encore l'ADSL... Donc je squate la connexion chez Pimentech.

Pour le boulot, après de longues recherches (cf message précédent), j'ai finalement trouvé exactement le boulot que je recherchais. Je vais intégrer le prestigieux institut qu'est l'INRIA - Institut National de Recherche en Informatique et Automate (pour ceux qui ne connaissent pas, c'est comme le CNRS mais appliqué à l'informatique). Régulièrement classé dans le top 3 de 01 informatique des entreprises préférées des informaticiens.
Je vais être amené à travailler sur le projet Scilab, logiciel de calcul scientifique. Mon travail consistera principalement en les développements multi plates-formes en vue de la réalisation des fonctionnalités de Scilab 5 et la responsabilité des versions UNIX et GNU/Linux du logiciel Scilab. Je sens que je vais bien m'amuser !

Ce fut un retour et une réinstallation en France un peu plus longue que je ne l'avais imaginé mais qu'il est au final bien passé !

OpenCascade : How to make money with free software ?

Avril 11th, 2006

I wrote this article 6 mois ago. I was waiting for some stuffs around this. However, it is too late so I release it.

My main concern about free software as a way of doing business is "how do you make money out of it ?".
Unfortunatelly, I still don't see any solution ... Of course, it is possible by selling services, maintenance, help, more (costly) advanced version, side development (usually proprietary) but it is not doing money only on free software/development.

Let's me describe on of the solution that uses Opencascade, a former department of Matra.

They produces for a quite long time (about 10 years) a big project called "Open CASCADE". It is a framework used to modelise, visualise 3D models (and many other things that I hardly understand)... It has an aspect of gas factory ("Usine à gaz" as we say in French) because the size/age/complexity of the project. However, it is a very convenient way of doing 3D (many famous corporations use it).

At work, I am working on a project launched by the BRGM (Bureau de recherche géologique et minière ... the equivalent of the french CNRS but for earth sciences) about 10 years ago. The aim of the project is to provide to geologists and geophysists a way of representing the underground. The corporation where I work is doing the work of adding new features, packaging and selling the software. For this project, we use Opencascade.

My work on this project was to provide a visualisation of drillholes in a 3D space (holes that are dug in the ground to get the geological structure of the underground). Basically, I was supposed to represent a (drunk) worm hole from a serie of points.
I tried many way (from the ugliest to the sharpest) but I found some problems with my favorite. When I used too much points, the framework start to reject me (technical description is following my message). As I don't like when a software rejects me, I spent time one this issue (I thought that it was my fault because it is a quite basic feature in the software). I finally successed to isolate the issue and send a kind of SOS/bug report to someone at OpenCascade.
This request cost us 2 units of support from our contract.

Then, one week after, they get back to us with a "There is a bug in Pipe algorithm.". OK, cool. I was a bit proud to find a bug in this kind of big software (for the courageus/crazy, the reason of the bug is : "This bug is caused by complex structure of the curve approximated from 14 (15) points (some discontinuities of derivatives of high levels). Such structure of the curve causes turbulence of the local coordinate system of section along the curve. That is why the algorithm can not build a pipe where the section is orthogonal to the curve in each point all along the curve.", obvious no ?). However, I was expecting a small patch which will fix the issue and a "thank for the bug report". Instead of this, I saw :

The bug fix production can be started after your confirmation.
Please note that the standard price of a query is 15 units of your support program.

OK, now, I know how they make cash (at least a part of it).
You submit what you think to be a bug, it costs you 2 units. They confirm that is a bug, you have to pay 15 units to get the fix. Otherwise, you have to wait for the new release planned whenitwillbeready.
I am not saying it is a bad solution (and I do understand why they do that ... it is called support) but it could be more respectful for the user who spent many time to isolate a bug and report it and consequently helped to improve their software...
(For their defense, they provided me a workaround for my issue).

Lire la suite »

Flying tux

Décembre 13th, 2005

Lors de mon vol Melbourne => Hong Kong, le système de vidéo de la business class avec Cathay Pacific est tombé en rade. Donc on a patienté pour que ça revienne et on a vu que le système tourne sous Linux. Le problème était visiblement que le serveur de fichier NFS était en rade et donc que les clients n'arrivaient pas à le monter...

Voila la photo... Je suis un peu passé pour un cinglé à prendre ça en photo dans l'avion.
Linux / Tux used by Cathay Pacific
Linux / Tux used by Cathay Pacific

Bug fixes admin & dev

November 2nd, 2005

Three small problems at work/personnal today.

  • I had to update the kernel of my boss's computer (running Ubuntu) in order to change an include.h into the GNU/Linux kernel (no more modification in the kernel). Then, I rebooted the computer but the data partition was not mounted. Getting stuff like :
    root@scully:/# mount /data/
    mount: /dev/hdb1 already mounted or /data busy
    Of course, hdb1 is not mounted and /data is not busy (fuser -v /data is your friend).

    After a few investigation, I found that evms is trying to access to the drive on boot and I guess it is not releasing the hard drive properly or something like that.
    Nov 02 17:07:28 scully _5_ Engine: is_volume_change_pending: Change pending: Volume /dev/evms/hdb1 needs to be activated.
    The dirty workaround is to launch evms AFTER the mount all options.
    mv /etc/rcS.d/S27evms /etc/rcS.d/S99evms

    Be carreful, this could cause side effects.

  • I had to debug an issue under the linux version of our softwares. Impossible to read big files (over 2 go).
    Then, I created a fake file of 3 go and made a small program to reproduce the issue.
    Here is the source :

    void myRead(FILE * fichier){
    	/*lit le fichier caractere par caractere*/
    	char buf;
    	int ret=1;
    	if (fichier!=NULL)
    int main () {
    	FILE *myFile = fopen( "bigfile","r" );
    	if (myFile!=NULL) {
    		printf("myFile not opened");
    	return 0;

    Amazing, isn't it ?

    When I run this program (after tsize testsize.cpp), I only get a myFile not opened.
    Launching again this software with strace and I can see in the middle of the dump a :
    open("bigfile", O_RDONLY) = -1 EFBIG (File too large)

    After a few links, I finally found the solution :
    Add at the beginning of the source (before some includes) these three lines
    #define _FILE_OFFSET_BITS 64
    => defines which interface will be used by default
    #define _LARGEFILE64_SOURCE
    => permits the use of 64 bits functions
    => permits the use of fseeko() and ftello()
    Of course, it is possible to specify these define in the g++ command line like that : g++ -D_FILE_OFFSET_BITS=64 -o testsize testsize.cpp


  • Sealers Cove - Wilson PromontoryLast but not least (I like this expression), an trick avoid stealer to make a direct link to one of your image on their website and wasting your bandwith. Personally, I don't care. I have plenty of bandwith and it represents a small part of the current traffic.
    However, I had to fix this problem for a website which offers legal mp3 & avi.
    The trick consists of using mod_rewrite. It checks the referent and if it is not from the official website and that it is trying to reach a file with a specific extension (mp3 and so on), we redirect the navigator to an other URL.

    Just put this few lines into your .htaccess and it should do it (if you have access to mod_rewrite for your website) :

    DirectoryIndex index.php
    RewriteEngine On
    # Rewrite Rules for files
    # if the referent is not empty
    RewriteCond %{HTTP_REFERER} !^$
    # if the domain is not our
    RewriteCond %{HTTP_REFERER} !^(.*)(|*)$
    # if the extension if in the list 
    RewriteCond %{REQUEST_URI} \.(mp3|wmv|wma|zip|avi|mpg)$ [NC]
    # Redirect to an URL 
    RewriteRule ^(.*)$ [L]

    Pretty simple isn't it ?

PS : why this image ? Well, this post is too technical... This picture has been taken last week end in Sealers Cove in Wilson 's Promontory in Victoria.

Edit : comments are closed. Thank you spammer.