When I was working on a generic port of Google's hashmap to C, I wrote a function that (ignoring irrelevant parts) looked like this:
typedef struct {
uint8_t *bytes;
size_t len;
} bytebuf;
# This script automatically handles Syncthing conflicts on text files by applying a | |
# git three-way merge between the previously synced version and each divergent version. | |
# It depends on the watchdog package and git. | |
# For automatic dependency installation when running with ´uv run --script deconflicter.py´: | |
# /// script | |
# requires-python = ">=3.10" | |
# dependencies = [ | |
# "watchdog", |
When I was working on a generic port of Google's hashmap to C, I wrote a function that (ignoring irrelevant parts) looked like this:
typedef struct {
uint8_t *bytes;
size_t len;
} bytebuf;
Chronological list of the "systemd for Administrators" series published on 0pointer.net/blog:
This Python script is not maintained and was replaced by the more robust Rust version below:
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
image: "rust:latest" | |
default: | |
before_script: | |
- rustc --version | |
- cargo --version | |
stages: | |
- test |
[Unit] | |
Description=Service that restarts my spread_goodness.service every two hours. | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/systemctl try-restart spread_goodness.service |
#!/bin/sh | |
qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm \ | |
-cpu host \ | |
-m 4G \ | |
-drive id=disk,file=/home/archie/Documents/Images/win10x64.img,if=none \ | |
-drive file=/home/archie/Downloads/Win10_1709_English_x64.iso,index=3,media=cdrom \ | |
-drive file=/home/archie/Downloads/drivers.iso,index=4,media=cdrom \ | |
-device intel-iommu \ | |
-device ich9-ahci,id=ahci \ | |
-device ide-drive,drive=disk,bus=ahci.0 \ |
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect | |
# jeroen@massar.ch - http://jeroen.massar.ch | |
server { | |
listen 192.0.1.1:80; | |
listen [2001:db8::1]:80; | |
# Redirect all non-HTTPS traffic to the HTTPS variant | |
return 301 https://$host$request_uri; | |
} |
# Old-school GPG config was taken from the following docs. I'm preserving these | |
# links here just in case I need to configure an old version of mutt & gnupg in | |
# the future without gpgme. | |
# * /usr/share/docs/mutt/gpg.rc | |
# * http://codesorcery.net/old/mutt/mutt-gnupg-howto | |
# * http://dev.mutt.org/trac/wiki/MuttGuide/UseGPG | |
# | |
# Mutt now has solid support for GPGME, which not only makes config much | |
# simpler and eliminates the need to fork gpg processes & parse their output - | |
# it also makes working with gpg-agent, kwallet, gnome-keyring etc. a doddle |