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]

Using ad hoc Docker volumes on SELinux systems

I’ve recently tried running some quick Docker commands using host’s directory as a volume: docker run -i -t -v `pwd`:/mnt debian:jessie bash -c "ls -hal /mnt" ls: cannot open directory /mnt: Permission denied I use Fedora as my main OS, which, it turns out, has some pretty nice SELinux settings. These deny access from inside the container to the outside. Said Fedora consists mostly of almost-newest-but-stable everything though, which makes Docker to be in a fairly recent version. [Read More]

RustFest - organization was the best. Also rhymes.

I went to RustFest and it was amazing ! It was clearly the best conference organizational-wise I’ve been to so far. It made me think of what I really liked there. What made it so awesome and welcomy ? To me this was a large number of small things just coming together. I listing them here for me to remember and for others to use. Let’s make conferences at least this friendly, together ! [Read More]

The best terminal emulator for Windows 10's Bash or how to run X applications

update as of 03/2017 As this article is by far the most popular on my site right now I feel that an update is necessary, as the landscape evolved a bit since the original publish date. Conemu started to support Bash on Windows properly now and this is what I settled on in the end. The article below is still relevant for the running X applications on Windows part though. [Read More]

Don't throw away. Fix.

Try fixing your things. It’s already broken - no need to sweat. You might learn something. Level 2 - push for things to be easily fixable. It’s good for you. It’s good for the planet.