This file contains 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
#!/usr/bin/env python | |
# THIS FILE IS A MAAAAAAAAAAAASSIVE HACK QUICKLY MADE FOR THE ONLINE PGCON_2020 | |
# There is DEFINITELY a better way to do this. | |
import argparse | |
import datetime | |
import sched | |
import socket | |
import sys | |
import time |
This file contains 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
[global_tags] | |
srv_loc="home" | |
srv_vtype="real" | |
srv_purpose="chia-plotter" | |
srv_owner="internal" | |
[agent] | |
interval = "60s" | |
round_interval = true | |
metric_batch_size = 1000 |
This file contains 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
#!/usr/bin/env python3 | |
import os | |
from pprint import pprint as pp | |
import shutil | |
import socket | |
import sys | |
import typing as th | |
# Largest plot size seen is 108,935,751,977, and smallest is 108,232,347,648. For |
This file contains 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
def daysToWin(netspaceFraction, confidence = 0.95, challengesPerDay = 4608): | |
losingProbability = 1 - netspaceFraction | |
challengesToWin = math.log(1 - confidence, losingProbability) | |
return challengesToWin / challengesPerDay | |
def earningsPerYear(xchValue_USD, netspaceFraction, confidence = 0.95, challengesPerDay = 4608, xchPerWin = 2): | |
xchPerDay = xchPerWin / daysToWin(netspaceFraction, confidence, challengesPerDay) | |
dailyUSD = xchValue_USD * xchPerDay | |
return dailyUSD * 365 |
This file contains 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
import pathlib | |
import yaml | |
def _path_representer(dumper, data): | |
return dumper.represent_scalar("!Path", str(data)) | |
def _path_constructor(loader, node): | |
value = loader.construct_scalar(node) | |
return pathlib.Path(value) |
This file contains 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/sh | |
# This dumps the sum of file size changes (completely ignoring git repo compression) | |
git rev-list --all --max-parents=1 | nl -v 0 | while read index commit; do \ | |
size=$(git ls-tree -r --long "$commit" | awk '{total+=$4} END {print total}'); \ | |
parent=$(git rev-parse "$commit^" 2>/dev/null); \ | |
parent_size=$(git ls-tree -r --long "$parent" | awk '{total+=$4} END {print total}'); \ | |
delta=$((size - parent_size)); \ | |
short_hash=$(git rev-parse --short "$commit"); \ |
OlderNewer