Skip to content

Instantly share code, notes, and snippets.

View askz's full-sized avatar
🎯
Focusing

Max: askz

🎯
Focusing
View GitHub Profile
@askz
askz / create-mysql.bash
Created May 16, 2017 17:58 — forked from omeinusch/create-mysql.bash
Simple bash script to create mysql db, user with generated password
#!/bin/bash
# The script will fail at the first error encountered
set -e
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
@askz
askz / le-renew.sh
Created November 7, 2017 14:58
Renew Let's Encrypt certificates and put them in HAProxy ssl folder
#!/bin/bash
# Let's encrypt: renew certificates and put them in haproxy ssl folder for reloading.
# Maxime Saddok <maxime@businessagile.eu>
# put in /etc/cron.weekly/le-renew && chmod +x /etc/cron.weekly/le-renew
set -x
set -e
/opt/letsencrypt/letsencrypt-auto --standalone --standalone-supported-challenges http-01 --http-01-port 9999 renew;
______________________________________________________ test_getting_list_of_oauth2_clients_by_authorized_user[auth_scopes0] ______________________________________________________
flask_app_client = <AutoAuthFlaskClient <Flask 'app'>>
regular_user = <User(id=1, username="regular_user", email="regular_user@email.com", is_internal=False, is_admin=False, is_regular_user=True, is_active=True, )>
regular_user_oauth2_client = <app.modules.auth.models.OAuth2Client object at 0x7ff93a0b7710>, auth_scopes = ['auth:read']
@pytest.mark.parametrize('auth_scopes', (
['auth:read'],
['auth:read', 'auth:write'],
))
komodo-core_1 | Executing: komodod -printtoconsole -txindex=1 -rpcuser=test -rpcpassword=net -ac_supply=257142857 -gen -datadir=/home/komodo/.komodo/TESTKMD -ac_name=TESTKMD
komodo-core_1 | call komodo_args.(komodod) NOTARY_PUBKEY.()
komodo-core_1 | >>>>>>>>>> TESTKMD: port.10782/10783 magic.7e51ad18 2119281944 257142857 coins
komodo-core_1 | error creating (genTESTKMD)
komodo-core_1 | initialized TESTKMD
komodo-core_1 | Zcash version v1.0.15-10d5104 (2018-04-17 15:42:39 +0300)
komodo-core_1 | Komodo version v1.0.15-10d5104 (2018-04-17 15:42:39 +0300)
komodo-core_1 | Using OpenSSL version OpenSSL 1.1.0d 26 Jan 2017
komodo-core_1 | Using BerkeleyDB version Berkeley DB 6.2.23: (March 28, 2016)
komodo-core_1 | Default data directory /home/komodo/.komodo/TESTKMD
@askz
askz / bitcoin-monitor.md
Created May 11, 2018 10:04 — forked from ageis/bitcoin-monitor.md
Prometheus exporter for monitoring statistics of Bitcoin daemon

bitcoind-monitor.py

This is a script written in Python intended to run alongside a Bitcoin node and export statistics for monitoring purposes. It assumes the existence of bitcoin-cli in the PATH and access to the RPC interface over localhost.

It tracks stuff like: block height, difficulty, number of peers, network hash rate, errors, uptime in seconds, mempool size, size of recent blocks, number of transactions within blocks, chaintips, total bytes received and sent, and transaction inputs and outputs. These Bitcoin metrics are refreshed once every 5 minutes.

How it works

Prometheus is a monitoring system and time-series database.

@askz
askz / rpc.sh
Last active May 29, 2018 08:02
Universal rpc call
#!/bin/bash
TICKER=$(echo $1 | tr '[:upper:]' '[:lower:]')
METHOD=$2
PARAMS="${@:3}"
RPCUSER=main
RPCPORT=net
function join_by { local IFS="$1"; shift; echo "$*"; }