Skip to content

Instantly share code, notes, and snippets.

@ottosch
ottosch / fork-helper.py
Last active January 18, 2023 22:06
A script to help using ymgve's bitcoin_fork_claimer script
#!/usr/bin/env python
# This script is meant to be used with bitcoin_fork_claimer: https://github.com/ymgve/bitcoin_fork_claimer
# The outputs of this script are the inputs to that script.
# Python 2.x is required
import urllib2
import json
import sys
import collections
@ottosch
ottosch / fbtc_helper.py
Last active February 7, 2018 13:08
A script to help using ymgve's fbtcclaimer.py script
#!/usr/bin/env python
# This script is meant to be used with fbtcclaimer: https://github.com/ymgve/bitcoin_fork_claimer/blob/master/fbtcclaimer.py
# The outputs of this script are the inputs to the other script.
# Python 2.x is required
import urllib2, json
block = 501225
#!/usr/bin/python
# Will print which language strings exist in the English file, but not in other languages.
# Usage: Place the script in the project root and run "python samourai-strings.py LANGUAGE".
# For example, Spanish would be "python samourai-strings.py es".
# Version 0.2
import sys
import os
import xml.etree.ElementTree as ET
@ottosch
ottosch / bigblock.js
Last active July 21, 2021 02:46
Finds the biggest block up to now
#!/usr/bin/env node
// Create a directory with the script inside, then run npm init && npm i node-bitcoin-rpc
// Run it with ./bigblock.js or node bigblock.js
// Also change the username and password below
// As of 20 Jul 2021, it is block 682482 with 2,42 MB
const rpc = require("node-bitcoin-rpc")
rpc.init("127.0.0.1", 8332, "rpc_username", "rpc_pass");
@ottosch
ottosch / rewards.js
Created July 21, 2021 02:47
Finds block with the highest reward
#!/usr/bin/env node
// Create a directory with the script inside, then run npm init && npm i node-bitcoin-rpc
// Run it with ./rewards.js or node rewards.js
// Also change the username and password below
// As of 20 Jul 2021, it is block 409008, with 316,53275103 BTC
// Honourable mentions: block 254642, with 225,22600217 BTC
// And block 157235, with 221,84649523 BTC
const rpc = require("node-bitcoin-rpc")
@ottosch
ottosch / fix-signature.py
Last active November 27, 2021 23:01
Fixes an ECDSA signature performed by OpenSSL.
#! /usr/bin/env python
import sys
if not sys.stdin.isatty():
hex = sys.stdin.read()
elif len(sys.argv) < 2:
print(f"usage: {sys.argv[0]} hex_signature", file=sys.stderr)
exit(1)
else:
hex = sys.argv[1]
@ottosch
ottosch / first-taproot-txs.js
Last active November 15, 2021 03:13
Prints all taproot transactions and their messages at block 709635
#! /usr/bin/env node
// Create a directory with the script inside, then run npm init && npm i node-bitcoin-rpc
// Run it with ./first-taproot-txs.js or node first-taproot-txs.js
// Also change the username and password below
const rpc = require("node-bitcoin-rpc")
rpc.init("127.0.0.1", 8332, "rpcuser", "rpcpass");
rpc.setTimeout(Number(process.env.TIMEOUT) || 20000);
@ottosch
ottosch / lookup-btc.sh
Last active October 1, 2023 16:44
DNS lookup of Bitcoin peers
#! /bin/bash
hosts="bitcoin.jonasschnelli.ch \
seed.btc.petertodd.org \
bluematt.me \
bitcoin.schildbach.de"
if [[ "$1" == "testnet" ]]; then
hosts="testnet-seed.bitcoin.jonasschnelli.ch \
seed.tbtc.petertodd.org \
@ottosch
ottosch / repeat-key.sh
Last active December 29, 2022 03:33
Executes a keystroke repeatedly. Useful when playing emulators :)
#! /bin/bash
if [ "$#" -lt "2" ]; then
echo "Usage: $0 <key> <times>"
echo "Example: $0 c 20 - will press c 20 times"
exit 1
fi
for _ in $(seq "$2"); do
xdotool key "$1"
@ottosch
ottosch / 1-word-seed-phrases
Created January 3, 2023 23:09
All 1-word seed phrases
12
action agent aim all ankle announce audit awesome beef believe blue border brand breeze bus business cannon canyon carry cave century cereal chronic coast convince cute dawn dilemma divorce dry elevator else embrace enroll escape evolve exclude excuse exercise expire fetch fever forward fury garment gauge gym half harsh hole hybrid illegal include index into invest involve jeans kick kite later layer legend life lyrics margin melody mom more morning nation neck neglect never noble novel obvious ocean oil orphan oxygen pause peasant permit piano proof pumpkin question real report rough rude salad scale screen sea seat sell seminar seven sheriff siege silver soldier spell split spray stadium sugar sunny sure tobacco tongue track tree trouble twelve twice type uniform useless valid very vibrant virtual vocal warrior word world yellow
15
access across adjust ahead badge beauty better clean confirm consider crumble curtain day denial develop dish elbow elder enrich entry exhibit exile forward found head inch j