BeezNest Open-Source specialists

November 17, 2009

OpenERP to become AGPL

Filed under: Development projects, Misc, OSS Solutions — ywarnier @ 2:06 am
Tags: ,

Apparently, the next versions of OpenERP will be AGPL. I could not approve this change enough. The current world is crippled by companies (coined as ‘evil’ by Fabien Pinckaers) who use and modify the software for their own customers without ever contributing a bit of code. This actually makes them parasites of GPL software, instead of symbiotic organisms. We had the same type of problem with Dokeos in the past, and decided to go for AGPL with OpenC2C.

A recent discussion with a FSF group in Chile made me realized that I wasn’t really the only one worried about the parasiting of GPL by ethicless companies, and that even large companies (like celular phones companies) were adopting it to avoid the work made for them by third parties to be disowned from them later on.

An interesting development, if you ask me.

November 8, 2009

Measuring memory usage with XDebug no longer possible (as of 2.0.0 RC4)

Filed under: Tech Crunch — ywarnier @ 8:06 pm
Tags: ,

For those like me who remember being able to see memory usage in KCacheGrind using Xdebug, well… that’s not possible anymore.

Following the Xdebug’s changelog, the memory profiling has been removed (“Removed support for Memory profiling as that didn’t work properly.”) in 2.0.0 RC4 ([2007-05-17]). Although there’s been a bunch of comments on that feature loss (like here and on the bug tracking system), it doesn’t seem like there’s been any applied patch to fix it. This being said, you might try the proposed patch yourself, if you manage to extract the proposed files (which seem to have disappeared).

You could also using the “trace” feature of Xdebug, but that doesn’t help you see it visually in KCacheGrind.

Well, too sad for all of us who will have to play with memory_get_usage() and memory_get_peak_usage() manually again). Any hope for a fix soon?

Using Ohloh’s PHP API

Filed under: Development projects, Tech Crunch — ywarnier @ 6:05 am
Tags: ,

I was trying to find out the total contributions to the Dokeos code, by contributor, between two dates, and thought I could do that with the PHP API from Ohloh, given the fact that it already provides nice analysis about the contributions in open-source projects.

Apparently, there is no way, currently, to get the total list of contributors (mostly because it is divided per page on the Ohloh website), so I built an additional function to do that (see below), but then realized that it was impossible to actually get the total commits per user between two date with the contributor idea.

Added code:

/**
 * Get all project contributors
 *
 * This function queries various pages of the API, so it might take a
 * while to return results for projects with many contributors
 *
 * @return object  simpleXMLObject
 * @access public
 */
 public function getAllContributors() {
 $contributors_on_page = 10;
 $current_page = 1;
 $contributors = array();
 do {
   $url = 'http://www.ohloh.net/projects/'.$this->projectID.'/contributors.xml?page='.$current_page.'&api_key='.
          $this->apiKey.'&v='.$this->version;
   $response = $this->_process($url);
   $contributors_on_page = 0;
   foreach ($response->contributor_fact as $id => $contributor) {
     $contributors[] = $contributor;
     $contributors_on_page ++;
   }
   $current_page++;
}
while ($contributors_on_page == 10);
return $contributors;
}

In the end it was far easier directly using Mercurial or Subversion on the command line:

$ hg log -d "2008-06-13 to 2009-06-01" |grep ^user > /tmp/users.txt

and then parse the file with a small PHP script that would use an array of names and count the number of items:

<?php
$commits = 0;
$users = array();
$file = file('/tmp/users.txt');
foreach ($file as $line) {
 $line = trim(substr($line,0,14));
 if (isset($users[$line])) {
   $users[$line]++;
 } else {
   $users[$line] = 1;
 }
 $commits++;
}
foreach ($users as $user) {
  echo $user.": ".$users[$user]." (".number_format(($users[$user]/$commits)*100,2).")\n";
}

Then just execute the PHP script with the php command on the command-line, and you get a beautiful list of users with the number of commits for each one of them. You would still have to order them by number of commits and possibly remove a few duplicates, but that’s just a minor piece of work now…

October 21, 2009

Directive MaxClients de Apache2

Filed under: Development projects, Tech Crunch — ywarnier @ 12:07 am
Tags: , ,

Un article particulièrement intéressant au sujet de l’optimisation d’Apache2 peut être trouvé ici: http://ftp.traduc.org/doc-vf/gazette-linux/html/2006/123/lg123-D.html#AEN213

En particulier pour la directive MaxClients:

La directive MaxClients fixe la limite maximale de requêtes simultanées que le serveur peut prendre en charge ; aucun processus enfant au-delà de ce nombre n’est engendré. Il ne devrait pas être défini à une valeur trop basse, sinon un nombre toujours croissant de connexions sont reportées dans la file d’attente et occasionnent finalement un dépassement du temps imparti, alors que les ressources du serveur restent inutilisées. Si vous lui donnez une valeur trop élevée, en revanche, le serveur commencera à « swapper », ce qui fera diminuer considérablement le temps de réponse. La valeur appropriée pour MaxClients peut être calculée ainsi :

4 MaxClients = Mémoire vive totale dédiée au serveur web / Taille maximale des processus enfants.

La taille des processus enfants destinés à prendre en charge des fichiers statiques est d’environ 2 à 3 Mo. Pour du contenu dynamique tel que PHP, elle peut être aux environs de 15 Mo. La colonne RSS dans ps -ylC httpd –sort:rss affiche l’utilisation de la mémoire physique non permutée par des processus Apache en kilooctets.

S’il y a plus d’utilisateurs simultanés que MaxClients, les requêtes seront mises en file d’attente jusqu’à un nombre défini en fonction de la directive ListenBacklog. Augmentez ServerLimit pour régler MaxClients au-dessus de 256.

October 13, 2009

cPanel, Fantastico, GNUPanel, cPAddOn, etc

Filed under: Development projects, OSS Solutions — ywarnier @ 1:14 am
Tags: , ,

I’ve been investigating a little bit about cPanel and Fantastico. I first thought they were open-source. They’re not. Then I thought it would be easy to develop scripts to manage my own open-source web application. It’s not possible because of the license. Then I thought I could find documentation on how to ask someone to develop one of these. Not easy.

In the end, it seems like it just doesn’t make much sense for an open-source software not to use an open-source software to manage its software installation on hosting systems.

Anyway, so I decided to install and try out GNUPanel, which is a set of PHP, Perl and Shell scripts that allow for managed hosting. I’ll report on how happy I am with that later.

September 8, 2009

Running OpenERP 5.0.3 from sources on Ubuntu 8.10

Filed under: English, OSS Solutions, Tech Crunch — ywarnier @ 3:02 am
Tags: , ,

$ bzr clone lp:openerp

$ cd openerp

$ ./bzr_set.py -r tag:5.0.3 ../5_0_3

$ cd ../5_0_3/

Open one terminal for the server

$ cd server/bin/

(make sure you have a “terp” user on your system, and that you’re logged as this user, and that there is a “terp” database in your PosgtreSQL server)

$ sudo su terp

$ ./openerp-server.py –db_user=terp –db_host=localhost

Open another terminal for the web client

$ cd web/lib/

$ ./populate.sh

(this will install all the required missing libs)

$ cd ..

$ ./openerp-web.py

Go with your browser to http://localhost:8080/. There you are.

Creating the database and all that is complicated. Have a look at this other article to understand the process.

August 29, 2009

Fixes for Gallery 2 French translation in module ‘core’

Filed under: Development projects, English, OSS Solutions — jwarnier @ 1:27 pm
Tags: , ,

After years using G2, I finally fixed the fr.po for core module and submitted it to latest registered French translator of Gallery2 several weeks again. After review, he encoded the following tracker on SF.net for everybody to benefit from it, even if no G2 update is ever published again:

https://sourceforge.net/tracker/?func=detail&aid=2846783&group_id=7130&atid=582564

As G2 is using gettext, updating it it fairly easy.

Enjoy!

August 28, 2009

Enhance your usage of Firefox (part 1)

Filed under: OSS Solutions, Tech Crunch — ywarnier @ 6:12 am
Tags: , ,

When installing Ubuntu on one of the new machines we get from time to time, there’s a common mechanism I repeat over and over with Firefox:

  1. install the Firebug extension
  2. install the Web Developer extension
  3. install the ShowIP extension
  4. install the GooglePreview extension
  5. change the link of the start bar icon to start Firefox, to “firefox -no-remote -ProfileManager %u” instead of “firefox %u”

The latest option allows you to launch Firefox using different profiles, each of them having its own extensions. This allows you to have a slower but fully equipped Firefox on one side and a faster but bare Firefox on the other side. If you installed all the extensions I have mentioned  (and maybe more), you might want to get another one for faster or cleaner demos. There you go, your second profile can be called “demos”.

Oh, and you might want to change the look of your Firefox a little bit with the Persona extension. That’s quickly boring as well, and it doesn’t help usability much, but still, considering your browser is the tool you probably use most as a web developer…

August 20, 2009

Easily avoid using your password in an SSH connexion: ssh-copy-id

Filed under: Tech Crunch — ywarnier @ 7:45 pm
Tags: , ,

On Linux systems, there used to be a mildly complicated but tedious way to allow you to SSH another computer using your public key, which involved finding and copying your public key on the other host, then connecting to the host and putting this key into ~/.ssh/authorized_keys.

Now there is a much simpler way to do that… Just launch the following command (with your own data), enter your password, and that’s it!

ssh-copy-id  yourusername@remote.host.address

I love administrative simplification!

July 20, 2009

Java Applet Uploader bug in Gallery 2 + Firefox 3.0

Filed under: English, OSS Solutions, Tech Crunch — ywarnier @ 12:21 am
Tags: , ,

This is a bug we’ve seen but have been unable to explain so far… for several people, all the Java-based Gallery 2 uploaders applets and apps are crashing the Firefox browser or putting it in an unstable state, preventing us from uploading pictures.

Apache doesn’t log anything wierd. The Java console isn’t very eloquent (but it reports a few exceptions), but the browser doesn’t get to show the applications that allow uploading files this way.

There is, however, a solution, which is to have a *clean* Firefox getting to the uploader pages. This can be done under Ubuntu through the command

firefox -no-remote -ProfileManager %u

This will let you create and start another  (completely clean) session of Firefox, and this (in turn), will let you use the Java-based uploaders.

Another great solution would be to have FireUploader (a Firefox extension) support Gallery 2 uploads (probably trivial to do).

Next Page »

Blog at WordPress.com.