Skip to content

Instantly share code, notes, and snippets.

@buzzkillb
buzzkillb / ddns_update_data_denarius.py
Last active February 10, 2021 01:20
ddns_update_data_denarius.py
from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException
#DDNS to update data
ddns_update_name = 'api:python_example'
ddns_update_value = 'example value update'
ddns_update_expiration = 9999
# rpc_user and rpc_password are set in the denarius.conf file
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:32369"%("rpcusername", "rpcpassword"))
#create new Denarius DDNS name based on name, value and expiration
from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException
#DDNS to create data
ddns_create_name = 'api:python_example'
ddns_create_value = 'example value'
ddns_create_expiration = 9999
# rpc_user and rpc_password are set in the denarius.conf file
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:32369"%("rpcusername", "rpcpassword"))
#requires https://github.com/buzzkillb/python-denariusrpc and denarius daemon/QT wallet
from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException
#DDNS to look up data
ddns_lookup_data = 'api:pricefeedDenarius'
# rpc_user and rpc_password are set in the denarius.conf file
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:32369"%("rpcusername", "rpcpassword"))
name_show_feed = rpc_connection.name_show(ddns_lookup_data)
#Location of block-cli
blockcli=/usr/local/bin/blocknet-cli
echo "Type in COIN Symbol, ie. BTC, D, DOGE, DVT, LTC, PIVX"
read coinCheck
coinServiceNodes=$($blockcli servicenodecount | jq -r '.total')
echo "total service node(s): $coinServiceNodes"
subtractone="$(($coinServiceNodes-5))"
@buzzkillb
buzzkillb / 01nginx-tls-sni.md
Created February 1, 2021 23:08 — forked from kekru/01nginx-tls-sni.md
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
#!/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
#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
@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
#!/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')
#!/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'