Skip to content

Instantly share code, notes, and snippets.

View bitkevin's full-sized avatar

Kevin Pan bitkevin

  • Beijing, China
View GitHub Profile
#!/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
[ 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
@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
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 / nginx_install.sh
Last active September 2, 2016 04:04 — forked from zzmmzz777/install_openresty.sh
Openresty + http2 + nginx_http_concat on Ubuntu 14.04
ROOT=/work/nginx
mkdir -p "$ROOT"
cd "$ROOT"
apt-get install -y libpcre3 libpcre3-dev
# download packages
wget http://nginx.org/download/nginx-1.10.1.tar.gz
tar zxf nginx-1.10.1.tar.gz
@bitkevin
bitkevin / Connection.h
Created June 29, 2016 10:18 — forked from roxlu/Connection.h
Basic libEvent TCP server/client wrapper
#ifndef LIBEVENT_CONNECTIONH
#define LIBEVENT_CONNECTIONH
extern "C" {
#include <event2/event.h>
#include <event2/buffer.h>
#include <event2/bufferevent.h>
}
#include <string>
diff -urN bitcoin-0.10.0/src/chainparams.cpp bitcoin-0.10.0_hub/src/chainparams.cpp
--- bitcoin-0.10.0/src/chainparams.cpp 2015-02-13 16:55:11.000000000 +0800
+++ bitcoin-0.10.0_hub/src/chainparams.cpp 2015-02-28 14:35:51.000000000 +0800
@@ -156,6 +156,7 @@
vSeeds.push_back(CDNSSeedData("bluematt.me", "dnsseed.bluematt.me"));
vSeeds.push_back(CDNSSeedData("dashjr.org", "dnsseed.bitcoin.dashjr.org"));
vSeeds.push_back(CDNSSeedData("bitcoinstats.com", "seed.bitcoinstats.com"));
+ vSeeds.push_back(CDNSSeedData("open-nodes.org", "seeds.bitcoin.open-nodes.org"));
vSeeds.push_back(CDNSSeedData("xf2.org", "bitseed.xf2.org"));

算力 API 说明

获取单个用户某个时间维度的历史算力数据

URI

https://www.tangpool.com/public/worker/share/

参数

diff --git a/configure.ac b/configure.ac
index 30b9ff5..6ff9680 100644
--- a/configure.ac
+++ b/configure.ac
@@ -400,6 +400,9 @@ if test x$use_upnp != xno; then
)
fi
+ZMQ_LIBS="-lzmq"
+LIBS="$LIBS $ZMQ_LIBS"
/*
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2011 Botond Ballo
Copyright (c) 2007-2009 iMatix Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is