Skip to content

Instantly share code, notes, and snippets.

View st3b1t's full-sized avatar
🔗
on chain

st3b1t

🔗
on chain
View GitHub Profile
@st3b1t
st3b1t / podcast-widget.html
Created October 9, 2023 12:31
podcast rss feed widget
<html>
<head></head>
<body>
<h1>Podcast RSS Box</h1>
<div id="feed" style="max-width: 50%;border:1px solid blue;padding:10px">
</div>
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script>
@st3b1t
st3b1t / tunnel-bitcoin-node.sh
Created November 9, 2023 21:27
script to create a ssh tunnel to your bitcoin node
#!/bin/sh
#
# script to create a ssh tunnel to your bitcoin node
# and expose in localhost temporary port of bitcoin core
#
#user to access bitcoin node
USERNODE=user-ssh-node
#ip or hostname of bitcoin node
HOSTNODE=bitcoind-host
#ssh port(usually 22)
@st3b1t
st3b1t / mnemonic.sh
Created November 23, 2023 22:47
generate secure random mnemonic 24 words in bash
#!/bin/bash
# Copyright @st3b1t 2023
#
# generate secure random mnemonic 24 words in bash
#
bip39=(abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress actual adapt add addict address adjust admit adult advance advice aerobic affair afford afraid again age agent agree ahead aim air airport aisle alarm album alcohol alert alien all alley allow almost alone alpha already also alter always amateur amazing among amount amused analyst anchor ancient anger angle angry animal ankle announce annual another answer antenna antique anxiety any apart apology appear apple approve april arch arctic area arena argue arm armed armor army around arrange arrest arrive arrow art artefact artist artwork ask aspect assault asset assist assume asthma athlete atom attack attend attitude attract auction audit august aunt author auto autumn average avocado avoid awake aware away awesome awful awkward axis baby bachelor bacon b
@st3b1t
st3b1t / qrcode.py
Last active February 21, 2024 17:17
commandline qrcode generator
#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'qrcode==7.3.1','console_scripts','qr'
#
# requirements: pip install qrcode
import re
import sys
__requires__ = 'qrcode==7.3.1'
try:
@st3b1t
st3b1t / satlog-rpc.sh
Created February 23, 2024 21:27
testing rpc methods of your rpc Bitcoin full node
#!/bin/sh
#
# included in: https://github.com/st3b1t/SatoshiLog
#
# usage: echo server.banner | satlog-rpc 127.0.0.1 50001
#
read METHOD
HOST=$1
@st3b1t
st3b1t / electrs-client.py
Last active May 21, 2024 23:39
client electrs RPC for commandline
#!/usr/bin/env python3
import sys
import os
import importlib.util
import argparse
import json
##
# usage examples:
# ./electrs-client.py server.version
# ./electrs-client.py mempool.get_fee_histogram
@st3b1t
st3b1t / bitcoin-avg-blocktime.sh
Created May 16, 2024 22:16
Calculate the avg time of last NBLOCKS bitcoin block in your full node
#!/bin/bash
# copyright 2024 st3b1t
# Calculate the avg time of last NBLOCKS
NBLOCKS=10
#pick last NBLOCKS blocks
PREV_TIMESTAMP=0
DIFF_SUM=0
COUNT=0
@st3b1t
st3b1t / libp2p_websocket.js
Last active June 4, 2024 23:25
websocket p2p network in nodejs
/*
docs: https://github.com/libp2p/js-libp2p/blob/main/doc/GETTING_STARTED.md
setup:
$ npm install libp2p @chainsafe/libp2p-noise @chainsafe/libp2p-yamux @libp2p/bootstrap @libp2p/mdns @libp2p/websockets
run:
$ node libp2p_websocket.js <PORT>
open in more terminal with different port