Bundle is a tap (aka extension) to run several Homebrew commands in one go. The list of commands is read from a plain-text Brewfile. In contrast to Ansible’s Homebrew module with a manually maintained items list, a Brewfile can be created from the currently installed Homebrew packages, making it a better fit for some use cases. This article gives a short introduction to Homebrew Bundle and shows how to use it from Ansible.
Pandoc - the swiss army knife of document conversion - supports syntax highlighting out of the box. But I prefer Github’s way of syntax highlighting, and even that can be included in Pandoc.
Logstash is famous for being the L in ELK. It is a log processing tool that tries to make sense out of mostly unstructured log messages by given parsing rules. This article descibes how I develop and test Logstash rules on my local machine, before applying them to production environment.
Common test data can be shared either by putting it into helper classes or in a common test base class. But there’s a third way. Spock has full support for
Traits and this post will explain how to use it.
Custom Hamcrest Matchers help quite a bit in simplifying unit tests and they are fairly easy to implement. The interface contains only 3 methods, 2 of them to create a textual description of expected and actual parameters and one do perform the verification. Implementing an interface is not difficult at all, but a lot of boilerplate code is required just to make that happen. I wanted to see how much this can be simplified using Groovy and the answer is quite a lot.
Running nginx from Docker is a piece of cake and hosting local files are equally easy. But there’s one catch if you’re using boot2docker, at least on a Mac: live updates are not working. Changes on local files are not reflected in nginx immediately, but a container restart is required. This post describes how to work around this limitation.
This post shows how to do integration testing of a ReST service as part of Gradle build process, using Spock to implement the test and Docker to make required database available. It’s build upon the example project described in my previous blog post.
This post shows how to build a very simple ReST service secured by basic authentication. It is backed by MongoDB and uses Spring Data for database access.
This article explains how to do web-crawling with Apache Camel’s Groovy DSL and jQuery-like selectors from jSoup library.
To have a simple quickstart in future private projects, I created a small project template. With just 3 files, you get a Spring container with Hibernate connected to an in memory database and slf4j/logback for logging. Spring and Hibernate are configured to support annotations and you can overwrite setting by providing an optional property file. Gradle takes care of dependencies.
At everyday scripting, you often need to access sensible information like passwords. A common practice is to just write them plain text into your script, but at least on a Mac, we can do better.
Recently, I wanted to create an “intelligent” binary patcher, which not only replaces some chunk of binary data at a file’s predefined offset, but instead performs search and replace. Here is the Java class I came up with.
With Groovy, it’s very easy to parse XML data and extract arbitrary information. This works great as long as the input data is well-formed, but you can’t always guarantee that in real-world scenarios. Think of extracting data from HTML pages. They are very often a mess when it comes to XML validity and that’s where the TagSoup library comes to the rescue.