Leben++

It's never too late to get a life

Guarding Your Value Objects

When you apply the principle of Domain Driven Design (DDD) to your code, you start to notice all the small “rules” of the domain. Rules like “A name must not consist of whitespace, must have its whitespace trimmed on both ends and cannot be empty.” Or “A donation amount must be greater than zero.” Or “A book must have at least one page.” It’s important that you can’t create value objects that violate those rules.

Using Ansible to call REST APIs

In the Fundraising Team of Wikimedia Germany we maintain our own infrastructure, using the principle of Infrastructure as Code: We write every configuration change, every installed package, every other server setup tweak as a text file that we check into our version control system and do a peer-review on. This way, we can replicate our setups, share knowledge and track changes and their context. While setting up a Graylog instance we discovered that its configuration file does not contain all the information.

Working with PHP dependencies in multiple repositories

Imagine yourself working on a PHP code base distributed between two or more Git repositories, for example a library and an application part. Ideally, the two repositories should be independent, but sometimes that lofty goal can’t be achieved. And having two repositories open in your editor and doing git commit, git push, composer update all the time becomes tedious. This article shows how to work faster with two dependent PHP code bases.

Migration from Spress to Hugo

History and Motivation The list of static site generators is very long, but which one should you choose? When I ported this blog from Drupal to static HTML, I chose Spress, written in PHP, because PHP was my main programming language, its code looked well-thought-out, relied on established libraries and did everything I wanted out of the box and with a minimum amount of configuration. However, during the last year there was only one minor release of Spress and I missed some features I saw in other projects:

How to run npm install as non-root from a Docker container

Suppose you don’t want to install Node.js and npm on your local machine and already run your application in a Docker container. How do you install your dependencies from package.json? For deployment, the most common way is to create your own Docker image, where npm install is part of the Dockerfile. But what do you do on your development machine, where you don’t want to build a new image all the time and use the vanilla node image ?

Ideas and takeaways from DDD Europe 2018

Keynote by David Snowden An inspiring talk about complexity and modeling, using the Cynefin framework to understand the nature of your domain (Complex/Complicated/Simple/Chaotic) and how to model and measure success according to that nature. What stood out to me was the idea that complex domains - like ecosystems, financial markets, large organizations or even “society” itself - can’t be analyzed and fully understood like complicated domains. Thus, they can’t be “modeled”, since every abstraction will miss crucial behavior.

Error log analysis with jq

This is a step-by-step introduction into aggregating and analyzing errors from a JSON error log (where each error is a JSON object on a single line) with the tool jq. While most tutorials and documentation of jq focus on how to transform JSON objects to other JSON objects on a 1:1 basis, this tutorial is more about building aggregates, using an approach that takes a page out of functional programming.