Skip to content

Instantly share code, notes, and snippets.

#!/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'

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.

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
@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()
#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 / 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() {
import struct
import base58
import hashlib
import ecdsa
import codecs
import binascii
from hashlib import sha256
#For Python 3, tested on stock ubuntu 20.04
#pip3 install each import above
import os
import ecdsa
import hashlib
import base58
import binascii
import codecs
import struct
#Use Python3
#Crude Denarius address to scripthash converter for electrumx talking
#!/bin/bash
#Denarius 5000 FortunaStake Collateral Staker
. config.conf
. rpc.sh
#daemon location
denariusdaemon=/usr/local/bin/denariusd
#debug.log location
debuglog=~/.denarius/debug.log
#!/bin/bash
#Convert seed.txt into dumpwallet.txt to import into QT/daemon
#requires seed.txt generated from bip39 tool https://iancoleman.io/bip39/
#create by cloning above bip39 tool to run locally
#select coin - DNR, 24 words - click generate
#scroll down to table view, copy and paste as many addresses as you want
#copy that into seed.txt
#run and spits out a dumpwallet.txt, use importwallet dumpwallet.txt to bring your addy's in
#be aware non HD wallets, change addresses may or may not use these addys
#need more testing (obviously copy your seed phrase to get these privkeys whenevers)