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 / 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 / dlvr.sh
Last active June 12, 2025 05:05
DLVR.CLOUD one file upload bash script
#!/bin/bash
# Install
# sudo curl https://gist.githubusercontent.com/WietseWind/5ef71f7a26d9588a233f1d034762ac84/raw/dlvr.sh > /usr/local/bin/dlvr
# sudo chmod +x /usr/local/bin/dlvr
# Use: dlvr somefilename
DLVR_INIT=$(curl -i -s https://dlvr.cloud/api.php)
DLVR_SESSION=$(echo "$DLVR_INIT"|grep session|grep addr|grep domain|jq .session|cut -d '"' -f 2)
DLVR_ADDR=$(echo "$DLVR_INIT"|grep session|grep addr|grep domain|jq .addr|cut -d '"' -f 2)
@WietseWind
WietseWind / sample.js
Last active June 4, 2025 09:28
XRPL Accountlib & XRPL Client together
//
// NOTE! THERE'S A BETTER METHOD NOW:
// https://github.com/WietseWind/xrpl-accountlib#-however-since-version-210-this-lib-bundles-xrpl-client-as-well-and-comes-with-helpers-to-prepare-transactions--submit-transactions-
//
const lib = require('xrpl-accountlib')
const { XrplClient } = require('xrpl-client')
const secret = 's...'
const account = 'r...' // Can be derived
@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 / b2m.mjs
Last active February 11, 2025 16:46
Simple B2M with hosted xPOP
import { derive, utils, signAndSubmit } from 'xrpl-accountlib'
import { TxData } from 'xrpl-txdata'
import { XrplClient } from 'xrpl-client'
import { xpop, setEndpoints as xpopEndpoints } from 'xpop'
import fetch from 'node-fetch'
// The above needs:
// npm install xrpl-accountlib xrpl-txdata xrpl-client xpop node-fetch
console.log('Obtaining XRPL Testnet account (faucet)')
@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"
@WietseWind
WietseWind / racadm.bash
Last active November 15, 2024 03:15
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 / coolify-custom.md
Last active November 7, 2024 03:13
Coolify Tips
  • Install the Git webhook for Push to Deploy
  • Custom headers (!!) NEEDS [ ] STATIC to be DISABLED even if static, example: https://github.com/WietseWind/iPubXahau-Homepage
    • Make sure you have the nixpacks.toml and the .nix folder, the custom headers (nginx format) are in the .nix folder.
@WietseWind
WietseWind / index.mjs
Created September 18, 2024 10:40
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}'