There and back again

Life’s funny.

I’ve posted that I wanted to learn to design, and I still do, but now I’m looking to base my work of artisteer more than photoshop (which is pretty much admiting defeat in my book). I haven’t posted about the book I’ve been trying to write, but on the contrary that seems to be working out OK.

Mabey this blog is jinxted and as such just makes me stop doing stuff.

Just started using android’s wordpress app, it seems to be working OK so far.

Oh, and my dabling with OpenERP has just landed a nice contract, and I seem to be doing OK for an auto didact, just goes to show that you never know.

++

Posted in english, personnel | Leave a comment

Learning to design

I have a confession to make.

I can developpe, do CSS, but at the moment, I can’t really design. I don’t seem to be able to get fonts/layouts just right, and no hope on the rest.

All is not lost though, since I’m determined to learn.

I’ll be keeping a log here, and might even right a tutorial or two down the line.

Posted in Uncategorized | Tagged | Leave a comment

Flash, linux, rights and the elusive mouse click

Sometimes under Linux , when you’re trying to change a profile picture, or start a video chat, you find this kind of show stopper at your door:

Unfazed, you click on Allow (or Autorisé ;) and … nothing happens.

After some searching here’s the work around I found:

Right click on the applet, and click on global parameters (a new tab will open).

Click on the Application parameters link to the left in this page:

This should get you to a vaguely familiar dialogue box, that you can click!

Here you have to find your site in the *cough* un-ordered *cough* list, and click Allow.

Restart your browser and low and behold:

Flash applet’s doing what they should!

Hope this helps someone out, and saves them time

 

Posted in english, linux | Tagged , , , , , , , , | Leave a comment

Deploying a buildout based project thourgh apt

Just finished working out how best to get a buildout based project onto a production server.

I had a few constraints for this, namely:

  • The production servers being micro VMs (512Mb ram and less), the solution mustn’t gobal up gigs of ram during deployment
  • The solution must integrate cleanly with Puppet, and must upgrade cleanly
  • A downgrade must also be possible to be able to roll back in case of trouble
  • If at all possible, build-essentials must not be installed on a production server for security reasons.

All this lead up to quite a headache.

Continue reading

Posted in english, linux, work | Tagged , , , , | Leave a comment

XDebug and KCachegrind reference bug

The XDebug/KCachegrind combo is pretty much the bees knees as far as fixing performance bugs are concerned, but a (fairly) recent tightening of the rules regarding the cachegrind format can sometimes lead to a fragmented call graph.

The problem happens with a recent KCachegrind, and XDebug before version 2.1.1. In this case, XDebug doesn’t fill in the called file name when recording a function call, expecting KCachegrind to be smart and pick it up from the functions name.

This assumes that you’ll never have 2 functions with the same signature declared in 2 different places.

In PHP this is a valid assumption, PHP will break if you try to re-declare a function. In other languages though, scoping can make this doable (C/C++ in particular handle this case). As a result, KCachegrind stopped trying to be smart, and insisted on having the called file specified to it, creating duplicate calls if it couldn’t find them, fixing the C/C++ case, but needing an update from XDebug. This update came with 2.1.1, but some distributions still out there (ubuntu 10.04 in particular) don’t carry this version. These distributions will still give you invalid cachegrind data.

To fix this, I’ve written a small script that provides the missing metadata, allowing a more fluid analysing of the graph.

With out more waiting, here’s the script:

#!/bin/bash

file=$1

symboles_file=${file}.symboles

grep -E '(^fn|^fl)' $file | awk -F '=' '/^fl/{fl=$2;} /^fn/ {if (fl!="") {print $2 "=" fl; fl=""}}' | sort | uniq > $symboles_file

awk -F '=' 'FNR==NR{map[$1]=$2;} /^cfn/{print "cfl=" map[$2]} FNR!=NR{print} ' $symboles_file $file

rm $symboles_file

Here’s all you need to know about usage:

$./trace_fixer.sh cachegrind.out.myId > cachegrind.out.fixed.myId
Posted in english, linux, php, work | Tagged , , , | Leave a comment

Profiling and debugging, when they mix

image

Normally, you debug, and when that’s done, you profile to speed things up.

That said, today I was confronted by a problem where profiling actually helpped the debugging.

A page, that should be working 100% from memcache was hitting mysql, 2 million times a day.

This page was on a serveur that couldn’t be debugged remotly. Two options were available, I could either put “print”s everywhere, and hoped to get lucky, or I could run the pager through xdebug’s profiler.

Loading the resulting profile into KCacheGrind, I had a detailled run down of every code path taken available to me. All that was rest was to lookup all mysql calls and work back up from caller to caller to identify the bug.

Posted in english, linux | Tagged , , , | Leave a comment

Nginx and disk starvation

A quick note that will help someone I hope.

If you have a high bandwidth site, and are seeing high load, lots of time waiting for io and nginx processes in the D state a lot, here’s something you could try:

First of all, install iotop and make sure nginx is the culprit (lots of IO for nginx, not much for the rest)

Then, go and have a look at your NGinx configuration, (nginx.conf), especially the worker_processes

You can try pushing the value up to (and maybe even over) the number of cores you have in your system. This spreads the load more evenly, and allows you to dramatically increase disk throughput (doubling isn’t uncommon).

This worked for me (going from 3Mb/s to 7Mb/s peak). That said, YMMV.

Feel free to leave a comment to say if/how this was (un)helpful ;)

Posted in english, linux | Tagged , , , , | Leave a comment

Troisième coup gagnant

Septembre 2010…..

Ça en fait du temps. Depuis, on a démenagé dans le sud, j’ai lancé 2 sociétés (ok, 1 et demie, c’est presque pareille), et globalement plus rien n’est pareille.

Durant ces 18 mois j’ai également progréssé de point de vue technique, et c’est pour ça que je compte raviver ce blog.

Il y aura des articles en anglais et en français, et je veux tenter de tenir le rythme d’un par jour.

Et c’est partie…

Posted in français, personnel | Leave a comment

Anti-spam take 2

Since the last system was marginally effective, I’ve just upgrade to
a) (re)capture
b) Askimet

Hoping that this can keep the blog clean

Posted in Uncategorized | Leave a comment

IE session bug

I’m just reposting this here so that it can help someone else.
Internet Explorer doesn’t honor php sessions if the domaine name isn’t valid (hint: _ isn’t a valid caracter in domaine names).
This can explain some hard to find bugs where your session works fine on FF, chrome or Safari, but not in Internet Explorer.

Posted in english, php, programming, work | Tagged , , | Leave a comment