Catégories: "Informatique"

Le HDR par Sylvestre

Avril 25th, 2006

Depuis que Julien m'a fait découvrir le HDR, j'attendais le moment pour tester cette technique de rendu de photo développé par ILM (Industrial Light and Magic, société de G. Lucas).

Paris en HDR
Paris en HDR

En effet, même sur un sujet assez quelconque, le rendu est pas (trop) mal. Le principe consiste à prendre plusieurs fois la même photographie (3 pour mon exemple) avec des réglages différents (pour moi, j'ai juste changé la durée d'ouverture).

Celui qui devine où se trouve cet immeuble a gagné un billet avec sa photo sur mon blog !

Plus d'information sur le principe
HDR à New-York

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 »

Monitoring a specific virtualhost apache

December 29th, 2005

Monitoring apache quite easy. There are plenty of solutions to do that. When it comes to monitore virtualhost one by one, it starts to be difficult. Of course, there is always the solution of using stats softwares but usually, it is not really time and doesn't give a quick and efficient overview.


Here comes mod_watch. A quite old module for Apache (1.3 & 2.0). Basically it monitores the incoming/outcoming traffic and the requests.


There is no debian package for this module. However, it is very easy to install.


apt-get install apache-dev

tar -zxvf mod_watch318.tgz
cd mod_watch-3.18

make install




Edit /etc/apache/modules.conf
And add in it :


LoadModule watch_module /usr/lib/apache/1.3/mod_watch.so




Edit /etc/apache/httpd.conf
Add :


<IfModule mod_watch.c>

# Allows the URL used to query virtual host data:
#

# http://www.snert.com/watch-info
#

<location /watch-info>
SetHandler watch-info

Order allow,deny
Allow from hostname

</location>



# Intended for debugging and analysis of shared memory

# hash table and weenie files:
#

# http://www.snert.com/watch-table
#

<location /watch-table>
SetHandler watch-table

Order allow,deny
Allow from hostname

</location>


</IfModule>




Stop & start apache (not a restart)


/etc/init.d/apache stop && /etc/init.d/apache start







For each virtualhost, you should be able to see a line containting this kind of data :
sylvestre.ledru.info 49 0 499775 39 9 1 0.000 136656176 3221223448


This means :












sylvestre.ledru.infotarget name
49uptime in second
bytes received from requests
499775bytes sent
39number of requests received
9number of documents sent
1number of active connections
0.000approx. 5 minutes average of bytes sent per second
136656176bytes sent during the current 5 minutes period
3221223448start time() of the current 5 minutes period




This data are meant to be retrieve by MRTG thought the mod_watch client in order to produce graphs, ie :


# ./mod_watch.pl http://sylvestre.ledru.info/watch-info

0
2012653

11.31
sylvestre.ledru.info


This returns the number of bytes out.

Or


# ./mod_watch.pl -f ifRequests,ifDocuments http://sylvestre.ledru.info/watch-info

241
80

13.02
sylvestre.ledru.info


This returns the number of requests and documents.


Finally, as the developer knows that ITs are lazy, he made a script which will automatically create an MRTG configuration file from the apache configuration (I made a small patch in order to monitore also the documents/requests with this script and fixes a bug with mrtg indexmaker)


wget http://sylvestre.ledru.info/howto/mod_watch/patch_apache2mrtg.diff

patch < patch_apache2mrtg.diff
Add Workdir: /path/to/www/ for the output dir

./apache2mrtg.pl /etc/apache/httpd.conf > /etc/vhosts_mrtg.cfg


Caution ! apache2mrtg.pl will parse ALL the virtualhost. Even those with htaccess login/password and then won't be able to access to the watch-info files. Remove them from the vhosts_mrtg.cfg file.


There is many solution to customize the value & data. Check out the documentation here : http://www.snert.com/Software/mod_watch/.


Advantages :

* Quite easy to install, configure & maintain
* Quite fast

* Make very easy the task to find which virtualhost takes all the bandwith.


Disavantages :
* Impact on the performance ?

* No monitoring of CPU / Memory
* Based on headers (ie, if I start a download of 200 mo and I stop at the beginning, it will count 200 mo... Problem Described here)


Next tasks :

* Patch the software to add CPU & Memory monitoring PER virtualhost or find a module which does that.
* Find a way to fix the headers issue.

* Add the total bytes transferts


Edit : Comments closed. Thank you spammers !

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

A silly & boring PHP bug ...

November 3rd, 2005

This morning, I received a emails telling me that there is a big problem on a website that I host. Users are not able to upload any image on the server. (Warning: imagejpeg(): Unable to access 474/10434/59107.jpg in /www/libs/functions.php on line 226) Weird... The problem is in a daily used function which has been running for years. The only recent changed was the migration from v4.4.0 => v4.4.1 of PHP few days ago.
Because of the time difference, I only saw this problem when I woke up this morning. And fortunately, Julien has been able to find a temporary workaround... By disabling the safe mode... Dirty but it fixes the problem.

In the first place, I thought it was a change in the default configuration of PHP but I received a other email about the same kind of problems. Let's see the bug tracker of PHP... Ok, I am not the first one who has this issue.
http://bugs.php.net/bug.php?id=35060
http://bugs.php.net/bug.php?id=35071

One of the workaround that I found in this bug report is to make a touch() before calling the imagejpeg() function... Almost worster than the safe mode fix as I use it everywhere.
And I saw that Sniper is considering this as a feature (this is not a bug but a feature). Well, I don't see the point of touching a file before creating it after but well...
And people are complaining about this. Like this message :

Changing the way functions work within a minor update (version+=0.0.1) is an irresponsible way of maintaining software. This bug (please don't call it a "feature") caused a lot of trouble on our servers.

And I don't think that the way Sniper is any answering really help in the first bug report.
However, it seems that he considers this as a bug in the second bug report. The modification here shows it : http://cvs.php.net/php-src/ext/gd/php_gd.h (details here : http://cvs.php.net/diff.php/php-src/ext/gd/php_gd.h?r1=1.59.2.1&r2=1.59.2.2&ty=u).

Now, let's see if they are going to release a 4.4.1.1 version or we will stay with a safe_mode=off for a little while...

Edit : Comments closed. Thank you spammers.