Skip to content

Instantly share code, notes, and snippets.

View andir's full-sized avatar

Andreas Rammhold andir

View GitHub Profile
import sys
import os
from PIL import Image
import numpy as np
def recolor_blue_to_red(image_path):
img = Image.open(image_path)
# Preserve original format
@andir
andir / sm.md
Last active February 18, 2026 20:13

🧾 The Simple Sabotage Guide for Cloud-Native Organizations

(A Satirical Field Manual for Maximum Bureaucratic Drag)

General Principles

  1. Prefer Meetings Over Progress When a decision can be made in Slack, schedule a 60-minute Zoom. When a 60-minute Zoom will suffice, create a recurring weekly sync. Always conclude with: “Let’s take this offline.”
{ pkgs, lib, config, ... }:
let
inherit (lib) types;
sandboxOptions = types.submodule ({ name, ... }: {
options = {
packages = lib.mkOption {
type = types.listOf types.package;
default = [ ];
};
entryPoint = lib.mkOption {
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.h4ck.authorative-dns;
asBool = x: if x then "true" else "false";
# indent = n:
# let
# prefix = lib.concatStrings (map (_: " ") (lib.genList 0 n));
{ pkgs, system, inputs, lib, ... }:
let
targetPkgs = import inputs.unstable { inherit system; crossSystem = "aarch64-linux"; config.allowUnfree = true; };
in
lib.makeScope targetPkgs.newScope (self: with self; {
armTrustedFirmware = (targetPkgs.buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "rk3568";
extraMeta.platforms = [ "aarch64-linux" ];
filesToInstall = [ "build/${platform}/release/bl31/bl31.elf" ];
@andir
andir / spec.md
Last active December 9, 2025 00:30
{ config, lib, pkgs, ... }:
let
birdConfigVersion = lib.trace (lib.splitVersion lib.version) (let v = lib.splitVersion lib.version; f = lib.head v; s = lib.head (lib.tail v); in if f == "24" && (s == "11" || s == "05") then "2" else "");
inherit (lib)
attrValues
concatMapStringsSep
concatStrings
concatStringsSep
filterAttrs
flatten
Oct 21 16:48:05 bertha bird[1073226]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 16:48:14 bertha bird[1073245]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 16:49:09 bertha bird[1073261]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 16:49:45 bertha bird[1073283]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 16:50:21 bertha bird[1073306]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 16:50:33 bertha bird[1073332]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 16:50:43 bertha bird[1073355]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 16:58:15 bertha bird[1073373]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 17:01:21 bertha bird[1073454]: Assertion '!rejected || !accepted' failed at nest/rt-table.c:1218
Oct 21 17:17:45 bertha bird[1073500]: Assertion '!rejected || !accepted' failed at nest/
#pragma once
#ifdef PARALLEL_UPDATE
#include <boost/thread.hpp>
#include <boost/thread/executors/basic_thread_pool.hpp>
#include <boost/thread/future.hpp>
#include <boost/thread/latch.hpp>
#include <deque>
#endif
#include <functional>
@andir
andir / foo.rs
Last active October 21, 2025 10:19
use proc_macro::TokenStream;
use quote::quote;
use syn::{Data, DeriveInput, Fields, Lit, Meta, MetaNameValue, parse_macro_input};
#[proc_macro_derive(SimplePrometheus, attributes(prefix))]
pub fn simple_prometheus_derive(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let fields = match &ast.data {