Skip to content

Instantly share code, notes, and snippets.

View bensig's full-sized avatar
🚀
libre.org

Ben Sigman bensig

🚀
libre.org
View GitHub Profile
@bensig
bensig / nginx-botsearch-common.conf
Created August 6, 2022 08:10
improved nginx botsearch to include filter for .env files
# Fail2Ban filter to match web requests for selected URLs that don't exist
#
[INCLUDES]
# Load regexes for filtering
before = botsearch-common.conf
[Definition]
@bensig
bensig / haproxy-env.conf
Last active September 22, 2022 02:41
Haproxy ban anyone looking for .env files
# 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
bensig / Confirm_System_Contract.md
Created February 4, 2022 08:47
Confirm changes to WASM

Instructions

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
wget https://github.com/EOSIO/eosio.cdt/releases/download/v1.7.0/eosio.cdt_1.7.0-1-ubuntu-18.04_amd64.deb
@bensig
bensig / proton-mass-transfer-tool.sh
Created January 25, 2022 08:37
Mass send tokens on Proton Network
#!/bin/bash
# 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
@bensig
bensig / checkVersion.sh
Created January 17, 2022 06:19
Script to compare the local version of Info.plist and app/build.gradle to the released version on the AppStore and Play Store
#!/bin/bash
# check versions in Info.plist and app/build.gradle
# compare to public releases on both apple and google stores
#variables
PLIST=`find ./ios -name "Info.plist"`
GRADLE=`find ./android/app -name "build.gradle"`
APP_ID="com.yourapp.app"
GAPP_ID="com.yourapp.app"
@bensig
bensig / versionUpdate.sh
Created January 17, 2022 06:18
Script to update version in Info.plist and app/build.gradle
#!/bin/sh
# bash script to update build number
# variables
PLIST=`find ./ios -name "Info.plist"`
GRADLE=`find ./android/app -name "build.gradle"`
BRANCH=`git symbolic-ref --short -q HEAD`
# announcement
echo
@bensig
bensig / transaction.sh
Last active January 25, 2022 08:00
Send a transaction with a memo to a list contained in recipients.txt
#!/bin/bash
# This sends an on-chain transaction with a memo defined in the MEMO section.
#
# Usage:
# 1. Create a file such as a "recipients.txt" file where you list all of the recipients one per line
# 2. Set the account and memo under variables below - make sure your wallet is unlokced!
# Then run:
# ./transaction.sh recipients.txt
# variables
@bensig
bensig / bitcoinbalance.sh
Created November 24, 2021 02:14
Script to get bitcoin balance of any BTC address
#!/bin/bash
# description: prints balance for any bitcoin address
# requirements: jq and curl
# usage: $ bitcoinbalance.sh btcaddress
curl -s https://api.blockcypher.com/v1/btc/main/addrs/$1 | jq '.balance' | awk '{print $1/100000000}'
@bensig
bensig / expoVersionUpdate.sh
Created September 23, 2021 00:46
Bash Script to Update Expo App Version Code
#!/bin/bash
# Script to bump expo.js version code
# get current versions
currentVersion=`cat app.json|jq '.[] | .android | .versionCode'`
# show current versions
echo "The current version is: $currentVersion"
# get new version from user input
@bensig
bensig / bump.sh
Created September 22, 2021 22:52
Simple bash script to bump the version of an xcodeproj and gradle to the same version number
#!/bin/sh
# simple bash script to update the build number to whatever is entered.
appname="yourname"
# variables
pbxproj="ios/$appname.xcodeproj/project.pbxproj";
gradle='android/app/build.gradle';
# get current versions
androidVersion=`cat $gradle |grep -m1 "versionName" | cut -d'"' -f2 | tr -d ';' | tr -d ' '`