WordPress Docker container

WordPress Docker container on hub.docker.com

I’m moving all my sites and applications to Docker containers.
The main reason is because it makes the maintenance easier when everything an application needs is included in a single container.
I can run everything on one server or split it up over multiple servers when I need more resources or HA.
I’m currently provisioning everything with Ansible, but I’m looking to solutions that are focused on container orchestration.


To containerize WordPress, I couldn’t find a container on hub.docker.com that fits my needs.
So I had to build my own with the following requirements in mind:


Connect a relay board to your Raspberry Pi

Raspberry Pi relay board

If you want to switch things like lights with your Raspberry Pi, you need a relay board.
A relay is an electronic switch that can be switched with a low-voltage signal.
Exactly what the Raspberry Pi offers as GPIO pins.

The relay board I’ve found is ideal for the Raspberry Pi.
It has 8 relays and every relay can separately be switched with the Raspberry Pi because it has 8 GPIO pins.
Also, the voltage needed to switch the relays is 5V, this can be taken directly from the RPi.
This is why you don’t need any additional electronics.


Quickly add a cachebuster to @import statements

This CLI one-liner searches for .css files with @import statements and adds a ‘cache busting’ query string to it.
You can use it to make sure the browser picks up the new CSS files when they are included with @import statements.


find . -iname *.css -exec sed -i -e 's/@import "(.*).css"/@import "1.css?cb=12345"/g' {} ;


Clipboard.ninja: A realtime clipboard

Clipboard.ninja - Realtime clipboard

I’ve started a new project to get more familiar with NodeJS and Websockets.
It’s an online clipboard that should make it very easy and fast to share some text between computers or mobile devices.
The only thing you need is the ID of the sender to connect.
After that, every text you type or paste will immediately appear on the receiving-side (ninja style! ;)).

It’s even possible to ‘broadcast’ text by connecting multiple receivers to the sender.


PHP 5.5.13 breaks backwards compatibility

There’s a backwards compatibility break in PHP 5.5.13 (and PHP 5.4.29) affecting PHPUnit, Mockery, Doctrine, Symfony and probably a lot more.
Rafael Dohms triggered me with this Tweet;

And I just ran into the issues with Mockery/PHPUnit;

Failed asserting that exception of type "PHPUnit_Framework_Error_Warning" matches expected exception "SymfonyComponentHttpKernelExceptionNotFoundHttpException". 
Message was: "Erroneous data format for unserializing 'Mockery_9_Symfony_Component_HttpFoundation_File_UploadedFile'".

I found the following sources that explain what happened:

I advise to not upgrade to PHP5.5.13 but wait for PHP5.5.14, it should be released soon.


Debugging Varnish requests with varnishncsa


Varnish provides some tools to help you monitor and debug Varnish’ health.
One of those tools is varnishncsa. When you run it without arguments, it shows a real-time access log in the Apache combined log format.
That’s nice and can come in handy. But, it gets really interesting when you define your own format like this:


Caching WordPress with Nginx

Wordpress caching configuration

I’m running this blog on a small VPS with the help of Nginx and PHP-FPM.
But I noticed the site was not that fast as I wanted it to be.
This is mainly due to the little resources this VPS has. So every request needs to be as efficient as possible.
To make that possible, I want to cache the requests with Nginx to minimize the requests that needs to be handled by PHP-FPM.


Plantronics C520 headset

Plantronics Blackwire C520

I’ve always been a fan of Sennheiser. I have a Sennheiser HD 218 because its on-ear and not too big.
But on my work, I’m constantly switching between a headphone and a headset for using Skype or Google Hangouts.
Time to find a headset that delivers the Sennheiser sound with a microphone for conferencing.

After an intense search I found the Plantronics C520.


Fix the brightness function keys on Ubuntu

Ubuntu brightness

If you’re running Ubuntu with discrete graphics on a Thinkpad T530, it’s most likely that the brightness function keys don’t work.
This happens when you’re using the proprietary Nvidia driver.

Luckily, this is easy to fix by adding one line to the /etc/X11/xorg.conf configuration.