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
@skwp
skwp / dynamic_method_spec.rb
Created December 7, 2013 00:44
Fail your build for user-defined style rules.
require 'spec/support/grep_matcher'
describe do
disallow_presence_of pattern: "send(.*#",
location: "app/",
description: "Do not use dynamic method invocations",
failure: "Please change dynamic method call to something more sane."
end
@skwp
skwp / logger_middleware.rb
Created October 28, 2013 21:12
A request/response logger Rack middleware.
module Middleware
class Logger
def initialize(app, logger)
@app = app
@logger = logger
end
def call(env)
headers = env.select {|k,v| k.start_with? 'HTTP_'}
replies = %w(
05nelsonm_
0xtail1
12coast
1Jeremycrypto
216musicscene
2357_is_prime
APOSTOL11778943
Arpiht3
BPDesignStudio
#!/usr/bin/env bash
#Find the ip addresses of running instances
# set -f disables file globbing so wthat we can invoke ./list-nodes test1 '*'
# otherwise the star is expanded and messes with the command
set -f
network_name=$1
role=$2
#!/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
#!/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
provider "aws" {
region = "us-east-1"
shared_credentials_file = "~/.aws/credentials"
profile = "${var.aws_profile}"
}
terraform {
backend "s3" {
bucket = "your.bucket.com"
key = "path/to"
#!/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
# 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