Coding

[Symfony] Coupling sfDoctrineGuardPlugin and fail2ban

Recently I created a quite sensible application using symfony 1.4. As many people, I chose sfDoctrineGuardPlugin as authentication/password recovery/account managing system. But even with this piece of software, you are still vulnerable to bruteforce attacks.

I though of hacking sfDoctrineGuardPlugin's code to create some rules and attack detections. But those systems are quite tricky to create and calibrate. It must not be too aggressive nor too permissive. I wanted something that can bail out someone after $some tries in a $certain time. That implied that I would have to record every try with the current time, and calculate a ratio within which a user can login or not. I seemed simple, then it got too complicated.

Lire la suite

Symfony, tasks and return values

In symfony, it's possible to return a value in your execute() method. Let's create a test task : ┌─(yoda@box)(09:46:59) └─(~/var/www/test)-> ./symfony generate:task test >> task Creating "/home/yoda/var/www/test.../testTask.class.php" task file Adding a return value at the end of  […]

Lire la suite

[PHP] Pensez à STDClass

Il arrive souvent qu'on ai besoin de retourner plusieurs informations distinctes dans une fonction ou une méthode. La plupart du temps, il suffit de retourner un tableau indexé de manière intelligente. class CSS { public function getDeclaration($pDeclaration) { list($key, $value) = explode(':',  […]

Lire la suite

Recomposer un HTML valide après l'avoir tronqué.

Récemment, je me suis occupé de la création d'un site web tout joli tout beau, dans lequel les webmasters peuvent composer certaines parties de leur site web via un éditeur online wysiwyg. Mais à certains endroits, j'avais besoin de mettre juste le début du texte suivi des traditionnels 3 petits points.

Lire la suite

Notify plugin for aMSN updated (1.3)

New version of my notify plugin for aMSN Changelog: Added "dash hack" : http://www.amsn-project.net/forums/viewtopic.php?t=5847, thanks to nico@nc Re-enable sounds on events: http://www.amsn-project.net/forums/viewtopic.php?t=5824 , thanks to nico@nc too bumped to version 1.3 Download the  […]

Lire la suite

MPD Remote control script

Hey, i'm still looking for my best audio player. At the moment i'm testing MPD with Sonata as Front-end. Unfortunately, mpd doesn't come with a remote controle system that can be used with my Logitech keyboard. So I managed to write mine. You'll need Audio::MPD, which is aviable in Debian with  […]

Lire la suite

Plugin Notify for aMSN

Here is a new version of my plugin called Notify. Changelog : I was using wrong aMSN's preferences Fixed when the header is empty (setting "aMSN") This plugin replace aMSN's own notification system by using libnotify. It actually support : Display of your contact picture Uses of aMSN's  […]

Lire la suite

Developer toolbar for Internet Explorer

I'm currently making a website with a complicated design. I use to play with Firebug to controle layers placement, to trace unwanted margins and so many strange html behaviors. But ... Internet Explorer is a crappy piece of program ! If Firefox make some strange things, Internet Explorer is doing really what it wants.

So I tried to find out an equivalent of Firebug for Internet Explorer. I know that Firebug exists as a javascript script, but I didn't want to change my code just for that.

Lire la suite

Haut de page