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 / bitcoin_node_info.py
Last active June 15, 2023 20:14
Bitcoin node info without RPC access
#!/usr/bin/env python3
#
# don't require rpc auth.
#
# requirements:
# sudo apt-get install libssl-dev
# pip install python-bitcoinlib
# docs:
# https://github.com/petertodd/python-bitcoinlib
# usage:
@st3b1t
st3b1t / git_authors.sh
Created June 16, 2023 20:43
git list all authors of commits in repository
#!/bin/bash
#
# show all authors of commits in a git repository
#
# usage:
# git clone <http_github_repo>
# git_authors.sh
#
git log --all | grep Auth | sort -u
@st3b1t
st3b1t / two_lines_promnt.sh
Last active June 20, 2023 18:26
double line Satoshi promnt
#!/bin/bash
#┌── Kali Linyx Style #
#└─ Promnt Bash #
export PS1="\033[33m\]┌──(₿)\033[33m\]\033[33m\]\u\033[33m\]@\033[33m\]\h:\033[01;32m\]\w\033[33m\]\n\033[33m\]└─\\[\033[33m\]$\[\033[33m\] "
@st3b1t
st3b1t / random.html
Created July 4, 2023 14:38
Math.random() vs crypto.getRandomValues() Visual random generation values from different ways in Javascript
<html>
<head>
<title>Math.random() vs crypto.getRandomValues()</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
body { background: #333; text-align: center; }
canvas {
margin: 50px;
height: 400px;
width: 400px;
@st3b1t
st3b1t / Dockerfile
Last active July 15, 2023 10:28
Tor Node Dockerfile
FROM debian:stable-slim
ARG PUB_CONTROLIP=0.0.0.0
ARG PUB_CONTROLPORT=9052
#ACCESSLOG /var/log/rinetd.log
RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retires=10 install --no-install-recommends -y \
ca-certificates curl gnupg && \
printf 'deb http://deb.torproject.org/torproject.org stable main' >> /etc/apt/sources.list && \
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | apt-key add - && \
@st3b1t
st3b1t / ramdisk.sh
Last active July 21, 2023 20:07
create ramdisk on a Linux distro
#!/bin/sh
#path of the ramdisk
PATH=/media/ram
#automount ad startup
AUTO=",auto"
#disk size
SIZE=2G
sudo mkdir -p /media/ram
sudo echo "tmpfs $PATH tmpfs size=$SIZE,rw$AUTO,user,noatime,x-gvfs-show 0 0" >> /etc/fstab
sudo mount -a
@st3b1t
st3b1t / electrum-client.js
Created July 25, 2023 00:29
get amount of certain address in nodejs with bitcoinjs-lib
/*
Usage:
$ node electrum-client.js <servername>:<port> 3Eh99S957RnRrKmiU6DPAphwvjYB8UkeQb
Output:
address:3Eh99S957RnRrKmiU6DPAphwvjYB8UkeQb amount:0.0158 btc
*/
const net = require('net')
, bitcoin = require('bitcoinjs-lib');
@st3b1t
st3b1t / acks.txt
Created August 8, 2023 21:13
ACKs
Concept ACK - Agree with the idea and overall direction, but haven't reviewed the code changes or tested them.
utACK (untested ACK) - Reviewed and agree with the code changes but haven't actually tested them.
Tested ACK - Reviewed the code changes and have verified the functionality or bug fix.
ACK - A loose ACK can be confusing. It's best to avoid them unless it's a documentation/comment only change in which case there is nothing to test/verify; therefore the tested/untested distinction is not there.
NACK - Disagree with the code changes/concept. Should be accompanied by an explanation.
@st3b1t
st3b1t / wait-for-chmod.sh
Last active October 4, 2023 10:06
waits for a file to have read group permissions before running a certain command
#!/bin/bash
# Copyright @st3b1t 2023
#
# usage: ./wait-for-chmod.sh /path/to/file/to/check <next-command>
#
# example, check bitcoin cookie file is readable by group:
# ./wait-for-chmod.sh /home/bitcoin/.bitcoin/.cookie <next-command>
#
set -e
@st3b1t
st3b1t / ad-blacklist.txt
Created October 5, 2023 14:12
AD BlackLists
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://adaway.org/hosts.txt
https://v.firebog.net/hosts/AdguardDNS.txt
https://v.firebog.net/hosts/Easyprivacy.txt
https://winhelp2002.mvps.org/hosts.txt