Wednesday, August 9, 2017

Bash (Unix shell): Converting Bitcoin Cash Amount to Yen

Command:

$ cat ./cryptocurrency_price_bittrex.sh


Result:

#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 PAIR AMOUNT" >&2
exit 1
fi

pair=$1;
amount=$2;
yenrate=$(curl -s "https://coincheck.com/api/rate/BTC_JPY" | python -c "import sys, json; print json.load(sys.stdin)['rate']");
curl -s "https://bittrex.com/api/v1.1/public/getticker?market=$pair" | python -c "import sys, json; print float(json.load(sys.stdin)['result']['Last']) * float(sys.argv[1]) * float(sys.argv[2])" $amount $yenrate


Command (How many Yen for 0.19 Bitcoin Cash):

$ ./cryptocurrency_price_bittrex.sh BTC-BCC 0.19


Result:

7461.446566

Tuesday, August 1, 2017

Pyocotan (ピョコタン): 喫茶店でニコ生してたら「高校生の頃からずっとファンです」という巨乳美女が突然やってきた!!【現代版ツルの恩返し】【ピョコタン】

Bash (Unix shell): Getting Cryptocurrency Price Using API

Command:

$ cat cryptocurrency_price.sh


Result:

#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 PAIR AMOUNT" >&2
exit 1
fi
pair=$1; amount=$2; curl -s "https://coincheck.com/api/rate/$pair" | python -c "import sys, json; print float(json.load(sys.stdin)['rate']) * float(sys.argv[1])" $amount


Command:

$ ./cryptocurrency_price.sh


Result:

Usage: ./cryptocurrency_price_jpy.sh PAIR AMOUNT


Command:

$ ./cryptocurrency_price.sh btc_jpy 1


Result:

318146.0


Command:

$ ./cryptocurrency_price_jpy.sh eth_jpy 13.5


Result:

303218.972773


Command:

$ ./cryptocurrency_price_jpy.sh xem_jpy 1000


Result:

18703.59758

Monday, July 31, 2017

macOS Sierra: Fixing Compile Error ‘openssl/sha.h’ file not found

Command:

cd /usr/local/include
ln -s ../opt/openssl/include/openssl .

Mining Monacoin

Command:

$ ./minerd -o stratum+tcp://jp.lapool.me:3015 -u USERNAME.user -p password


Result:

[2017-07-31 03:07:56] Starting Stratum on stratum+tcp://jp.lapool.me:3015
[2017-07-31 03:07:56] Binding thread 0 to cpu 0
[2017-07-31 03:07:56] Binding thread 1 to cpu 1
[2017-07-31 03:07:56] 4 miner threads started, using 'scrypt' algorithm.
[2017-07-31 03:07:56] Binding thread 2 to cpu 2
[2017-07-31 03:07:56] Binding thread 3 to cpu 3
[2017-07-31 03:07:57] thread 1: 4104 hashes, 12.37 khash/s
[2017-07-31 03:07:57] thread 3: 4104 hashes, 12.05 khash/s
[2017-07-31 03:07:57] thread 0: 4104 hashes, 12.01 khash/s
[2017-07-31 03:07:57] thread 2: 4104 hashes, 11.66 khash/s
[2017-07-31 03:07:57] thread 2: 2208 hashes, 7.61 khash/s
[2017-07-31 03:07:57] accepted: 0/1 (0.00%), 44.05 khash/s (booooo)
[2017-07-31 03:08:02] thread 3: 37104 hashes, 7.97 khash/s
[2017-07-31 03:08:02] accepted: 0/2 (0.00%), 39.96 khash/s (booooo)
[2017-07-31 03:08:03] thread 2: 43224 hashes, 7.99 khash/s
[2017-07-31 03:08:03] accepted: 0/3 (0.00%), 40.34 khash/s (booooo)
[2017-07-31 03:08:05] thread 1: 65616 hashes, 7.82 khash/s
[2017-07-31 03:08:05] accepted: 0/4 (0.00%), 35.79 khash/s (booooo)
[2017-07-31 03:08:08] thread 1: 17208 hashes, 6.75 khash/s
[2017-07-31 03:08:08] accepted: 0/5 (0.00%), 34.72 khash/s (booooo)
[2017-07-31 03:08:10] thread 0: 95040 hashes, 7.53 khash/s
[2017-07-31 03:08:10] accepted: 0/6 (0.00%), 30.24 khash/s (booooo)
[2017-07-31 03:08:16] thread 2: 95928 hashes, 6.99 khash/s
[2017-07-31 03:08:16] accepted: 0/7 (0.00%), 29.24 khash/s (booooo)
[2017-07-31 03:08:16] thread 2: 528 hashes, 6.21 khash/s
[2017-07-31 03:08:16] accepted: 0/8 (0.00%), 28.45 khash/s (booooo)
[2017-07-31 03:08:17] thread 3: 108432 hashes, 7.03 khash/s
[2017-07-31 03:08:17] accepted: 0/9 (0.00%), 27.51 khash/s (booooo)
[2017-07-31 03:08:20] thread 0: 72696 hashes, 7.11 khash/s
[2017-07-31 03:08:20] accepted: 0/10 (0.00%), 27.09 khash/s (booooo)
[2017-07-31 03:08:21] thread 0: 6216 hashes, 7.79 khash/s
[2017-07-31 03:08:21] accepted: 0/11 (0.00%), 27.77 khash/s (booooo)
[2017-07-31 03:08:23] thread 0: 21888 hashes, 7.84 khash/s
[2017-07-31 03:08:23] accepted: 0/12 (0.00%), 27.82 khash/s (booooo)
[2017-07-31 03:08:29] thread 2: 87168 hashes, 7.19 khash/s
[2017-07-31 03:08:29] accepted: 0/13 (0.00%), 28.81 khash/s (booooo)
[2017-07-31 03:08:36] thread 0: 86088 hashes, 6.72 khash/s
[2017-07-31 03:08:36] accepted: 0/14 (0.00%), 27.69 khash/s (booooo)
[2017-07-31 03:08:42] thread 3: 171504 hashes, 7.01 khash/s
[2017-07-31 03:08:42] accepted: 0/15 (0.00%), 27.67 khash/s (booooo)
[2017-07-31 03:08:42] thread 2: 96096 hashes, 6.92 khash/s
[2017-07-31 03:08:42] accepted: 0/16 (0.00%), 27.40 khash/s (booooo)
[2017-07-31 03:08:45] thread 2: 20352 hashes, 7.86 khash/s
[2017-07-31 03:08:45] accepted: 0/17 (0.00%), 28.34 khash/s (booooo)
[2017-07-31 03:08:51] thread 2: 46080 hashes, 8.13 khash/s
[2017-07-31 03:08:51] accepted: 0/18 (0.00%), 28.60 khash/s (booooo)
[2017-07-31 03:08:57] thread 0: 160416 hashes, 7.78 khash/s
[2017-07-31 03:08:57] accepted: 0/19 (0.00%), 29.67 khash/s (booooo)
[2017-07-31 03:09:02] thread 0: 45216 hashes, 8.21 khash/s
[2017-07-31 03:09:02] accepted: 0/20 (0.00%), 30.09 khash/s (booooo)
[2017-07-31 03:09:03] thread 1: 404808 hashes, 7.41 khash/s
[2017-07-31 03:09:17] thread 0: 118200 hashes, 8.21 khash/s
[2017-07-31 03:09:17] accepted: 0/21 (0.00%), 30.76 khash/s (booooo)
[2017-07-31 03:09:20] thread 0: 25440 hashes, 8.41 khash/s
[2017-07-31 03:09:20] accepted: 0/22 (0.00%), 30.96 khash/s (booooo)
[2017-07-31 03:09:22] thread 1: 156528 hashes, 8.20 khash/s
[2017-07-31 03:09:22] accepted: 0/23 (0.00%), 31.75 khash/s (booooo)
[2017-07-31 03:09:26] thread 1: 31464 hashes, 7.68 khash/s
[2017-07-31 03:09:26] accepted: 0/24 (0.00%), 31.23 khash/s (booooo)
[2017-07-31 03:09:36] thread 3: 420600 hashes, 7.75 khash/s
[2017-07-31 03:09:38] thread 2: 365136 hashes, 7.66 khash/s
[2017-07-31 03:09:38] accepted: 0/25 (0.00%), 31.50 khash/s (booooo)
[2017-07-31 03:09:56] thread 3: 140232 hashes, 6.79 khash/s
[2017-07-31 03:09:56] accepted: 0/26 (0.00%), 30.55 khash/s (booooo)
[2017-07-31 03:10:16] thread 2: 265632 hashes, 7.13 khash/s
[2017-07-31 03:10:16] accepted: 0/27 (0.00%), 30.02 khash/s (booooo)
[2017-07-31 03:10:16] thread 3: 143400 hashes, 7.44 khash/s
[2017-07-31 03:10:16] accepted: 0/28 (0.00%), 30.66 khash/s (booooo)
[2017-07-31 03:10:29] thread 0: 504480 hashes, 7.29 khash/s
[2017-07-31 03:10:29] thread 1: 460992 hashes, 7.25 khash/s
[2017-07-31 03:11:03] thread 0: 274176 hashes, 8.07 khash/s
[2017-07-31 03:11:03] accepted: 0/29 (0.00%), 29.90 khash/s (booooo)
[2017-07-31 03:11:09] thread 2: 428112 hashes, 8.07 khash/s
[2017-07-31 03:11:11] thread 3: 446208 hashes, 8.07 khash/s
[2017-07-31 03:11:14] thread 0: 88560 hashes, 8.03 khash/s
[2017-07-31 03:11:14] accepted: 0/30 (0.00%), 31.43 khash/s (booooo)
[2017-07-31 03:11:19] thread 2: 84456 hashes, 8.06 khash/s
[2017-07-31 03:11:19] accepted: 0/31 (0.00%), 31.41 khash/s (booooo)
[2017-07-31 03:11:23] thread 1: 435240 hashes, 8.05 khash/s
[2017-07-31 03:11:41] thread 2: 176088 hashes, 8.12 khash/s
[2017-07-31 03:11:41] accepted: 0/32 (0.00%), 32.27 khash/s (booooo)
[2017-07-31 03:11:48] thread 2: 63768 hashes, 8.27 khash/s
[2017-07-31 03:11:49] accepted: 0/33 (0.00%), 32.42 khash/s (booooo)
[2017-07-31 03:11:51] thread 2: 22248 hashes, 8.02 khash/s
[2017-07-31 03:11:51] accepted: 0/34 (0.00%), 32.17 khash/s (booooo)
[2017-07-31 03:11:53] thread 2: 12168 hashes, 8.05 khash/s
[2017-07-31 03:11:53] accepted: 0/35 (0.00%), 32.20 khash/s (booooo)
[2017-07-31 03:11:59] thread 1: 291144 hashes, 8.12 khash/s
[2017-07-31 03:11:59] accepted: 0/36 (0.00%), 32.27 khash/s (booooo)
[2017-07-31 03:12:07] thread 2: 109200 hashes, 7.83 khash/s
[2017-07-31 03:12:07] accepted: 0/37 (0.00%), 32.05 khash/s (booooo)
[2017-07-31 03:12:11] thread 3: 484248 hashes, 8.04 khash/s
[2017-07-31 03:12:13] thread 0: 481680 hashes, 8.09 khash/s
[2017-07-31 03:12:30] thread 1: 248544 hashes, 8.09 khash/s
[2017-07-31 03:12:30] accepted: 0/38 (0.00%), 32.06 khash/s (booooo)
[2017-07-31 03:12:35] thread 1: 42192 hashes, 7.81 khash/s
[2017-07-31 03:12:35] accepted: 0/39 (0.00%), 31.77 khash/s (booooo)
[2017-07-31 03:12:43] thread 3: 249072 hashes, 7.93 khash/s
[2017-07-31 03:12:43] accepted: 0/40 (0.00%), 31.66 khash/s (booooo)
[2017-07-31 03:12:45] thread 0: 249192 hashes, 7.80 khash/s
[2017-07-31 03:12:45] accepted: 0/41 (0.00%), 31.37 khash/s (booooo)
[2017-07-31 03:12:49] thread 1: 95640 hashes, 7.17 khash/s
[2017-07-31 03:12:49] accepted: 0/42 (0.00%), 30.73 khash/s (booooo)
[2017-07-31 03:12:56] thread 3: 95448 hashes, 7.31 khash/s
[2017-07-31 03:12:56] accepted: 0/43 (0.00%), 30.12 khash/s (booooo)
[2017-07-31 03:13:05] thread 0: 140160 hashes, 7.31 khash/s
[2017-07-31 03:13:05] accepted: 0/44 (0.00%), 29.63 khash/s (booooo)
[2017-07-31 03:13:05] thread 0: 4800 hashes, 8.15 khash/s
[2017-07-31 03:13:05] accepted: 0/45 (0.00%), 30.47 khash/s (booooo)
[2017-07-31 03:13:08] thread 2: 470016 hashes, 7.72 khash/s
[2017-07-31 03:13:08] thread 3: 90144 hashes, 7.45 khash/s
[2017-07-31 03:13:08] accepted: 0/46 (0.00%), 30.50 khash/s (booooo)
[2017-07-31 03:13:12] thread 2: 33912 hashes, 7.83 khash/s
[2017-07-31 03:13:12] accepted: 0/47 (0.00%), 30.61 khash/s (booooo)
[2017-07-31 03:13:15] thread 0: 76344 hashes, 7.58 khash/s
[2017-07-31 03:13:15] accepted: 0/48 (0.00%), 30.04 khash/s (booooo)
[2017-07-31 03:13:17] thread 2: 31080 hashes, 6.70 khash/s
[2017-07-31 03:13:17] accepted: 0/49 (0.00%), 28.90 khash/s (booooo)
[2017-07-31 03:13:21] thread 2: 28320 hashes, 6.79 khash/s
[2017-07-31 03:13:21] accepted: 0/50 (0.00%), 28.99 khash/s (booooo)
[2017-07-31 03:13:34] thread 2: 89424 hashes, 6.82 khash/s
[2017-07-31 03:13:34] accepted: 0/51 (0.00%), 29.03 khash/s (booooo)
[2017-07-31 03:13:38] thread 2: 28320 hashes, 6.91 khash/s
[2017-07-31 03:13:38] accepted: 0/52 (0.00%), 29.12 khash/s (booooo)
[2017-07-31 03:13:42] thread 0: 178440 hashes, 6.74 khash/s
[2017-07-31 03:13:42] accepted: 0/53 (0.00%), 28.27 khash/s (booooo)
[2017-07-31 03:13:44] thread 0: 15576 hashes, 6.00 khash/s
[2017-07-31 03:13:44] accepted: 0/54 (0.00%), 27.54 khash/s (booooo)
[2017-07-31 03:13:50] thread 1: 430272 hashes, 7.01 khash/s
[2017-07-31 03:13:52] thread 3: 300576 hashes, 6.74 khash/s
[2017-07-31 03:13:52] accepted: 0/55 (0.00%), 26.67 khash/s (booooo)
[2017-07-31 03:14:03] thread 0: 121248 hashes, 6.45 khash/s
[2017-07-31 03:14:03] accepted: 0/56 (0.00%), 27.12 khash/s (booooo)
[2017-07-31 03:14:09] thread 1: 119520 hashes, 6.30 khash/s
[2017-07-31 03:14:09] accepted: 0/57 (0.00%), 26.40 khash/s (booooo)
[2017-07-31 03:14:19] thread 3: 164664 hashes, 6.28 khash/s
[2017-07-31 03:14:19] accepted: 0/58 (0.00%), 25.94 khash/s (booooo)
[2017-07-31 03:14:25] thread 2: 292080 hashes, 6.22 khash/s
[2017-07-31 03:14:25] accepted: 0/59 (0.00%), 25.24 khash/s (booooo)
[2017-07-31 03:14:27] thread 1: 112080 hashes, 6.08 khash/s
[2017-07-31 03:14:27] accepted: 0/60 (0.00%), 25.02 khash/s (booooo)
[2017-07-31 03:14:43] thread 1: 94752 hashes, 6.22 khash/s
[2017-07-31 03:14:43] accepted: 0/61 (0.00%), 25.17 khash/s (booooo)
[2017-07-31 03:15:02] thread 3: 262752 hashes, 6.07 khash/s
[2017-07-31 03:15:02] accepted: 0/62 (0.00%), 24.96 khash/s (booooo)
[2017-07-31 03:15:03] thread 1: 120744 hashes, 6.07 khash/s
[2017-07-31 03:15:03] accepted: 0/63 (0.00%), 24.80 khash/s (booooo)
[2017-07-31 03:15:06] thread 0: 386880 hashes, 6.16 khash/s
[2017-07-31 03:15:23] thread 2: 373104 hashes, 6.44 khash/s
[2017-07-31 03:15:23] thread 3: 147168 hashes, 6.92 khash/s
[2017-07-31 03:15:23] accepted: 0/64 (0.00%), 25.59 khash/s (booooo)
[2017-07-31 03:15:33] thread 2: 70248 hashes, 7.01 khash/s
[2017-07-31 03:15:33] accepted: 0/65 (0.00%), 26.15 khash/s (booooo)
[2017-07-31 03:15:49] thread 2: 110448 hashes, 6.92 khash/s
[2017-07-31 03:15:49] accepted: 0/66 (0.00%), 26.06 khash/s (booooo)
[2017-07-31 03:15:55] thread 1: 364080 hashes, 6.94 khash/s
[2017-07-31 03:15:59] thread 0: 369480 hashes, 7.00 khash/s
[2017-07-31 03:16:24] thread 3: 415080 hashes, 6.80 khash/s

Sunday, July 30, 2017

macOS Sierra: GPU Mining Litecoin Using bfgminer

Command:

$ bfgminer -S opencl:auto -n

 [2017-07-31 00:44:09] CL Platform 0 vendor: Apple
 [2017-07-31 00:44:09] CL Platform 0 name: Apple
 [2017-07-31 00:44:09] CL Platform 0 version: OpenCL 1.2 (May 26 2017 12:59:48)
 [2017-07-31 00:44:09] Platform 0 devices: 1
 [2017-07-31 00:44:09] 0 GeForce GT 755M
 [2017-07-31 00:44:09] Unable to load ati adl library
 [2017-07-31 00:44:09] 1 GPU devices max detected


Command:

$ bfgminer --scrypt -o stratum+tcp://us2.litecoinpool.org:3333 -u USERNAME.1 -p 1 -S opencl:auto