Skip to content

Instantly share code, notes, and snippets.

View skwp's full-sized avatar

Yan Pritzker skwp

View GitHub Profile
@skwp
skwp / gist:16c668bbb96e17f9176d6d4d39cc79fd
Last active November 14, 2023 20:25
FINCEN-2023-0016-Objections
// Credit: original bullets sourced from https://twitter.com/HodlsSherlock/status/1719018446392889820?s=20
// INSTRUCTIONS:
// Go to chat.openai.com
// Edit the bullets below to suit your own opinion, then paste it with the prompt on top:
PROMPT: Generate a comment to fincen objecting to proposed rule FINCEN-2023-0016 using these bullets as input. Make it read naturally and drop the roman numeral formatting
I. Cryptocurrency mixing has legitimate uses
replies = %w(
05nelsonm_
0xtail1
12coast
1Jeremycrypto
216musicscene
2357_is_prime
APOSTOL11778943
Arpiht3
BPDesignStudio
@skwp
skwp / bitcoin_contest.rb
Created January 29, 2019 02:37
Bitcoin Hash Based Contest
# Takes a list of people and a set of block hashes and picks people from the list based on their
# position when the block hash is taken modulo the number of participants.
# This assumes there won't be two of the same answer. If there are, the code can be modified to pick the next person in the list, or something like that
contest_participants = %w(
@MSPcrypto
@vinod5473
@Crypto_celt
@HoldingsMidwest
@belair6909
function bitcoinAddnode() {
nodeToAdd=$1
dnsLookup $nodeToAdd
bitcoinExec "addnode $ip:$BITCOIN_PORT add"
}
for peer in $newline_peerlist; do
bitcoinAddnode $peer
done
@skwp
skwp / ban-on-boot.sh
Created November 29, 2018 20:47
ban-on-boot.sh
function bitcoinExec() {
command=$1
log "Bitcoin Exec: $command"
bitcoinExecResult=$(docker exec bitcoin /usr/local/bin/bitcoin-cli
-rpcuser=$TAG_rpcuser \
-rpcpassword=$TAG_rpcpassword \
$command)
}
function bitcoinBan() {
thingToBan=$1
@skwp
skwp / Dockerfile
Created October 26, 2018 18:32
bitcoin Dockerfile
FROM ubuntu:14.04
RUN apt-get -y update && apt-get -y install vim curl htop libgoogle-perftools-dev && apt-get -y autoremove
COPY bin/bitcoin-cli /usr/local/bin
COPY bin/bitcoind /usr/local/bin
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:bitcoin/bitcoin
RUN apt-get update --fix-missing && apt-get install -y --force-yes libdb4.8-dev libdb4.8++-dev libboost-all-dev libminiupnpc-dev libevent-dev
#!/usr/bin/env bash
# Runs a command against the btc node running in docker
# Usage: ./btcrpc [command]
command=$@
if [[ -z "$command" ]]; then
echo "Usage: ./btcrpc [command]"
echo "Example: ./btcrpc getmininginfo"
exit 1
fi
if [[ -z "$rpcpassword" ]]; then
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
network=$1
filename=$2
if [[ -z "$network" ]]; then
echo "Usage: ./restore-chainstate network [filename]"
echo "Restores chainstate. Example: ./restore-chainstate test1 2018-05-07/bitcoin.tgz"
echo "If filename is omitted, will restore to whatever was in /tmp/bitcoin.tgz, typically what we booted with"
fi
stop_command="btcstop"
#!/usr/bin/env bash
BUCKET=our.s3.bucket.com
FILE=$1
if [[ ! -z "$FILE" ]]; then
/usr/local/bin/aws s3 cp s3://$BUCKET/bitcoin-backups/$FILE /tmp/restore.tgz
else
echo "File not specified, will restore backup we started with (assumed to be in /tmp/bitcoin.tgz)"
cp /tmp/bitcoin.tgz /tmp/restore.tgz
fi
# Save the peers
#!/usr/bin/env bash
BUCKET=our.s3.bucket.com
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
docker stop bitcoin
tar --exclude='.lock' --exclude='debug.log' --exclude='peers.dat' --exclude='banlist.dat' -czvf /tmp/bitcoin.tgz /var/bitcoin/
/usr/local/bin/aws s3 cp /tmp/bitcoin.tgz s3://$BUCKET/bitcoin-backups/$DATE/$(hostname)/bitcoin.tgz
docker start bitcoin