I’m running Rust pair programming sessions !

Why ? Rust has such a wonderful community and I want to give back as much as I can. I am not an expert in Rust but I am not a beginner either. In addition to that I love pair programming ! The result is always much better than I could produce myself. I am happy to both share the knowledge and learn. I would love to pair with you ! [Read More]

Configure AWS Elastic Beanstalk Docker environment variables

AWS Beanstalk is a good ‘intermediate’ level hosting for Docker containers. It gives you load balancing and scalability pretty much out of the box in exchange for being a bit more opaque to configure. The Docker bits are a bit more hidden away there. In a typical production setup you would want to have Docker images not containing anything environment related, e.g. to be able to run them both in production and locally. [Read More]

Waiting for AWS Elastic Beanstalk environment to become ready

Elastic Beanstalk on AWS seems to be one of those services that are pretty cool but it’s hard to get to know them. One of the tasks you may encounter while working with it is that after making some change to its configuration you would like to wait for it to be finished before proceeding further. The change may be setting an environment variable but can also be deploying a new version of the application. [Read More]

Setting up Rust development environment using VSCode on a Mac

Completion and highlighting While on Linux VSCode with the Rust plugin seems to work more or less out of the box, on a Mac I needed to spend some time configuring it. First things first though, let’s start by installing Rust version manager, rustup. curl https://sh.rustup.rs -sSf | sh We will be using nightly version of rust as to have one version that can compile all of our tools. This is mostly due to clippy requiring a nightly compiler. [Read More]

Adding graphs to posts in Nikola

Update as of April 2019 This blog no longer runs on Nikola so the embedded examples do not work anymore. The method described in the post is still valid though. I really like to teach, try to explain things in a simple manner. There is often no better way of making an explanation than visualizing it. The problem is that I really can’t draw, especially on a computer. Wouldn’t it be awesome if I could make the computer draw for me ? [Read More]

Upload your site to Netlify using their incremental deployment API

I’ve recently switched to a setup where I do all my builds for this blog on Travis. While doing so I needed to migrate away from using Netlify’s internal build infrastructure. This resulted in a quick python script that allows you to upload arbitrary directory tree to Netlify and does so using their incremental deployment API. All that means that while this site is quite big in size the deployments go rather quickly ! [Read More]

Running host programs in isolation inside one-off Docker containers

I am quite bad at remembering how to launch docker to have everything set up correctly. Hence the following - a script that launches any commandline specified in its arguments inside a new docker container. Current directory is mounted inside the container automatically, so the thing you are executing can have its local dependencies satisfied. #!/bin/bash USERNAME=`whoami` MOUNT_PATH="/mnt" CURRENT_DIRECTORY=`pwd -P` # untangle symbolic links if needed - SELinux needs the real path IMAGE="debian:jessie" if [[ -z $1 ]]; then echo "usage: `basename $0` command_to_run_inside_a_container" exit 1 fi RESOLVED_ARGUMENTS="$@" docker run -i -t -v "$CURRENT_DIRECTORY":"$MOUNT_PATH":Z $IMAGE bash -c "useradd -M -d '$MOUNT_PATH' $USERNAME&& cd '$MOUNT_PATH' && bash -c '$RESOLVED_ARGUMENTS'" # restore SELinux context for the current directory restorecon_path=`which restorecon` if [[ -x "$restorecon_path" ]]; then restorecon -R "$CURRENT_DIRECTORY" fi I use vanilla Debian Jessie as a run platform there, mostly because this is what most of my servers run. [Read More]