TheBrainVault


serverless docker


Serverless Docker… or stream processing with docker using golang.At dockercon I saw a ‘cool hack’ they called server-less docker. Basically the idea is to use containers as functions in programs instead of using containers as servers. This brings back the concept of cgi. Further on the idea o...

apt-cacher-ng docker builds


apt-cacher-ng with docker buildsWorking with docker on a laptop testing configuration of containers has some of the same annoyances as working with other configuration managment tools and testing frameworks like test-kitchen, chef, ansible etc… It takes forever to download dependencies. I might...

Docker hacks


Docker HacksWhen you need to restart the docker daemon and want to resume currently running containers.1234docker ps |tail -n +2 > /docker.runningcat /docker.runningservice docker restartdocker start $(awk '{print $1}' /docker.running)

BASH tricks


Just a bunch of bash tricks i’ve picked up.Save a backup copy of a file with a datestamp. 1cp script.sh script.sh.$(date +%Y%m%d%H%M) Generate a random string maybe for api key or password. 1cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 Find empty directories. 1fin...

Notes on cloudflare api and Jq


Notes on cloudflare api and JqJq is a great tool Link . It makes working with json from rest api’s much easier and easier to read. See the examples page for more info but here is a short one. Prerequisites for examples setup a cloudflare api token install jq brew install jq if your on osx. 1234c...

Ansible to interact with a rest API


Ansible to interact with a rest APISometimes you may want to interact with a rest api where an Ansible module doesn’t already exist. For those cases you may want to try using the uri module. Ansible already supports interacting with json so its pretty easy. Below I show an example of interacti...

Directory usage tricks


Tricks for finding directory space usage.This is an example of using find and awk to get the total space used for files matching a pattern. 1find . -iname "*regex" -printf "%s\n" | awk '{f+=$1}END{print f/(1024 *1024 * 1024),"GB"}' 1find . -iname "*.regex" -printf "%s\n" | awk...

smp affinity makes a difference


A good Driver.Having a driver that uses the proper interrupt handling makes a difference in high bandwidth pci devices like RAID cards and Infiniband. For example having the stock 2.6.32-220 megasas driver only makes use of one interrupt. This was the stock driver in the centos 2.6.32-220 kernel ...

Infiniband performance tuning


I don’t currently have access to the original hardware I used so most of this is off memory and some notes I made.Also I’ll present the caveat and warning that all these things I tested not with a view to stability for a production environment but this allowed me to get an Idea of what things I c...