Install Gearman from source on Ubuntu 18.04

I tried to install Gearman on my Ubuntu 18.04 Docker container and encountered a lot of issues.

This write-up is to save you some valuable time of your life.


apt update
apt install -y g++ uuid-dev gperf libboost-all-dev libevent-dev curl 

cd /tmp
curl -LO
tar xvzf gearmand-1.1.18.tar.gz
cd gearmand-1.1.18
./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu
make test
make install

# Start gearman in the background
gearmand --log-file /var/log/gearmand.log --daemon

To get there, I encountered the following issues:

configure: error: Unable to find libevent

./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu
checking test for a working libevent... no
configure: error: Unable to find libevent

Fix: apt install -y libevent-dev

configure: error: Could not find a version of the library!

./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu
checking whether the Boost::Program_Options library is available... yes
configure: error: Could not find a version of the library!

Fix: apt install -y libboost-all-dev

Installing the PHP client libraries for Gearman

If you intend to use PHP to talk to your Gearman service, use the following to get the libraries installed.

Note: you might not need the last line. This is to enable the Gearman PHP extension in Docker.

cd /tmp \
  && wget\
  && tar xvzf gearman-2.0.6.tar.gz \
  && mv pecl-gearman-gearman-2.0.6 pecl-gearman \
  && cd pecl-gearman \
  && phpize \
  && ./configure \
  && make -j$(nproc) \
  && make install \
  && cd / \
  && rm /tmp/gearman-2.0.6.tar.gz \
  && rm -r /tmp/pecl-gearman \
  && docker-php-ext-enable gearman

Bash: use colored text in script

I often use these handy helperfunction to write colored text in my scripts.

# Bash text-colors
NC='\033[0m' # No Color

function echoRed() {
  printf "${RED}${TEXT}${NC}\n"

function echoGreen() {
  printf "${GREEN}${TEXT}${NC}\n"

echoGreen "This text is green"
echoRed "This text is red"
echo "This is regular text"

XPATH: search element by text

When I write selenium/kantu end-to-end test I often need to use xpath to find certain elements.
And while it’s definitely not the fastest, searching elements by the text in it, is easy and fast to use. It’s also more descriptive to an untrained eye.

I often refer to this post on StackOverflow which has it written down quite neatly:

It basically comes down to this:

Literal match (= must match exactly and completely):


This matches: elements containing (just) the text ‘match’ and a button with (just) the text ‘Save’

Do you need to strip whitespace from texts in elements before you do the matching, then use this:


Partly matching:

If it’s ok to be not so strict, use this more loosely matching:


This matches texts like: ‘this match comes up‘ and ‘matches this’

If your text must match with words beginning with the text or lines starting or ending with that text, use this xpath 2.0 expression:


PRO-tip: use the inspector to test your xpath.

open the inspector and search (<C-f> or <Command+F>)

Gulp error: Did you forget to signal async completion?

First of all: do check the Gulp documentation on this:

I had the following gulpfile.js:

# file gulpfile.js
function build() {
    return series(
} = build;

When running gulp build I got the following errors:

$ gulp build
[11:17:33] Using gulpfile ./gulpfile.js
[11:17:46] The following tasks did not complete: build
[11:17:46] Did you forget to signal async completion?


I fixed it by making the build() function async: async build().
Then my gulpfile.js looked like the following (note the extra parentheses at the end!)

# file gulpfile.js
async function build() {
    return series(
} = build;

Dataverlies voorkomen in Google Analytics

Wist je dat filters in Google Analytics destructieve features zijn? Dat wil zeggen, als je filter meer filtert dan je zou willen, dan ben je die data kwijt. Dat kun je voorkomen door meerdere views te maken in Google Analytics.

Want je wilt geen data kwijt zijn.

Zorg er daarom voor dat je altijd een view hebt zonder filters. Want filters zijn gekoppeld aan een view. Heb je geen filters op je view, dan wordt netjes _alle_ data bewaard.

Continue reading

Automatisch bestanden verwerken en mailen met Hazel

Als ik een factuur binnenkrijg, wil ik dat deze netjes gearchiveerd wordt in de juiste directory én dat de factuur verstuurd wordt naar het speciale e-mailadres van mijn boekhouding zodat hij daar verwerkt kan worden.

Om dat handmatig te doen ben je niet lang bezig en het is ook niet moeilijk Maar het wordt wél vervelend om het steeds maar weer opnieuw te doen. Steeds weer dezelfde handelingen. Continue reading

1 2 3 5