Skip to content

Instantly share code, notes, and snippets.

@digitalsignalperson
digitalsignalperson / appearance.json
Last active October 6, 2026 05:15
obsidian config
{
"textFontFamily": "Noto Sans Mono",
"enabledCssSnippets": [
"headings",
"headings-size",
"tree",
"images",
"kanban",
"callouts",
"image-alpha"
@digitalsignalperson
digitalsignalperson / reclaim_config.sh
Created October 6, 2026 05:06
how to download more ram
# zswap off
echo 0 > /sys/module/zswap/parameters/enabled
# damon_reclaim
echo 0 > /sys/module/damon_reclaim/parameters/quota_sz # no size quota
echo 0 > /sys/module/damon_reclaim/parameters/quota_ms # per time period
echo 950 > /sys/module/damon_reclaim/parameters/wmarks_high # deactivate when >95% space free
echo 950 > /sys/module/damon_reclaim/parameters/wmarks_mid # activate when <95% space free
echo 50 > /sys/module/damon_reclaim/parameters/wmarks_low # deactivate when <5% space free
echo 200 > /sys/module/damon_reclaim/parameters/min_nr_regions # min num monitoring regions (default 100)
@digitalsignalperson
digitalsignalperson / dump-registry.c
Created September 13, 2026 23:29
wayland registry dumper
#include <stdio.h>
#include <wayland-client.h>
static void on_global(void *data, struct wl_registry *reg, uint32_t name,
const char *iface, uint32_t version)
{
(void)data; (void)reg; (void)name;
printf("%s v%u\n", iface, version);
}
static void on_global_remove(void *d, struct wl_registry *r, uint32_t n)
@digitalsignalperson
digitalsignalperson / wl-secure-launch.c
Created September 13, 2026 23:28
run a command against a restricted Wayland socket via wp_security_context_manager_v1
/*
* wl-secure-launch — run a command against a restricted Wayland socket.
*
* Creates a listening socket, registers it with the compositor via
* wp_security_context_manager_v1, then execs a child. Clients connecting
* through that socket are tagged as sandboxed, so the compositor withholds
* privileged globals (data-control, screencopy, layer-shell, ...).
*
* The listener is revoked when this process exits.
*
@digitalsignalperson
digitalsignalperson / clip-snoop.c
Created September 13, 2026 23:27
ext_data_control_manager_v1 grants any wayland client unrestricted background clipboard access
/* clip-snoop.c — reads the Wayland clipboard with no window, no focus,
* no user interaction. PoC that ext_data_control_manager_v1 grants any
* client unrestricted background clipboard access. */
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <wayland-client.h>
#include "ext-data-control-v1-client-protocol.h"
static struct wl_seat *seat;
@digitalsignalperson
digitalsignalperson / table-demo.py
Last active March 24, 2026 07:26
vibe-coded imgui table demo: 5k rows x 5k cols @ 120fps; custom drawlist rendering & IQR line plot conditional formatting
"""
Custom column-major DataFrame table renderer using imgui_bundle draw lists.
Key design constraints:
- All expensive work (stats, widths, col-to-array) is done ONCE at table creation.
- Per-frame work is O(visible_cells) only.
- Column settings and metadata are polars DataFrames.
- Settings UI shows one column at a time (search to select).
- Filtering uses polars/numpy expressions, not Python list comprehensions.
- Data generation uses numpy for bulk random data.
@digitalsignalperson
digitalsignalperson / bwrap-slirp4netns-test.sh
Last active July 9, 2026 19:00
Example use of slirp4netns with bubblewrap
#!/bin/bash
status=$(mktemp -u)
mkfifo $status
# TODO error if slirp4netns not installed
set -e
cleanup() {
echo "cleanup"
@digitalsignalperson
digitalsignalperson / ,bwrap-code-session.sh
Last active March 20, 2026 18:32
Isolated vscode environments for claude code with bubblewrap
#!/bin/bash
{
cat > /dev/null << 'EOF'
This is a bubblewrap script I use to isolate claude-code from my personal computer
Environment:
- CODE_SESSION_STORAGE: Required storage location for session home folders
- CODE_CONFIG_BASENAME: The vscode ~/.config location name. Defaults to "Code - OSS". Depends on linux distribution
- CODE_EXTENSIONS_PATH: e.g. a file you can provide like `code --list-extensions > ~/.config/vscode-extensions.txt`
that will be loaded in the container's vscode
@digitalsignalperson
digitalsignalperson / ,cc-md.py
Created March 20, 2026 17:58
Simple Claude Code Session Exporter
#!/usr/bin/env python3
"""
Simple Claude Code Session Exporter
Finds sessions, lists them, exports to markdown.
Inspired by https://github.com/jimmc414/cctrace/blob/master/export_claude_session.py
"""
import json
import os
@digitalsignalperson
digitalsignalperson / uw
Created March 3, 2026 06:45
uw - a uv wrapper to run a uv "workspace" with independent uv.lock from its dependencies
#!/usr/bin/env bash
set -euo pipefail
# Walk up from CWD looking for .uw
find_uw_root() {
local dir="$PWD"
while [[ "$dir" != "/" ]]; do
if [[ -f "$dir/.uw" ]]; then
echo "$dir"
return 0