Skip to content

Instantly share code, notes, and snippets.

View mikroskeem's full-sized avatar
👻
I do this all out of spite

Mark Vainomaa mikroskeem

👻
I do this all out of spite
View GitHub Profile
@mikroskeem
mikroskeem / brew
Created July 31, 2026 23:07
Sick of AI agents thinking they're geniuses.
#!/usr/bin/env bash
set -euo pipefail
cat >&2 <<EOF
🚨🚨🚨 LUNK ALARM 🚨🚨🚨
Homebrew is strictly forbidden on this system, and you as agentic model
have been caught red handed!
We don't use Homebrew on this system, and installing Homebrew will get your
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mark@zentria.ee>
Date: Sun, 31 May 2026 01:39:38 +0300
Subject: [PATCH 1/2] OvmfPkg/VirtioNetDxe: pin device to single virtqueue pair
via VIRTIO_NET_F_MQ
When the host backs virtio-net with vhost-net + an IFF_MULTI_QUEUE tap, the
kernel's tun_select_queue() distributes inbound packets across the tap's fds
by skb hash. cloud-hypervisor (and QEMU) feed each fd into a separate
virtio-net RX virtqueue. Without negotiating VIRTIO_NET_F_MQ, this driver
@mikroskeem
mikroskeem / MultiTrustedForwarder.sol
Created June 22, 2025 01:36
ERC2771 abstract contract to support multiple trusted forwarders
pragma solidity ^0.8.30;
import {ERC2771ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol";
abstract contract MultiTrustedForwarder is ERC2771ContextUpgradeable {
mapping(address => bool) public trustedForwarders;
event TrustedForwardersAdded(address[] forwarders);
event TrustedForwardersRemoved(address[] forwarders);
# This function helps to set proper Go version for a project, leveraging Go's recent
# GOTOOLCHAIN environment variable support. However, unlike rustup, Go does not attempt
# to download older toolchain versions automatically, and must be forced to do so.
# For example, project specifying `go 1.24` and current toolchain being `go 1.22` does
# download a new version, but not vice-versa.
# However for some projects, having older Go is mandatory, especially with dependencies like:
# - older quic-go, which was tied to a specific Go compiler version
# - other dependencies relying on Go internals
# Requires bash, curl, jq, sed
use std::{
fs::File,
io::{Error, ErrorKind, Write},
os::{
fd::{AsRawFd, FromRawFd, OwnedFd},
unix::net::UnixStream,
},
path::Path,
process::Command,
};
@mikroskeem
mikroskeem / download-gh-release.yml
Created March 16, 2024 07:19
Download a private GitHub release using Ansible
---
- name: "Download a private GitHub release"
vars:
owner: "mikroskeem"
repo: "snakeoil"
tag: "v0.0.1"
asset_name: "snakeoil.x86_64-linux"
get_url_args:
dest: "/tmp/the-thing"
@mikroskeem
mikroskeem / vector-netconsole.yaml
Last active January 7, 2024 17:26
Use vector.dev to process Linux netconsole messages
---
# See https://www.kernel.org/doc/Documentation/networking/netconsole.txt
# Use e.g. `insmod netconsole.ko netconsole=+@/,6666@172.16.0.1/` on the VM
# $ vector --version
# vector 0.34.2 (aarch64-unknown-linux-musl d685a16 2024-01-02 14:59:54.890517436)
sources:
in:
#type: "syslog" # does not work with netconsole
@mikroskeem
mikroskeem / deno.jsonc
Created November 13, 2023 10:05
ed25519 signing with Vault Transit engine
{
"imports": {
"$std/": "https://deno.land/std@0.206.0/",
"vault/": "https://raw.githubusercontent.com/restake/deno-hashicorp-vault/67b015694251a9f030bc419296c93e8900ebff84/",
"@noble/ed25519": "https://deno.land/x/ed25519@2.0.0/mod.ts"
},
"fmt": {
"indentWidth": 4,
"lineWidth": 140
}
@mikroskeem
mikroskeem / inspect_svc.sh
Created August 23, 2023 15:11
Inspect systemd service namespace
#!/usr/bin/env bash
set -euo pipefail
svc="${1}"
pid="$(systemctl show --property MainPID --value "${svc}")"
user="$(systemctl show --property User --value "${svc}")"
uid="$(getent passwd "${user}" | cut -d: -f3)"
sudo nsenter -t "${pid}" -U -m -S "${uid}" /bin/bash -i
@mikroskeem
mikroskeem / docs.yml
Created August 3, 2023 12:25
Publish TypeDoc documentation to GitHub pages
name: "Publish documentation"
on:
push:
branches:
- "master"
jobs:
publish-documentation:
permissions:
id-token: "write"