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 json | |
import sys | |
import time | |
from datetime import datetime | |
# python3-websocket on debian, python-websocket-client on Arch | |
from websocket import ( | |
create_connection, |
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 sys | |
from datetime import datetime, timedelta | |
FILE = sys.argv[1] | |
with open(FILE, "r") as f: | |
d = f.read().strip() | |
stats = {} |
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 | |
import requests | |
import json | |
from datetime import datetime, timedelta | |
url = 'https://cfp.pass-the-salt.org/pts2022/schedule/export/schedule.json' | |
d = requests.get(url).json() |
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/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
if [ $# -lt 1 ]; then | |
echo 1>&2 "$0: Need zip file argument, e.g. sudo ./arch_install.sh nudgis-obs-plugin-linux-ubuntu-20.04-64_27.2.4_1.0.0.zip" | |
exit 2 | |
fi | |
DIR=tmp |
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 | |
# ripoff of https://github.com/RoryMearns/Windsurf_Calculator/blob/master/javascript/windcalc.js | |
weight_kg = 70 | |
sail_alpha = 1.34 | |
fin_alpha = 4.9383 | |
fin_extra = 3.0988 | |
def get_sail(wind): |
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
# you can add an alias to your bashrc to check that packages build | |
# alias makepkg_check = 'docker build -f /path/to/this/Dockerfile.archtest .' | |
FROM archlinux:latest | |
RUN pacman -Sy && pacman -S --noconfirm --noprogressbar --quiet --needed \ | |
base-devel sudo | |
RUN useradd --create-home build --home-dir /build && echo "build ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/build | |
USER build |
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 argparse | |
import sys | |
import telnetlib | |
class SMP351: | |
commands = ['get_state', 'start_record', 'stop_record'] | |
def __init__(self, args): |
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 | |
from gi.repository import Gio, GLib | |
import shlex | |
import signal | |
priority = GLib.PRIORITY_DEFAULT | |
class ProcessLauncher: | |
def run(self, cmd): |
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 | |
# run this a local checkout of https://github.com/LineageOS/lineage_wiki/tree/master/_data/devices | |
import yaml | |
import glob | |
import datetime | |
def get_year(d): | |
if isinstance(d, list): |
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/bash | |
add-apt-repository universe | |
apt update | |
apt full-upgrade -y | |
apt install -y cockpit packagekit ifupdown | |
apt purge --auto-remove -y netplan.io | |
mkdir -p /etc/NetworkManager/conf.d | |
touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf |
NewerOlder