sui generis, linux, python, devops, robotics, polyamory, data custodian

The Zen of Python

2015-12-13 code ubergarm

Just noticed The Zen of Python today and found it amusing. A quick “one liner” for the easter egg.

import this
''.join([this.d[ch] if ch in this.d.keys() else ch for ch in this.s])

But who knows, I’m not a BDFL nor even Dutch. ;)

Cross Platform ARM w/ Docker and quemu

2015-12-12 devops ubergarm
The goal is to automate building armhf (armv7) compatible Docker images. These images can be used for dev, build, test, and deploy to ensure a consistent user experience. The most common development, cloud, and build machines currently run x86-64 architecture hardware. This complicates working on software targeted at embedded arm platforms. With modern kernels that support binfmt misc and the right combination of qemu-XXX-static binary one can run arbitrary format Docker images on arbitrary host hardware. Continue reading

Cross Platform ODROID ARM Docker quemu

2015-12-12 devops ubergarm
Overview In this post I document how to boot an ODROID ARM image from a x86 machine running qemu-system-arm from inside a Docker container. After this experience, I’m leaning towards a solution that uses binfmt_misc on the host and qemu-arm-static to run ARM docker images as opposed to emulating a whole specific system. Check out docker-arm-circleci UPDATE: I just put together an updated system based on the binfmt_misc solution. Check it out here: ubergarm/qemu Continue reading

Nginx Reverse Proxy

2015-12-12 devops ubergarm
There’s more than one way to configure a server: some are complex, some simple, some static, and some dynamic. I’ve definitely become a fan of using nginx to reverse proxy Docker containers to a specified subdomain e.g. container.yourdomain.com. I spent a lot of time in the past tweaking nginx rewrite rules to give a dynamic feel while keeping the simplicity of a static config file. I recently discovered jwilder’s versitile docker-gen which listens on the Docker sock and updates config files based on the Go text/template language. Continue reading

Visualizing python dataframes in jupyter notebook with Altair

2015-12-12 data science ubergarm
Finally, an easy way to turn Pandas DataFrames into sorted bar charts using brewer color schemes! It took a little playing around and it isn’t quite perfect yet, but here is a quick example of how to turn a Series or DataFrame into a lovely sorted stacked bar chart. References altair palettable jupyter notebook Run Jupyter Container Running as root allows you to !pip install or !apt-get install dependencies. Continue reading
Older posts Newer posts