X forwarding as root
Often is useful to run jconsole on a remote (production) machine. One basically has 2 options to do so. First, you can pierce your firewall and let your application listen to the appropriate JMX and...
View ArticleGetting size of a file in shell script
This is really too silly. There seems to be no consistent way to get the size of a file (in bytes) on multiple platforms. Here is a solution that works in bash on Linux (tested under Debian and...
View ArticleIntroducing Sentries
I recently needed a friendly to use circuit breaker in a Scala program. What I found was okay, but not nearly good enough for high volume, highly concurrent applications. So I set out to make it...
View ArticleBreaking the Circuit Breaker
The circuit breaker is this wonderful pattern to protect your application against resources that fail slowly. The idea is that you stop trying to use a resource when it has too many failures. Regular...
View ArticleFixing code and binary incompatibilities for cross Scala version library...
Scala is a fantastic language that unfortunately has a tradition of having no binary compatibility between versions. The result is that library developers have to go through a lot of pain to release...
View ArticleFast directory transfer on Unix machines
Here is a little trick to transfer a big folder from one unix machine to another in 2 variations. In this variation netcat is in listen mode on the target (execute in the given order): on target> nc...
View ArticleAnnouncing Metrics-Scala 3.0.0
Metrics-scala 3.0.0 was just released and is available in Maven central. This is the first release against Metrics version 3.0.0, and the first release where the code is maintained by me instead of...
View ArticleInstalling thrift through homebrew
Currently thrift support in homebrew is broken; brew versions thrift returns nothing. Here is a list I got from a collegae: $ brew versions thrift 0.9.0 git checkout 3b8bb74...
View ArticleConfiguring Postfix/Dovecot for Microsoft Windows Live Mail
Personal mail gets no love from Microsoft. The last 10 year I have not seen their product change a lot. Notable I see name changes (always a bad sign) and some visual changes. The actual implementation...
View ArticleInstalling gnutar on Maverick
Unfortunately Apple decided to remove /usr/bin/gnutar from Maverick (Mac OSX 10.9). This is a pain because most of the tarring I do on my mac is to transfer the file to a GNU based linux (e.g....
View Article5 problems in an hour
@svpino posted a nice chalenge: solve 5 problems within an hour or denounce your title of software engineer. It took me 40 minutes, of which 10 minutes was fighting around a limitation of the scala...
View ArticleGenerate a certificate signing request (CSR) as a 1 liner
As I run my own (secure) web and mail server I frequently have to get certificates. You could run with a selfsigned certificate, but that is not ideal; desktop browsers are very noisy about them, and...
View ArticleDon’t call your state ‘state’
In the OO world you are frowned upon if you call something object. Its time to extend this principle: don’t call your state state. This post is about why this is a bad idea and what you can do about...
View ArticleExploring Rkt on Ubuntu
I have been using docker in my home server since 0.4 in 2013. For me the most attractive property of docker is that it provides a way to decrease the amount of stuff one has to install on a server. I...
View ArticleBash history backup
I like my bash history, and I proudly have this in my .bash_profile: # Increase bash history size, append instead of overwrite history on exit export HISTSIZE=10000000 export HISTCONTROL=erasedups...
View ArticleContinuation parsers and encoders
I finally got around to writing about my hack project of last year. It was an exploration of what can be done with continuation parsers and encoders in order to implement a very fast single-copy...
View ArticlePush Gauges
A colleague was complaining to me that Micrometer gauges didn't work the way he expected. This led to some interesting work. What is a gauge? In science a gauge is a device for making measurements. In...
View ArticleAkka-http graceful shutdown
Why? By default, when you restart a service, the old instance is simply killed. This means that all current requests are aborted; the caller will be left with a read timeout. We can do better! What? A...
View ArticleTraefik v2 enable HSTS, Docker and nextcloud
This took me days to figure out how to configure Traefik v2. Here it is for posterity. This is a docker-compose.yaml fragment to append to a service section: labels: - "traefik.enable=true" -...
View ArticleAvoiding Scala's Option.fold
Scala's Option.fold is a bit nasty to use sometimes because type inference is not always great. Here is a stupid toy example: val someValue: Option[String] = ??? val processed =...
View Article