Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Akinbo takinbo

View GitHub Profile
@takinbo
takinbo / hex2sha256.sh
Created Jan 30, 2020
calculate the sha256 hash of a hex string
View hex2sha256.sh
echo -n $1 | xxd -r -p | sha256sum -
@takinbo
takinbo / ban_spy.sh
Last active Sep 17, 2019
ban bitcoin spy nodes
View ban_spy.sh
bitcoin-cli listbanned | jq -r '.[] | select(.ban_reason=="manually added") | .address' | xargs -P 10 -i -- bitcoin-cli setban {} remove \
&& curl -s https://people.xiph.org/\~greg/banlist.gui.txt | xargs -P 10 -L 1 bitcoin-cli
@takinbo
takinbo / 584802.hex
Created Jul 10, 2019
Invalid Block #584802
View 584802.hex
00004020f1f9b8c77a42e502101978707f5de1896176ac1f3b251b0000000000000000007f5a9b94bc04c945693178e32eeae20f5066d7cde08c72001bdd5842da314a7aadf7255d9b0d1f1700e4a56d01010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff550362ec081c4d696e656420627920416e74506f6f6c313132ee003300200f0c9c50fabe6d6dc0ba0d6922d0606afa6321ef35c91f070cb29a0425d4ffef18f70658908db8b6040000000000000033060000b43f0000ffffffff02037f114f000000001976a914edf10a7fac6b32e24daa5305c723f3de58db1bc888ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000
@takinbo
takinbo / explorer.conf
Created Jul 9, 2019
sample nginx configuration for blockstream esplora
View explorer.conf
server {
listen 80;
server_name explorer.local;
location ~ ^/api(/?)(.*) {
proxy_pass http://127.0.0.1:4000/$2;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@takinbo
takinbo / nbxplorer.env
Created Mar 23, 2019
nbxplorer environment file
View nbxplorer.env
NBXPLORER_NETWORK=mainnet
NBXPLORER_BIND=127.0.0.1:24444
NBXPLORER_NOAUTH=1
NBXPLORER_CHAINS=btc
NBXPLORER_BTCRPCURL=http://127.0.0.1:8332/
NBXPLORER_BTCNODEENDPOINT=127.0.0.1:8333
NBXPLORER_BTCRPCAUTH=rpcuser:rpcpassword
@takinbo
takinbo / docker-compose.yml
Created Mar 23, 2019
docker-compose.yml file for NBXplorer
View docker-compose.yml
version: "3"
services:
nbxplorer:
restart: always
build:
context: https://github.com/dgarage/NBXplorer.git#v2.0.0.21
dockerfile: Dockerfile.linuxamd64
env_file: nbxplorer.env
network_mode: host
@takinbo
takinbo / 70-hwrng.rules
Created May 31, 2018
udev rules for the ElectroDoodle TRNG-N1
View 70-hwrng.rules
# ElectroDoodle TRNG-N1 │ rgb_bitdist| 2| 100000| 100|0.25684952| PASSED
SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", SYMLINK+="hwrng", RUN+="/usr/bin/stty -F /dev/%k 115200 raw", T│ rgb_bitdist| 3| 100000| 100|0.39832547| PASSED
AG+="uaccess"
@takinbo
takinbo / stream.js
Created Feb 20, 2017
stream trading events from Luno.com
View stream.js
var WebsocketClient = require('websocket').client,
colors = require('colors'),
sprintf = require('sprintf-js').sprintf;
var ws = new WebsocketClient();
var asks = bids = {};
var now = function () {
var date = new Date();
return sprintf("%02d:%02d:%02d", date.getHours(), date.getMinutes(), date.getSeconds());
@takinbo
takinbo / lnd-python-client.md
Created Jan 29, 2017
Writing a Python gRPC client for the Lightning Network Daemon
View lnd-python-client.md

How to write a Python gRPC client for the Lightning Network Daemon

  • Create a virtual environment for your project
$ virtualenv lnd
  • Activate the virtual environment
$ source lnd/bin/activate
View onename.io
Verifying that +takinbo is my blockchain ID. https://onename.com/takinbo
You can’t perform that action at this time.