Visualising your source code with gource…

This is the settings that worked for me when running gource

xvfb-run -a -s “-screen 0 1280x720x24” gource -s 0.4 -p 0.01 -1280×720  –auto-skip-seconds .4 –multi-sampling –stop-at-end –highlight-users –hide mouse,progress,filenames,dirnames –file-idle-time 0 –background-colour 111111 –font-size 20 –title “Omlet Lib 4_1” –output-ppm-stream – –output-framerate 60 | avconv -y -r 60 -f image2pipe -vcodec ppm -i – -b 8192K movie.mp4

How to remove exif metadata from jpegs using php or command line

There is a method of hacking php using a security flaw in php in how it handles exif meta data embedded in jpeg, png or gif images. You describe this as an EXIF injection attack. As a precaution it is a good idea to strip all EXIF information from any images that are uploaded to your website.

I have found these two tools really useful to do this and this is a quick outline of how we used them:

Removing EXIF meta data from .jpg on Ubuntu / PHP
There is a really good tool called exiftool. There is a version in the Ubuntu repositories – so it is super easy to install.

apt-get install libimage-exiftool-perl

You can then strip exif meta from a jpeg using the command:

exiftool -all=  filename.jpg

So in php this would look like this:

$output = exec(sprintf("exiftool -all= %s", escapeshellarg($_image_path)));

Removing EXIF meta data from .png images on Ubuntu / PHP
The best tool for removing exif information from .pngs is Optipng. You can install optipng on Ubuntu from source using this recipe.

apt-get install optipng

and so again in php it would look something like this:

$output = exec(sprintf('optipng -strip all %s', escapeshellarg($_image_path)));

I hope this helps someone.

How to install optipng on Ubuntu from source

Optipng is in the Ubuntu repositories but is you want an up to date version then it can be worth installing Optipng from source. This is essentially a script but you can use the commands on there own if you want.

wget --quiet
tar xf optipng-0.7.3.tar.gz

cd /root/scripts/optipng-0.7.3
./configure > /dev/null 2>&1
make > /dev/null 2>&1

cp /root/scripts/optipng-0.7.3/src/optipng/optipng /usr/bin/
ln -s /usr/local/bin/optipng /usr/bin/optipng

rm /root/scripts/optipng-0.7.3.tar.gz
rm -rf /root/scripts/optipng-0.7.3