Last active
December 19, 2015 23:09
-
-
Save tjb0607/6032910 to your computer and use it in GitHub Desktop.
Dependencies: bash (bash, grep, sed, echo, date), gawk, bc
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 characters
#!/bin/bash | |
cd ~/.primecoin | |
touch ./primerate.txt | |
grep "prime/h" ./debug.log | sed "s/primemeter //" | sed "s/ prime\/h .*\/h//" >> ./primerate.txt | |
echo "" > ./debug.log | |
totalprimes=$(echo $(cat primerate.txt | sed "s/.*013.*:.* //" | awk '{if(min==""){min=max=$1}; if($1>max) {max=$1}; if($1<min) {min=$1}; total+=$1; count+=1} END {print int(total)}')/60|bc -l) | |
totaltimemined=$(echo $(date +%s)-$(date -u -d "$(head -n 1 .//primerate.txt|sed s/'\w*$'//)" +%s)+60|bc -l) | |
avgpps=$(echo "scale=2; $totalprimes/$totaltimemined"|bc -l) | |
echo $avgpps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment