-
TDD : state-based testings VS behavior-base testing
Using TDD to write my code I’m still trying to find when I should use mock objects or just test against the whole cluster of objects. That’s the difference between state-based testing (no mocks) and behavior-based testing (using mocks) explained in this brilliant article by Martin…
-
TDD, red-green-refactor : red as important as green
When I got started with TDD, I tended to often forget the first step : red At first, it can seem silly to try to run a test when you did not write the matching functional code. You may think "Of course, it is going to be red ! There’s…
-
Unusual Git usage : temporary commit into a local SVN checkout
I really love Git, the distributed source code management designed by Linus Torvald. It is VERY easy to setup a new local repository (just type git init in the root of your working directory). I do it all the time, even for a simple bash script creation. Even for the…
-
JAgraffe : quickly send your pictures by email
I had coded JAgraffe two years ago for my own use. I still use it almost on a weekly basis.…
-
Usual GnuPG commands
I tend to forget these very usual GnGPG commands as I use them only once in while. Now I won’t forget them, or at least I’ll known how to quickly find them : Sign a file : gpg --detach-sign --armor myfile.tar.gz Encrypt and decrypt a file…
-
Mix RJ45 and coaxial (10Base-2) ethernet cables
Problem : how do you add a WIFI AP (Access Point) to an already existing network wired with 10Base-2 coaxial ethernet cables ? Of course this is an old network with old PC, and you can not replace the 10Base-2 network adapters of the PC in order to rewire with RJ45 cables.…
-
Simple iptable gateway script
It’s the second time I must setup a Linux gateway connected to a DSL line. The DSL modem interface is ppp0 and the LAN interface is eth0. Here is the script I use to setup the iptables : echo "1" > /proc/sys/net/ipv4/ip_forward modprobe ip_…
-
Sort JPG images by EXIF date in Ruby
Everybody now has a digital camera, and, during special events everybody takes plenty of pictures, and you end up with all these JPG images from different cameras. Each set of pictures tells the same story from the beginning, so it would be great to be able to reinterleave all of…
-
Linux and Logitech MX mouses resolution
Without its real driver, my Logitech MX 510 mouse is seen by Linux as a 400 cpi resolution mouse. Actually it can be used in 800 cpi thanks to lmctl I’ve added this script to the 'Startup Program' list of Gnome : #!/bin/sh lmctl -8 xmodmap -e "pointer…
-
An other Nautilus script : create directory with date
I’ve already described how to add custom scripts for Gnome file manager, Nautilus. So here is a an other simple script : it allows to create a directory with the name prefixed by the current date, via the contextual menu (right click) of Nautilus in the window of an…