Last active
March 12, 2018 10:12
-
-
Save krtschmr/a915ee7fa9c9c42961a2376dfebf208b to your computer and use it in GitHub Desktop.
Revisions
-
krtschmr renamed this gist
Mar 12, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
krtschmr revised this gist
Mar 12, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,11 +27,13 @@ while 1: status, output = commands.getstatusoutput("echo '{\"id\":0,\"jsonrpc\":\"2.0\",\"method\":\"miner_getstat1\"}' | netcat localhost 3333") j = json.loads(output) current = sum(map(int, j["result"][3].split(";"))) / 1000.0 if(max < current): max = current # if we have less then 50% of our max hashrate, some shit with claymore went wrong. in our case a nicehash disconnect. if( max > 0.00 and (current/max * 100.0) < 50.0): DumpActivity("Reboot initiated | Max: " + str(max) + " | Current: " + str(current)) os.system("sudo reboot") break -
krtschmr revised this gist
Mar 12, 2018 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import commands import json gDebugMode = 1 gLogFile = "/home/ethos/gpu_hashrates.log" def DumpActivity(dumpStr): print dumpStr @@ -36,7 +35,7 @@ while 1: DumpActivity("Reboot initiated | Max: " + str(max) + " | Current: " + str(current)) os.system("sudo reboot") break time.sleep(30)
-
krtschmr created this gist
Mar 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ #!/usr/bin/python import os import sys import time import datetime import commands import json gDebugMode = 1 gLogFile = "/home/ethos/gpu_hashrates.log" gRigName = commands.getstatusoutput("cat /etc/hostname")[1] def DumpActivity(dumpStr): print dumpStr pLogFile = open(gLogFile, "a") pLogFile.write("%s @ %s\n" % (dumpStr, str(datetime.datetime.now()))) pLogFile.close() # wait till 4 minutes runtime, so we can be sure that mining did start while( float(commands.getstatusoutput("cat /proc/uptime")[1].split()[0]) < 4 * 60): time.sleep(5) current = 0 max = 0 # start checking while 1: status, output = commands.getstatusoutput("echo '{\"id\":0,\"jsonrpc\":\"2.0\",\"method\":\"miner_getstat1\"}' | netcat localhost 3333") j = json.loads(output) current = sum(map(int, j["result"][3].split(";"))) / 1000.0 if(max < current): max = current # if we have less then 50% of our max hashrate, some shit with claymore went wrong. in our case a nicehash disconnect. if( (current/max * 100.0) < 50.0): DumpActivity("Reboot initiated | Max: " + str(max) + " | Current: " + str(current)) os.system("sudo reboot") break time.sleep(25)