Technical articles

May 13

Offre de boulot sympa pour hacker junior

Salut a tous, et particulièrement aux drupalistas et autres artisans du web que ça peut intéresser. Pour ceux qui ne me connaissent pas, voici mon profil sur StackOverflow. Pour ceux qui ne sont pas sur de bien connaitre le mot hacker, ou qui pensent carrément que je fais une erreur en employant ce mot, merci de lire hacker howto par Eric Steven Raymond.

Je cherche quelqu’un de débrouillard en terme de création de sites webs pour me remplacer, avec un minimum d’expérience en drupal - que je ne connais que depuis 2 mois donc je suis facilement remplaçable… Ce job est parfait pour quelqu’un d’un qui n’a pas peur des défis et qui prend son métier très à cœur un peu comme moi.

Il s’agit d’une startup parisienne très sympa, pour laquelle je travailles depuis principalement Valencia (Espagne) oú j’ai encore un appartement.

Bon payeurs, je travaille pour eux depuis Mars 2010. J’ai toujours été payé. Comme c’est bien payé et que je suis un excellent gestionnaire et que je vie dans la campagne en Espagne, il m’est arrivé d’encaisser 4 mois de salaires d’un coup, par choix.

Il y a des possibilités d’évolution. C’est payé entre 1800 et 2800 par mois selon les missions et l’expérience. Les collègues sont des gens exceptionnels avec des petits défauts bien sur comme tout le monde … mais surtout de grandes qualités ! Il suffit d’être un peu ouvert d’esprit.

L’emploi vient avec un Asus Zenbook qui appartient au client, c’est un ultra-portable dernier cri:

C’est en télétravail et à plein temps. De plus, il y a des voyages à Paris presque tout frais payés plusieurs fois par an.

Je mets ma carierre en suspens pour des raisons personnelles. Je n’aurais plus du tout le temps de travailler sur internet.

Apr 02

Open Source Windows NT

Seems like ReactOS is rapidely growing.

Mar 27

Drupal 7 with nginx and uwsgi-php example configuration

Drupal is a CMS written in PHP which supports PostgreSQL. It is made for mod_php and Apache, thought it works with uWGSI and Nginx.

When you have tried uWGSI you know why you want this.

Example nginx configuration:

server {
    server_name drupal.example.com;
    root /srv/drupal/www/;

    error_log /tmp/nginx_drupal.log;

    index index.php index.html;

    location / { 
        try_files $uri @rewrite;
    }   

    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
    }   

    location ~* files/styles {
        access_log off;
        expires 30d;
        try_files $uri @rewrite;
    }   

    location ~ .php$ {
        include uwsgi_params;
        uwsgi_modifier1 14; 
        uwsgi_pass unix:/tmp/uwsgi_drupal.sock;
    }   
}   

And an example uwsgi configuration:

[uwsgi]
socket=/tmp/uwsgi_drupal.sock
pidfile=/tmp/uwsgi_drupal.pid
daemonize=/var/log/uwsgi/drupal.log
plugins=php

chdir=/srv/drupal
cheaper=4
close-on-exec=1
harakiri=360
max-requests=128
processes=8
master=1
uid=drupal
gid=drupal
chmod=666
log-5xx=1
vacuum=1
post-buffering=8192

Mar 26

Partition your data with django-parting

Just stumbled on django-parting which provides a nice API to partition your data.

For those not familiar with data partitioning, I recommend reading partitionning on mysql.

Mar 21

PyCon 2013 videos are online !

Check them out.

Mar 12

First 5 Minutes Troubleshooting A Server

A very nice article about troubleshooting a server

Mar 07

PostgreSQL for beginners: Initial configuration

Those are notes taken from the talk “PostgreSQL when it is not your job” by Christophe Pettus from PostgreSQL Experts Inc. at DjangoCon Europe 2012.

This article describes how to make a basic PostgreSQL configuration:

Note: this article is mostly a transcript from the talk by Christophe Pettus: so send all the cookies to him. Thanks !

That’s around 12 configuration options and you’re done.

Logging

Starting with logging is a good idea because it’s the best way of getting information for configuring the other settings.

Where to log

Three options:

What to log ?

Christophe Pettus recommends this configuration, which you can copy and paste in your postgresql.conf:

log_destination = 'csvlog'
log_directory = 'pg_log
# enable file rotator
logging_collector = on
log_filename = 'postgres-%Y-%m-%d_%H%M%S'
log_rotation_age = 1d
log_retation_size = 1GB
# log statements that take more than 250ms
log_min_duration_statement = 250ms
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0

Memory configuration

Three things you have to tweak:

shared_buffers

work_mem

This can be a huge spped-up if set properly ! This is probably the setting that has the most impact on postgresql performance !

But if you find yourself setting this super high like 8GB, you probably don’t want to set it that high. Because every time someone does an operation in postgres like a SORT, it could potentially use that amount of memory per planner.

If you’re having problems of memory exhaustion problems, this is the best setting to back off.

maintenance_work_meme

This is the amount of memory that PostgreSQL uses for indexing or vacuum operations.

effective_cache_size

Unlike other parameters we’ve seen, this one won’t actually allocate any memory.

Checkpoints

Settings part I

# that's the right value according to Chripstophe
wal_buffers = 16MB
checkpoint_completion_target = 0.9
checkpoint_timeout = 10m-30m, # Depends on the restart time

The trade off about checkpoint_timeout is: the higher it goes, you’ll generally get better performance, but the longer it will take postgresql to restart after a crash.

Settings part II

Settings part III, warnings

Planner settings

Mar 01

Foundation 4 is out: a nice Twitter Bootstrap alternative

The new brew of Foundation 4 is out, focusing on mobile first. Worth trying.

Feb 22

dropzone.js: nice jQuery plugin for file uploads

dropzone.js is an open source library that provides drag’n’drop file uploads with image previews

Feb 21

Enable global site packages in an existing virtualenv

Nowadays, virtualenv uses --no-site-packages by default. This means that the created virtualenv will not access global site-packages modules ie. /usr/lib/python2.7/site-packages/.

To enable global site-packages again, just remove this file::

your_env/lib/python2.7/no-global-site-packages.txt

Why would you do that ?

Some modules are complicated to install (xpyb) or take too much time to compile (pyqt). Using the distro packages can be pretty useful !