Apache: Conditional Rewrite

The problem: apply Apache's LogFormat conditionally. Basically, I wanted apache to log the request only if it contains an auth_token or Authorization header. Basic solution: LogFormat "{ \"timestamp\": \"%t\", \"client\": \"%a\", \"auth_token\" : \"%{auth_token}i\", \"authorization\" : \"%{Authorization}i\", \"method\" : \"%m\", \"status\" : \"%s\", \"url\" : \"%U\", \"inputsize\" : \"%I\", \"outputsize\" : \"%O\" }" json…

Read this article

HTML5 Multiplayer with Phaser and Go

In this articale I'll show you how to build a simple HTML game with Phaser and implement a basic multiplayer infrastructure with Websockets. TL;DR just give me the code: https://github.com/Shoen/phasermultiplayerdemo Live demo: http://game.haanto.com/ The backend In short: When a player connects we…

Read this article

Kaizen: Express Logging

Just published Kaizen, an express logging middleware. Some features: stores log information in a persistence layer of your choice pretty prints colored and structutred output implements base16 color schemes and allows to create custom ones plug-in system to create your own DB adapters Reason? I was just tired with the…

Read this article

Go: sessions and static content

I got used to web frameworks like Sinatra or Express which offer a lot of helper methods/functions to solve most trivial things. With Go it's a little bit different, there are some great tools out there like gorilla but a Go beginner like me needs some time to change…

Read this article

Client-side File Encryption

The following is a proof of concept which demonstrates how to encrypt any file (even binary), with your browser only. From a security point of view, javascript encryption is probably not the best solution but exploring the FileReader/FileSystem API and TypedArrays was an interesting topic to me so I…

Read this article

Sinatra deployment with Docker

After playing for a while with Docker I wrote a Dockerfile which builds a container for sinatra app deployment: …

Read this article