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