Skip to content

Instantly share code, notes, and snippets.


Ben Sigman bensig

View GitHub Profile
bensig /
Last active March 16, 2023 23:17
Getting eosio.wrap working

Steps to get eosio.wrap working:

Generated a JSON of all producers and their perms - alphabetized:

        "actor": "amsterdam",
        "permission": "active"
bensig / gist:b2576854f9381e84f7e96ed75470b5ea
Last active March 5, 2023 00:09
New 2023 Nginx to filter bad bots and scanners
View gist:b2576854f9381e84f7e96ed75470b5ea

There are 2 parts - a filter and a jail config:


#^<HOST> .*"\\x.*"$
failregex = ^<HOST>.*"CONNECT leakix.*"$
#            ^<HOST>.*"HTTP.*"$
bensig /
Created March 4, 2023 20:51
Unpack ubuntu oom killer output
# may need to specify a diff path to syslog if you want older log files
cat /var/log/syslog | grep kernel | rev | cut -d"]" -f1 | rev | awk '{ print $3, $4, $5, $8 }' | grep '^[0-9].*[a-zA-Z]' | perl -MData::Dumper -p -e 'BEGIN { $db = {}; } ($total_vm, $rss, $pgtables_bytes, $name) = split; $db->{$name}->{total_vm} += $total_vm; $db->{$name}->{rss} += $rss; $db->{$name}->{pgtables_bytes} += $pgtables_bytes; $_=undef; END { map { printf("%.1fG %s\n", ($db->{$_}->{rss} * 4096)/(1024*1024*1024), $_) } sort { $db->{$a}->{rss} <=> $db->{$b}->{rss} } keys %{$db}; }' | tail -n 10 | tac
bensig /
Created March 3, 2023 20:02
Fast Sync Bitcoin Node - 3 Options

Option 1 - Use This Bitcoin Fast Sync Command

There is no torrent which would be faster than just using the Bitcoin network "hive" - which is huge. There may be a way to sync using local or low-latency nodes nearby, but any time you specify which nodes you sync from - it introduces risk.

Very good to have a fast CPU and lots of RAM, SSD is not as important as RAM.

With this command I was able to download the entire blockchain and create all indices in almost exactly 24 hours:

bitcoind --datadir=<path-to-external-ssd> -blockfilterindex=1 -txindex=1 -coinstatsindex=1 -dbcache=16384 -daemon If you have 32GB of RAM, you can use 32768 for dbcache

View multisig-edentogoveos
# Set the permission of the proposing account
# Get user input
echo "You may need to set your account permission first - check the contents of this script"
echo ""
read -p "Enter the name of the proposal: " NAME
read -p "Enter the name of the account to pay: " PAYEE
bensig / jail.local
Created September 22, 2022 02:40
Fail2ban for haproxy
View jail.local
before = paths-debian.conf
ignoreip =
bensig / nginx-botsearch-common.conf
Created August 6, 2022 08:10
improved nginx botsearch to include filter for .env files
View nginx-botsearch-common.conf
# Fail2Ban filter to match web requests for selected URLs that don't exist
# Load regexes for filtering
before = botsearch-common.conf
bensig / haproxy-env.conf
Last active September 22, 2022 02:41
Haproxy ban anyone looking for .env files
View haproxy-env.conf
# Fail2Ban filter configuration file to match failed login attempts to
# HAProxy HTTP Authentication protected servers.
# PLEASE NOTE - When a user first hits the HTTP Auth a 401 is returned by the server
# which prompts their browser to ask for login details.
# This initial 401 is logged by HAProxy.
# In other words, even successful logins will have at least 1 fail regex match.
# Please keep this in mind when setting findtime and maxretry for jails.
# Author: Jordan Moeser
bensig /
Created February 4, 2022 08:47
Confirm changes to WASM


You will need CDT 1.7 installed. These instructions are written for Linux if you want to run on a mac, it's much more difficult IMHO

Make a directory

mkdir ~/verify cd ~/verify

  1. Install cdt 1.7.0
bensig /
Created January 25, 2022 08:37
Mass send tokens on Proton Network
# You should already have cleos, keosd installed with a wallet created
# In that wallet you will need your private key
# Usage:
# 1. Create a recipients.csv in the same dir as this script
# ** FORMAT OF CSV SHOULD BE like this:
# benobi 0.00000001
# paul 0.00000001
# That will send one SAT to "benobi" and 1 sat to "paul"
# 2. Update the TOKENBANK - this is the account you will be sending FROM