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 os | |
import time | |
import datetime | |
import sqlite3 | |
import re | |
def get_sensors(): | |
sensors = [] | |
for filename in os.listdir("/sys/bus/w1/devices"): | |
if re.match( r'\w{2}-\w{12}', filename ): |
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 json | |
from subprocess import Popen, PIPE | |
wg_bin = 'wg' | |
class WireGuardCommandError(Exception): pass | |
def _execute_wireguard_command(cmd, stdin=''): | |
proc = Popen([wg_bin] + cmd, stdout=PIPE, stderr=PIPE, stdin=PIPE) | |
if stdin != '': |
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
barbell_weight = 45 | |
# weight_selection = [45, 35, 25, 10, 5, 5, 2.5] | |
weight_selection = [55, 45, 35, 25, 15, 15, 10, 5, 2.5] | |
max_possible_weight = int(sum(weight_selection) * 2 + barbell_weight) | |
class ImpossibleWeight(Exception): | |
def __init__(self, weight): | |
self.weight = weight | |
def calculate_weights(desired_weight): |
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
package main | |
import ( | |
"bytes" | |
"context" | |
"errors" | |
"fmt" | |
"os" | |
"sync" |
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
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"log" | |
"os" | |
"github.com/cloudflare/cloudflare-go" |