Skip to content

Instantly share code, notes, and snippets.

@ottosch
ottosch / Fusion.ini
Created October 31, 2025 22:43
Kega Fusion sound configuration: ~/.Kega Fusion/Fusion.ini
ALSADeviceName=plughw:1,0
OSSDeviceName=/dev/snd/pcmC0D0p
UsingALSA=1
libmpg123path=/usr/local/lib/libmpg123.so
CurrentWaveFormat=2
SoundOverdrive=0
SoundSuperHQ=0
SoundDisabled=1
SoundFilter=1
@ottosch
ottosch / split-chapters.sh
Created October 27, 2025 00:27
Splits an audio file in chapters, according to file metadata. Tested with Privacy and Utopia from Escape the Technocracy
#! /usr/bin/env bash
# Splits an audio file into chapters
# Usage: ./split-chapters.sh input_file
if [ "$#" -ne 1 ]; then
echo "Usage: $0 input_file" >&2
exit 1
fi
@ottosch
ottosch / how-to-compile-libbitcoin.md
Last active October 14, 2025 01:59
How to Compile Libbitcoin Node

How to compile libbitcoin

Start debian 12 docker container

docker run -it --name libbitcoin debian:bookworm

Install necessary packages

@ottosch
ottosch / interfaces
Last active October 14, 2025 22:39
Sample /etc/network/interfaces with static IP for proxmox VM
# Notes:
# remove the first line (source) if interfaces.d does not exist.
# interface_name examples: eth0, ens18 etc
# chosen_ip example: 192.168.1.18 etc
# This works for VMs. For LXC, it has to be done within proxmox itself.
# On UI: node > CT > network. Enter IP there with a trailing "/24".
source /etc/network/interfaces.d/*
# The loopback network interface
@ottosch
ottosch / eval-performance-electrum.sh
Created September 27, 2025 00:14
Measure time elapsed in fulcrum or another electrum server
#! /usr/bin/env bash
host="localhost"
port=50001
get_balance='{"jsonrpc":"2.0","method":"blockchain.scripthash.get_balance","params":["562ce1c828ab2594470ab4de2561d993d5b5cce0b55695658afb17bec0121ea5"],"id":1}'
get_history='{"jsonrpc":"2.0","method":"blockchain.scripthash.get_history","params":["562ce1c828ab2594470ab4de2561d993d5b5cce0b55695658afb17bec0121ea5"],"id":1}'
# command="$get_balance"
command="$get_history"
@ottosch
ottosch / peer-list-low-fee.txt
Last active August 4, 2025 10:25
Bitcoin peers with minfeefilter < 1sat/vb. Add each with `addnode` on bitcoin.conf or loop through the list calling `bitcoin-cli addnode`
103.126.161.206:8335
103.16.128.63:8333
103.251.165.138:8333
103.6.212.28:8333
104.250.153.218:8333
108.238.23.61:8333
109.227.125.146:8333
116.202.223.108:8333
134.209.198.36:8333
138.197.158.71:8333
@ottosch
ottosch / self-transfer.js
Last active June 12, 2025 14:54
Script to spend an UTXO to a single address, with custom fee rate
#! /usr/bin/env node
// Instructions: place the file inside a directory, run `npm init -y` and install dependencies with
// `npm i bitcoinjs-lib@^6.1.1 ecpair@^2.1.0 tiny-secp256k1@^2.2.1`
const bitcoin = require("bitcoinjs-lib");
const ecc = require("tiny-secp256k1");
const { ECPairFactory } = require("ecpair");
const ECPair = ECPairFactory(ecc);
bitcoin.initEccLib(ecc);
@ottosch
ottosch / tx-ascii-art.js
Created June 8, 2025 17:05
Code used to create transaction 749fdc72f1c99398899425253875deb1d7e5e040db14014ea57db71c610dad26 - #FreeSamourai
#! /usr/bin/env node
const fs = require("fs");
const bitcoin = require("bitcoinjs-lib");
const ecc = require("tiny-secp256k1");
const { ECPairFactory } = require("ecpair");
const ECPair = ECPairFactory(ecc);
bitcoin.initEccLib(ecc);
const network = bitcoin.networks.bitcoin;
@ottosch
ottosch / draw-tx.sh
Created May 3, 2025 22:28
Draws ASCII art from tx 5c4f060e6166a530d891cafd0e9df42441d29b1ed9cff71a1652201b8d50bd72
bitcoin-cli getrawtransaction 5c4f060e6166a530d891cafd0e9df42441d29b1ed9cff71a1652201b8d50bd72 2 | jq -r '.vout[].scriptPubKey.hex | sub("^.{6}"; "")' | while read -r output; do echo "$output" | xxd -p -r; echo; done
@ottosch
ottosch / dinner-inscription.js
Created May 3, 2025 21:50
Extract image inscription of tx 4be3a833ee83b4ca7d157d60fbf7411f7528314ce90df8a844f855118bc6ca11
#! /usr/bin/env node
// Invoke with: bitcoin-cli getrawtransaction 4be3a833ee83b4ca7d157d60fbf7411f7528314ce90df8a844f855118bc6ca11 | ./dinner-inscription.js
const { Transaction } = require('bitcoinjs-lib');
if (process.stdin.isTTY) {
console.error('raw tx needed, quitting...');
process.exit(1);
}