Skip to content

Instantly share code, notes, and snippets.

@buzzkillb
buzzkillb / hello_world.ino
Created August 4, 2020 00:45
ESP32 TTGO button 1 and 2 masher with screen and serial example display
//simple button masher esp32 ttgo
#include <TFT_eSPI.h>
#include <SPI.h>
#define BUTTON1PIN 35
#define BUTTON2PIN 0
TFT_eSPI tft = TFT_eSPI();
void IRAM_ATTR toggleButton1() {
#calculate total staking against circulating, median, min, max for $BLOCK, python3
import statistics
import requests
# TODO: Add error handling
staking = requests.get("https://chainz.cryptoid.info/explorer/index.stakes.dws?coin=block").json()
circulating = float(requests.get("https://chainz.cryptoid.info/block/api.dws?q=circulating").text)
staking_sum = sum(map(lambda x: float(x['amount'] or 0), staking['stakes']))
@buzzkillb
buzzkillb / southx_book_sell.py
Created August 23, 2020 19:25
Get total for sale on SouthXchange
import statistics
import requests
#denarius.io
#denarius.pro
#https://main.southxchange.com/Market/Book/D/BTC
# TODO: Add error handling
southx_book = requests.get("https://www.southxchange.com/api/book/D/BTC").json()
from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException
import json
from time import gmtime, strftime
#always backup wallet.dat before running scripts!!!
#use https://github.com/buzzkillb/python-denariusrpc
# rpc_user and rpc_password are set in the denarius.conf file
rpc_connection = AuthServiceProxy("http://%s:%[email protected]:32369"%("rpcuser", "rpcpassword"))
#change minimum amount to satisfy demands

Setup Cloudflare Full Strict SSL with DigitalOcean

slight modifications from here
https://www.youtube.com/watch?v=Ye1OrYwVN-U
https://github.com/theADAMJR/theADAMJR.github.io/blob/master/guides/setup-cloudflare-full-strict-ssl-with-digitalocean.md

Get Started

This tutorial uses Ubuntu 20.04, using a DigitalOcean droplet. The goal of this is to setup full strict SSL with cloudflare for a static website.

I use FileZilla FTP for pasting in file content due to the DigitalOcean terminal having weird paste issues.

#!/bin/bash
#size of chaindata folder, remove last character (G) at end
du -h --max-depth=0 /root/.denarius | awk '{print $1}' | sed 's/.$//'
#daemon ram usage in kilobytes
ps -C denariusd -o rss | awk 'END { print }'
#daemon getinfo for version and blockheight, split them up is less thinking mmm brainz
#denariusd getinfo | jq -r '.version, .blocks'
denariusd getinfo | jq -r '.version'
#!/bin/bash
#Denarius block 43891 is first day after 3,000,000
#curl chainz daily emissions API and convert to json for maximum zombies
DAILYCOUNTER=43891
while [ $DAILYCOUNTER -lt 43894 ]; do
chainzDaily=$(curl -s "https://chainz.cryptoid.info/explorer/overview.day.dws?coin=d&d=${DAILYCOUNTER}&f=7331209.21602584.js")
chainzDay=$(echo $chainzDaily | jq '.d')
chainzMinh=$(echo $chainzDaily | jq '.minh')
chainzMaxh=$(echo $chainzDaily | jq '.maxh')
chainztxc=$(echo $chainzDaily | jq '.txc')
@buzzkillb
buzzkillb / doctord.sh
Last active January 19, 2021 03:12
revise to sort through and search only 0 inputs first
#combine inputs and send to a given address, for single address specifically for yiimp 0 input lag
#!/bin/bash
. config.conf
. rpc.sh
minimuminputs=100
minimumbalance=0.0010000
zeroRewards=0.00000000
maximumInput=1.00000000
walletAddress=DSNSwswjkic931atZXKMLsahzUKivvyDWk
#combine inputs and send to a given address, for single address specifically for yiimp 0 input lag
#!/bin/bash
. config.conf
. rpc.sh
#this is meant to clean a mining pool Denarius address as it will retie addresses together searching for a D input greater than txfee from change address and main wallet
#auto finds ZERO inputs to send, gets txfee, finds input with D > txfee and sends back on itself
#####################
#wget https://raw.githubusercontent.com/buzzkillb/bash-denariusrpc/master/rpc.sh
#!/bin/bash
#############
#The goal is to take all the addresses in a wallet over minimumbalance user sets and send equal amounts of lowest D per
#all those addresses and send to that many new addresses, like a very very crude coinjoin on your own wallet.
#To try you need snap installed, load QT and run. Use a test wallet with 2 small D addresses to see what happens.
#############
# daemon location
denariusdaemon=/snap/bin/denarius.daemon