2008-02-18-EncryptKeys

Encrypt your /home partition using LVM+LUKS

This page will explain how to encrypt your /home folder using a dedicated partition with LVM and LUKS.
All these operations apply to a Ubuntu/Debian system. And we suppose that the partition reserved to our /home folder is /dev/sda6, in order to clarify he process.

Let’s go.

Simplified version of my PHP test runner

In my course of getting continuous testing in practice I have improved my test runner by using less dependencies.

Previously I have implemented this by using Ruby and its Watchr gem, but now this script only relies on inotifywait binary available in major distributions.

As usual this script helps you to track your code for changes and if changed it will automatically run a bunch of actions.

We all tend to assume that other people think like us. But they don’t. Psychologists call this the false consensus bias

Giles Colborne in “97 things every programmer should know”

Speed up PHP linting with xargs

Most of us use Jenkins to continuously integrate our projects with every commit to the repository, but when it comes with PHP most of the time is spent “linting“.

This action is badly slow and if your project has a lot of files this will take a good percentage of your build time. A really good approach could be executing this task with different files in parallel. For this you can use the powerful xargs command with -P0, which allows xargs to run as many processes as possible at a time.

find codefolder/ -name "*.php" -print0 | xargs -0 -n1 -P0 php -l

So the final snippet for your Ant based project will be:

<target name="lint">
  <exec executable="sh" failonerror="true">
      <arg value="-c" />
      <arg value="find ${project.paths.php.space-separated} -name *.php -print0 | xargs -0 -n1 -P0 php -l"/>
  </exec>
</target>

Page 1 of 28