Posts published by: Zack Marvel

Shutting down my Git server

I've been hosting a public Gitea instance for a few years now for personal projects. For now, I've decided to shut it down and move my public projects to Github.

I'm turning it down because I don't feel the maintenance is worth my time. I set up a public Git …

Using plus in regex with sed

I was trying to remove trailing whitespace from some files with sed:

sed -i 's/[[:space:]]+$//g' some_file.py

But this left the file unmodified! For some reason, the pattern wasn't matching. I took a look at the man page and noticed the -E flag:

use extended regular expressions in …

Debian: Installing docker broke my bridge interface!

These are partly notes for myself, but I'll publish it in case it helps someone.

After installing Docker, I could no longer reach my VMs from outside the VM host (where I also wanted to run Docker).

My network configuration looks something like this:

...
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP …

SQLAlchemy `order_by` gotcha

Today I encountered a surprising SQLAlchemy gotcha. In short, if you have a Query object and call its order_by method on the same column more than once, the first ORDER BY is not superseded. Here's an illustrative example. I'll include the boilerplate code (schema, etc.) at the end of the …

Read-only root filesystem on a Debian Buster system

First, a little background

I was hoping to set up a read-only SD card with a ram-based filesystem on a Raspberry Pi. They're kind of notorious for becoming unbootable, and understandably so, after the power's been pulled a few times. I decided to play around on a Debian 10 VM …

Debugging initramfs-tools scripts on Debian

I was having a hard time trying to wrap my head around how initramfs-tools works. Basically, this is the infrastructure that a Debian system typically uses to generate the initramfs, the inital in-memory, read-only filesystem used while the Linux kernel is booting (after the bootloader, but before most of the …

Curried chickpeas recipe

I've made some approximation of this recipe a couple of times and have been happy with how it turned out.

The recipe itself is meant to serve as a loose guideline--you could substitute a lot of the ingredients and it would turn out fine. For example:

  • Olive oil instead of …

Dynamically generating SQLAlchemy tables

Background

Here's the background: I had some structured data that I wanted to log to a database. That took the form of Python classes something like this:

class Message:
    code = 0x00
    endianness = '!'
    payload_format = {
        'device_address': 'L',
        'packet_id': 'L',
        'length': 'L',
        'enable': 'L',
    }

    def __init__(self, **kwargs):
        self.fields = kwargs

I wrote …