Skip to content

Instantly share code, notes, and snippets.

TheLazieR Yip thelazier

Block or report user

Report or block thelazier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thelazier
thelazier / get_queue_pos.sh
Last active Mar 3, 2017
Command on Linux to get current payment queue of masternode on Dash 12.1 network.
View get_queue_pos.sh
#!/usr/bin/env bash
MNADDR=$1
dash-cli masternodelist full | grep " ENABLED" | sed -e 's/[}|{]//' -e 's/"//g' -e 's/,//g' -e 's/^ *//g'| grep -v ^$ |tr -s ' '|awk '"echo `date +%s`-\(`dash-cli masternode count enabled`\*2.6\*60\)|bc"|getline minsigtime;($8!=0||$6>minsigtime)'| sort -n -k 8 |grep -n $MNADDR |sed -e 's/:/ /g'|cut -d ' ' -f 1,6 |awk '{"dash-cli masternode count enabled"|getline mncount; print $2" "$1"/"mncount}'
@thelazier
thelazier / sum_mined_jq.sh
Last active Jun 9, 2017
Another sum Mined coins, need "jq", "bc"
View sum_mined_jq.sh
#!/bin/bash
# Need following config in dash.conf
## server=1
## rpcuser=AnythingYoulike
## rpcpassword=AnyPassword
#
# Open your wallet and unlock before run the script :)
#
# Suggestion for Loop `while true; do ./sum_mined_jq.sh || break; done`
#
View electrumx-v10_synced_DASH.txt
2017-01-07 04:35:02,781 ElectrumX server starting
2017-01-07 04:35:02,782 switching current directory to /home/electrum/electrumx-dash-db/mainnet
2017-01-07 04:35:02,823 using leveldb for DB backend
2017-01-07 04:35:02,834 created new database
2017-01-07 04:35:02,834 creating metadata diretcory
2017-01-07 04:35:02,834 software version: ElectrumX 0.10.0
2017-01-07 04:35:02,834 DB version: 5
2017-01-07 04:35:02,834 coin: Dash
2017-01-07 04:35:02,835 network: mainnet
2017-01-07 04:35:02,835 height: -1
View build-zcoind.sh
# Building zcoin daemon on alpine linux
apk --update add coreutils build-base git tar perl autoconf automake libtool linux-headers patch wget openssl-dev libevent-dev pkgconfig bzip2-dev unzip && rm -r /var/cache/apk/*
mkdir /depend
# DB 4.8
cd /depend && wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz \
&& tar -zxvf db-4.8.30.NC.tar.gz \
&& cd db-4.8.30.NC/build_unix \
&& ../dist/configure --prefix=/usr --enable-cxx --disable-shared --disable-replication \
@thelazier
thelazier / sum_mined.sh
Created Oct 27, 2016
Bash script to sum inputs from mining.
View sum_mined.sh
#!/bin/bash
# Need following config in dash.conf
## server=1
## rpcuser=AnythingYoulike
## rpcpassword=AnyPassword
#
# Open your wallet and unlock before run the script :)
#
# Suggestion for Loop `while true; do ./sum_mined.sh || break; done`
#
View keybase.md

Keybase proof

I hereby claim:

  • I am thelazier on github.
  • I am thelazier (https://keybase.io/thelazier) on keybase.
  • I have a public key whose fingerprint is 550D 524A BE74 655C 67BB C035 0933 AB55 8425 3057

To claim this, I am signing this object:

@thelazier
thelazier / clean_dash_node.bash
Created Oct 2, 2016
Check if dash has peers from same IP more than limit or not, disconnect if exceeded.
View clean_dash_node.bash
#!/bin/bash
# Require Bash version >=4
# Require jq hexdump
# Set Dash Client command
DASH_CLI=/home/dashtest/bin/dash-cli
# Set Max connection per IP
MAX_CONN_IP=5
@thelazier
thelazier / gist:c2ccafd5bfa3dda89a18
Last active Oct 7, 2016
dash-cli command shell script
View gist:c2ccafd5bfa3dda89a18
#Locking Masternode Tx with dash-cli
dash-cli masternode outputs |grep '"' |cut -d '"' -f 2,4|sed "s/\"/ /g" |awk '{print "dash-cli lockunspent false \"[{\\\"txid\\\":\\\"" $1 "\\\",\\\"vout\\\":" $2 "}]\"" }' |/bin/sh
#create mnbudget vote cmd from show using jq (deprecated)
CURR_BLOCK=$(dash-cli getinfo |jq '.blocks')
dash-cli mnbudget show |jq '.|keys[] as $name| {"\($name)"}[] |select(.Amount > 0)|select(.BlockEnd > '$CURR_BLOCK')| "dash-cli mnbudget vote \($name) \(.URL) \(.TotalPaymentCount) \(.BlockStart) \(.PaymentAddress) \(.Amount/100000000) no"' |cut -d'"' -f 2
#show mnbudget vote status
dash-cli mnbudget show |jq '.|keys[] as $name| {"\($name)"}[] | "\($name) Y:\(.Yeas) N:\(.Nays) A:\(.Abstains) \(.Ratio*100)%" '
You can’t perform that action at this time.