Skip to content

Instantly share code, notes, and snippets.

apt-get update
apt-get -y install apache2 rcs diffutils zip cron make gcc g++ pkg-config libssl-dev

# http://twiki.org/cgi-bin/view/TWiki/HowToInstallCpanModules
$ perl -MCPAN -e shell
@bitkevin
bitkevin / create_witness_tx.md
Created January 8, 2017 12:47
How to create witness transaction
$ bitcoin-cli -testnet sendtoaddress 2MyqgzMDEfHKA5ojRC3TsX2axusMAvhWkL9 0.01
905950ff1956eed8dd73e58c48513f4667155174c1cc09a2df1968251ee218bd

$ bitcoin-cli -testnet createrawtransaction '[{"txid":"905950ff1956eed8dd73e58c48513f4667155174c1cc09a2df1968251ee218bd","vout":0}]' '{"myxopLJB19oFtNBdrAxD5Z34Aw6P8o9P8U":0.00999}'
0100000001bd18e21e256819dfa209ccc174511567463f51488ce573ddd8ee5619ff5059900000000000ffffffff01583e0f00000000001976a914ca560088c0fb5e6f028faa11085e643e343a8f5c88ac00000000

$ bitcoin-cli -testnet signrawtransaction 0100000001bd18e21e256819dfa209ccc174511567463f51488ce573ddd8ee5619ff5059900000000000ffffffff01583e0f00000000001976a914ca560088c0fb5e6f028faa11085e643e343a8f5c88ac00000000

$ bitcoin-cli -testnet sendrawtransaction 01000000000101bd18e21e256819dfa209ccc174511567463f51488ce573ddd8ee5619ff505990000000001716001487e7923368fa194652b31bc1446875fb3725eeb2ffffffff01583e0f00000000001976a914ca560088c0fb5e6f028faa11085e643e343a8f5c88ac02483045022100aa96c948657e3b34657581a9bb566454c6717b5
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.4.0-xilinx-g5c7743c07f0e-dirty (build@fdaf2a0038a4) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3560-79f57e422d) ) #0 SMP PREEMPT Tue Nov 27 15:24:48 2018
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: AntMiner S9 Miner Control Board
[ 0.000000] cma: Reserved 16 MiB at 0x3e000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 258048
[ 0.000000] free_area_init_node: node 0, pgdat c07e3080, node_mem_map ef818000
[ 0.000000] Normal zone: 1536 pages used for memmap
#!/bin/bash
IP=$1
STATS_JSON=`echo -n '{"command":"summary"}' | nc "$1" 4028 |json_pp`
GHS_5s=`echo "$STATS_JSON" | grep "GHS 5s" |awk -F'"' '{print $4}'`
GHS_avg=`echo "$STATS_JSON" | grep "GHS av" |awk -F':' '{print $2}' |awk -F',' '{print $1}' | tr -d '[:space:]'`
DATESTR=`date '+%Y-%m-%d %H:%M:%S'`
FILE=`date '+%Y-%m-%d'`
echo $DATESTR,$GHS_5s,$GHS_avg >> /home/xxx/dev/"$1"-"$FILE".txt