Jump Bike invasion in Montreal and why Uber sucks

As Uber’s Jump electric bike offering arrives in Montreal, a very common sight starts appearing: Orange Jump bikes parked everywhere: in parks, on sidewalks, tied to private property or public structures, sometimes blocking the way for pedestrians. Uber’s permit stipulates that bikes have to be parked in designated spots only; a “designated spot” is a […]

KVM bridged to the LAN with DHCP

The goal here is to instantiate VMs with a br0 interface grabbing an IP from the LAN DHCP, so in turn the VM can instantiate LXD containers whose IP is also exposed to the LAN. That way everything is visible on the same network segment and this makes some experimentation easier. Host configuration Some info […]

Weechat trigger sounds based on specific keywords

Weechat used to require some weird perl scripts to trigger on specific conditions, but since version 1.1 (from 2014) a trigger plugin can do all that without needing an external script. This will create a trigger that runs a command when a specific word (or words) is mentioned in any channel you’re on: /trigger addreplace […]

Vegan picadillo

Picadillo is a traditional Mexican recipe, usually made with minced meat.  Seitan, however, makes a great substitute for minced meat, and since most of picadillo’s flavor comes from the sauce and reduction process, the flavor stays mostly similar. Ingredients Half a kg of Seitan (here’s the best recipe we’ve found – can be made well […]

How to configure e-mail alerts with Munin

I had a hell of a time configuring Munin to send out e-mail alerts if values surpass specific thresholds. Many of the articles I found focused just on setting up the email command (which was the easy part), while few told me *how* to configure the per-service thresholds. Once the thresholds are configured, you’ll see […]

Easy mounting of host directories in lxc container.

This can be done manually as explained here. But I wanted to do this on one fell swoop, so this command worked: echo “lxc.mount.entry = /src/path/i/wanted/to/share  /var/lib/lxc/container-name/rootfs/mnt none bind 0 0” | sudo tee -a /var/lib/lxc/container-name/config If done frequently, a function may be useful. I’m too lazy to write that now but I’ll add it […]

Proxying Python file-like objects for fun and profit

As part of a project I’m working on, I wanted to be able to do some “side processing” while writing to a file-like object. The processing is basically checksumming on-the-fly. I’m essentially doing something like: source = get_a_readable_file_like_object() destination = get_a_writable_file_like_object() destination.write(source.read()) what I’d like is to be able to also get the data read […]

Speeding up local debian builds with sbuild (eatmydata, apt-cacher-ng and config laziness)

As part of the team that maintains several testing tools for Ubuntu, including checkbox, I sometimes find myself needing to build .deb packages from our source tree. A simple way of achieving this is of course to run dpkg-buildpackage or even bzr-buildpackage. Assuming all build-deps are correctly installed in the host system, this will result […]

Recording terminal sessions – script and friends

Most of us have wanted, at some time or another, to share an entire “session” on the terminal. I mean showing a log of the commands we typed, their output, and so on, to illustrate a procedure or clarify a concept. The “script” command has long been a tool of choice for this. To use […]

Ubuntu – Automating virtual machine installation using network preseeds

Virtual machines are very useful for testing. I often use them to verify changes to software, without messing up the local environment. Due to laziness I use VirtualBox and install Ubuntu official ISOs on them, rather than something more elegant/complicated such as kvm, lxc containers or chroots. This replicates an actual desktop environment pretty closely […]

Video conversion for iPhone with avconv

avconv replaces the venerable ffmpeg. It can be used to convert videos for the iPhone quite easily. apt-get install avconv libavcodec-extra-53 libx264-123 x264 then run this script: avconv -i input-file.mp4 \     -vcodec libx264 -vprofile high \     -t 30 \ -preset slow \     -b:v 1000k -maxrate 1000k \     -bufsize 2000k -vf scale=1136:474 […]