Skip to content

Instantly share code, notes, and snippets.

View WietseWind's full-sized avatar
⌨️
Focusing

Wietse Wind WietseWind

⌨️
Focusing
View GitHub Profile
@WietseWind
WietseWind / README.md
Created September 18, 2026 10:00
Proxmox full VM virtual disk without passthrough proper IO

Task: convert a Proxmox VM's disks to virtio-blk, cache=none, iothread — identified by guest IP

You are operating on production VMs. Work on ONE IP at a time, finish it completely (or abort it cleanly) before starting the next. Never run two hosts in parallel. Stop the whole run on the first abort and report.

Inputs and access

  • Local backup folder: ./backup/ in the current working directory (create if missing).
  • Tools you may use on Proxmox: pvesh get|set|create, cat /etc/pve/.... Forbidden: qm stop, pvesh ... status/stop, qm disk unlink, --force, qm destroy, anything that deletes or moves a volume, anything on a VM you did not match to the IP.

Target disk options

@WietseWind
WietseWind / index.mjs
Last active August 17, 2026 07:19
Create Escrow in incrementing instalments
import fetch from 'node-fetch'
import { XrplDefinitions, derive, sign } from 'xrpl-accountlib'
const now = new Date()
const Server = 'https://xahau-test.net' // can be testnet, xahau-test.net / xahau.network
const secret = '{sender secret}' // can be RK secret
const Account = derive.familySeed(secret)
Account.address = '{sender account r-address}'
@WietseWind
WietseWind / shelly-pill-uart.js
Last active August 12, 2026 11:40
Read SPS30 with NodeJS over USB to UART -- incl. arguments
// SPS30 over UART on The Pill - averaged emit + bidirectional commands via Script.Eval.
// Measurements emit "sps30"; command results emit "sps30_cmd". uint16 format.
let INTERVAL_MS = 1000; // sample at ~1 Hz
let WINDOW = 10; // samples per averaged emit
let uart = UART.get(0);
if (!uart) { print("ERROR: UART not available"); }
else uart.configure({ baud: 115200, format: "8N1" });
@WietseWind
WietseWind / dice-acc.mjs
Last active August 2, 2026 23:09
6 sided (regular) dice ED25519 account generation
import accountlib from 'xrpl-accountlib'
import assert from 'assert'
// Modified for 6 sided dice, from the 10 sided version:
// https://gist.github.com/WietseWind/78c90534b866bb59d5d78cacf48400f9
// based on @RichardAH's work: https://github.com/RichardAH/validator-keys-from-dice/blob/main/dice.js
const requiredBits = 256
const dieFaces = 6
@WietseWind
WietseWind / index.mjs
Last active August 2, 2026 22:44
256 bits, ED25519 keypair & XRPL account using 10-face dice roll, numbers 0-9 (78 throws)
import accountlib from 'xrpl-accountlib'
import assert from 'assert'
const requiredBits = 256
const requiredThrows = Math.ceil(requiredBits / Math.log2(10))
// Adapted from validator keypair dice tool by RichardAH
// https://github.com/RichardAH/validator-keys-from-dice/blob/main/dice.js
// Random (BAD RANDOM! BAD BAD BAD RANDOM! DO NOT EVER USE THIS!! TESTING PURPOSES ONLY!)
@WietseWind
WietseWind / racadm.bash
Last active July 24, 2026 03:47
Install racadm on Ubuntu 20.04 / 18.04
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-cmpi-devel/libcmpicppimpl0_2.0.3-0ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/multiverse/s/sblim-sfcb/sfcb_1.4.9-0ubuntu5_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfc-common/libsfcutil0_1.0.1-0ubuntu4_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/multiverse/c/cim-schema/cim-schema_2.48.0-0ubuntu1_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/openwsman_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfcc/libcimcclient0_2.2.8-0ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-server1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-client4_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-curl-client-trans
@WietseWind
WietseWind / index.js
Created July 22, 2019 11:14
Encode/Decode X-address in the browser (plain HTML+JS)
<script src="https://xrpaddress.info/js/xrpl-tagged-address-codec-browser.js"></script>
<script>
var XCodec = require('xrpl-tagged-address-codec')
console.log(XCodec.Encode({ account: 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', tag: 495 }))
console.log(XCodec.Decode('XV5sbjUmgPpvXv4ixFWZ5ptAYZ6PD28Sq49uo34VyjnmK5H'))
</script>
@WietseWind
WietseWind / zfstune.sh
Created February 12, 2026 00:03
Proxmox ZFS tuning
#!/bin/bash
# ZFS Performance Tuning - Non-persistent (apply after each reboot)
# Auto-detects pools, datasets, and disks
set -e
echo "=== ZFS Performance Tuning ==="
# --- ARC: set to ~200GB (adjust if your servers have less RAM) ---
ARC_MAX=214748364800
@WietseWind
WietseWind / .zshrc
Last active April 3, 2026 08:36
Claude SessionEnd Hook & auto restore session
# Auto resume claude
# -- Claude Code: auto-resume sessions --
autoload -Uz add-zsh-hook
_claude_session_check() {
if [[ -f .claude_session ]]; then
echo "💡 Saved Claude Code session found. Run 'claude' to resume."
fi
}
@WietseWind
WietseWind / README.md
Created March 31, 2026 14:01
Install Espruino on XIAO ESP32-C3

Flashing Espruino on Seeed XIAO ESP32-C3 (macOS)

1. Detect connected USB devices

system_profiler SPUSBDataType

The XIAO ESP32-C3 shows up as a CP2102N USB to UART Bridge Controller (Silicon Labs) when using an older unit, or as a native USB-Serial/JTAG device on newer units.