1. Recent releases of Raspbian have adopted the use of dhcpcd to manage both dynamic and static interface configuration. If you would prefer to use the traditional /etc/network/interfaces mechanism instead, follow these steps. First, disable dhcpcd and wpa_supplicant. systemctl disable --now dhdpcd wpa_supplicant You will need a wpa_supplicant configuration for wlan0 in /etc/wpa_supplicant/wpa_supplicant-wlan0.conf. If you already have an appropriate configuration in /etc/wpa_supplicant/wpa_supplicant.conf, you can just symlink the file: cd /etc/wpa_supplicant ln -s wpa_supplicant.

    (Read more...)

  2. CircuitPython is “an education friendly open source derivative of MicroPython”. MicroPython is a port of Python to microcontroller environments; it can run on boards with very few resources such as the ESP8266. I’ve recently started experimenting with CircuitPython on a Wemos D1 mini, which is a small form-factor ESP8266 board. I had previously been using Mike Causer’s micropython-tm1637 for MicroPython to drive a 4 digit LED display. I was hoping to get the same code working under CircuitPython, but when I tried to build an image that included the tm1637 module I ran into:

    (Read more...)

  3. The DS18B20 is a popular temperature sensor that uses the 1-Wire protocol for communication. Recent versions of the Linux kernel include a kernel driver for this protocol, making it relatively convenient to connect one or more of these devices to a Raspberry Pi or similar device. 1-Wire devices can be daisy chained, so it is possible to connect several devices to your Pi using only a single GPIO pin, and you’ll find many articles out there that describe how to do so.

    (Read more...)

  4. A question that crops up regularly on #docker is “How do I attach a container directly to my local network?” One possible answer to that question is the macvlan network type, which lets you create “clones” of a physical interface on your host and use that to attach containers directly to your local network. For the most part it works great, but it does come with some minor caveats and limitations.

    (Read more...)

  5. On IRC – and other online communities – it is common to use a “pastebin” service to share snippets of code, logs, and other material, rather than pasting them directly into a conversation. These services will typically return a URL that you can share with others so that they can see the content in their browser. One of my favorite pastebin services is termbin.com, because it works from the command line using tools you probably already have installed.

    (Read more...)

  6. In this article, we’re going to ask Gnocchi (the OpenStack telemetry storage service) how much memory was used, on average, over the course of each day by each project in an OpenStack environment. Environment I’m working with an OpenStack “Pike” deployment, which means I have Gnocchi 4.0.x. More recent versions of Gnocchi (4.1.x and later) have a new aggregation API called dynamic aggregates, but that isn’t available in 4.0.x so in this article we’ll be using the legacy /v1/aggregations API.

    (Read more...)

  7. You can list iptables rules with rule numbers using the --line-numbers option, but this only works in list (-L) mode. I find it much more convenient to view rules using the output from iptables -S or iptables-save. You can augment the output from these commands with rule numbers with the following awk script: #!/bin/awk -f state == 0 && /^-A/ {state=1; chain=$2; counter=1; printf "\n"} state == 1 && $2 !

    (Read more...)

  8. I’ve just refreshed the version of Pelican used to generate this blog, along with the associated themes and plugins. It all seems to be working, but if you spot a problem feel free to drop me a line.

    (Read more...)

  9. I find myself working with Raspbian disk images fairly often. A typical workflow is: Download the disk image. Mount the filesystem somewhere to check something. Make some changes or install packages just to check something else. Crap I’ve made changes. …at which point I need to fetch a new copy of the image next time I want to start fresh. Sure, I could just make a copy of the image and work from there, but what fun is that?

    (Read more...)

  10. The other day on #ansible, someone was looking for a way to safely shut down a Nova server, wait for it to stop, and then start it up again using the openstack cli. The first part seemed easy: - hosts: myserver tasks: - name: shut down the server command: poweroff become: true …but that will actually fail with the following result: TASK [shut down server] ************************************* fatal: [myserver]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to 10.

    (Read more...)