Skip to content

Instantly share code, notes, and snippets.

View 0xB10C's full-sized avatar
banned (30-days)

b10c 0xB10C

banned (30-days)
View GitHub Profile
from __future__ import print_function
from bcc import BPF, USDT
import sys
from datetime import datetime
if len(sys.argv) < 2:
print("USAGE:", sys.argv[0], "path/to/bitcoind")
exit()
path = sys.argv[1]
debug = False
@0xB10C
0xB10C / toYYYYMMDDString.js
Created March 30, 2018 11:19
Creates an YYYY-MM-DD String from a Date
Date.prototype.toYYYYMMDDString = function () {
return this.getFullYear() + "-" + ("0" + (this.getMonth()+1)).slice(-2) + "-" + ("0" + this.getDate()).slice(-2);
};
@0xB10C
0xB10C / 1000sat.py
Last active January 5, 2018 20:33
generates a list of mempool transactions with more than one 1000sat output
#!/usr/bin/env python
# requires https://github.com/petertodd/python-bitcoinlib
# just retry if a TypeError occurs on nodes without tx indexing (e.g. pruned nodes)
import bitcoin
import bitcoin.rpc
rpc = bitcoin.rpc.RawProxy()
rawmempool = rpc.getrawmempool(False);
@0xB10C
0xB10C / nixcmds.md
Last active November 11, 2017 12:37
linux cmds I often forget
command function usage notes
scp remote -> local scp uname@remotehost:filename /local/dir
scp local -> remote scp filename uname@remotehost:/remote/dir
tar untar to dir tar -xfv archive.tar -C /target/directory (create dir first)
@0xB10C
0xB10C / buckets.py
Created October 17, 2017 21:23
a playground for bitcoin Core's fee estimation buckets
#!/usr/bin/python
# last bucket with more than 2^14 sat/byte
BUCKETCOUNT = 200
# defines a 5% increase per bucket
# https://github.com/bitcoin/bitcoin/commit/e5007bae35ce22036a816505038277d99c84e3f7#diff-8c0941572d1cdf184d1751f7b7f1db4eR109
FEE_SPACING = 1.05
# list of fee buckets

Keybase proof

I hereby claim:

  • I am 0xb10c on github.
  • I am b10c (https://keybase.io/b10c) on keybase.
  • I have a public key whose fingerprint is 470B 847C 88D0 4928 77B7 F15D E462 234D D056 4D4A

To claim this, I am signing this object:

@0xB10C
0xB10C / intToDHHMMSS.js
Created August 13, 2017 21:38
A function that converts an integer (seconds) to a DHHMMSS string.
String.prototype.toDHHMMSS = function () {
var sec_num = parseInt(this, 10);
var days = Math.floor(sec_num / 86400)
var hours = Math.floor((sec_num - (days * 86400)) / 3600);
var minutes = Math.floor(((sec_num - (days * 86400)) - (hours * 3600)) / 60);
var seconds = sec_num - (days * 86400) - (hours * 3600) - (minutes * 60);
if (hours < 10) {hours = "0"+hours;}
if (minutes < 10) {minutes = "0"+minutes;}
if (seconds < 10) {seconds = "0"+seconds;}