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 / .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.

@WietseWind
WietseWind / espruino.js
Created March 24, 2026 15:35
espruino.js
var on = false;
const blinkInterval = setInterval(function() {
on = !on;
LED1.write(on);
}, 500);
var WIFI_NAME = "Test";
var WIFI_OPTIONS = { password : "xxxx" };
var wifi = require("Wifi");
@WietseWind
WietseWind / sps30.js
Last active March 17, 2026 23:25
Read SPS30 with NodeJS over USB to UART -- incl. arguments
#!/usr/bin/env node
import { SerialPort } from 'serialport';
import { setTimeout as sleep } from 'timers/promises';
import { parseArgs } from 'util';
// --- SHDLC protocol ---------------------------------------------------------
const SHDLC_DELIM = 0x7e;
const STUFF = { 0x7e: [0x7d, 0x5e], 0x7d: [0x7d, 0x5d], 0x11: [0x7d, 0x31], 0x13: [0x7d, 0x33] };
@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 / vanity.mjs
Created December 8, 2025 19:19
Sign with Regular Key on Vanity account on XRPL/Xahau
import lib from "xrpl-accountlib";
import { XrplClient } from 'xrpl-client'
const vanityAccount = "rrrrrrrr";
const signWithRegularKeySecret = "ssssss"; // or use secret numbers and change the derive fn below
const tx = {
TransactionType: "Payment",
Account: vanityAccount,
Fee: "12",
@WietseWind
WietseWind / validators.txt
Created September 22, 2025 10:48
Update rippled XRPLF UNL config
[validator_list_sites]
https://vl.ripple.com
https://unl.xrplf.org
[validator_list_keys]
# Ripple
ED2677ABFFD1B33AC6FBC3062B71F1E8397C1505E1C42C64D11AD1B28FF73F4734
# XRPLF
ED42AEC58B701EEBB77356FFFEC26F83C1F0407263530F068C7C73D392C7E06FD1
@WietseWind
WietseWind / sh.bash
Last active June 1, 2025 12:08
Proxmox: force exit cluster & re-join
# NOTE!! DO THIS ONE BY ONE, IT FAILS IF TWO NODES TRY TO JOIN AT THE SAME TIME!
# export LANG=en_US.UTF-8
# export LC_ALL=en_US.UTF-8
#pvecm expected 1
# Clear join (back to standalone)
systemctl stop pve-cluster corosync
@WietseWind
WietseWind / main.java
Created February 23, 2025 01:49
CRC16 / CRC-A implementation of ISO 14443-3 in Java
// Eg run @ https://www.programiz.com/java-programming/online-compiler/
// data: 48 65 6C 6C 6F 20 57 6F 72 6C 64
// CRC-16: 52 7B
class Main {
public static byte[] calculateCRC16(byte[] bytes) {
byte chBlock;
int wCRC = 0x6363;
int i = 0;
@WietseWind
WietseWind / receipient.sh
Created December 19, 2024 14:49
UDP fragmentation checker
#!/bin/bash
PORT=12345
RESULTS_DIR="udp_receiver_results_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$RESULTS_DIR"
echo "Starting UDP fragmentation test - Receiver"
echo "----------------------------------------"
echo "Port: $PORT"
echo "Results directory: $RESULTS_DIR"