Requires PiKVM OS version 2022.06.20 or newer.
-
Install ZeroTier, then start and stop it to generate an identity
| fetch({ | |
| method: 'GET', | |
| url: 'https://www.solsystems.com/services/srecs/', | |
| headers: { | |
| 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:143.0) Gecko/20100101 Firefox/143.0', | |
| 'Accept-Language': 'en-US,en;q=0.5', | |
| } | |
| }) | |
| .then(response => response.text()).then(response => { | |
| const dom = new DOMParser().parseFromString(response, 'text/html') |
| #!/usr/bin/python3 | |
| # run `pip3 install --user astral` or `apt install python3-astral` first | |
| # install to `~/.local/libexec/update-theme-switcher-sunrise-sunset.py` | |
| import json | |
| import os | |
| import subprocess | |
| from pathlib import Path | |
| from astral import Observer, sun |
| export default <T>(promise: Promise<T>, ac: AbortController): Promise<T> => { | |
| if (ac.signal.aborted) { | |
| return Promise.reject(ac.signal); | |
| } | |
| return new Promise((resolve, reject) => { | |
| ac.signal.addEventListener('abort', () => { | |
| reject(ac.signal); | |
| }); |
| #!/usr/bin/env python3 | |
| import subprocess | |
| import sys | |
| import time | |
| MEASUREMENT_NAME = "nut" | |
| UPS_STATUS = { | |
| "OL": "Online", |
| import os | |
| import time | |
| from collections import defaultdict | |
| from datetime import timedelta | |
| from enum import Enum | |
| from typing import Dict, List, Optional | |
| import requests | |
| from _pytest.config import Config | |
| from _pytest.config.argparsing import Parser |
| import logging | |
| from types import FunctionType | |
| class MethodCallLoggingMetaclass(type): | |
| def __new__(mcs, name, bases, attrs): | |
| for attr_name, attr_value in attrs.items(): | |
| if isinstance(attr_value, FunctionType): | |
| attrs[attr_name] = mcs.log_wrapper(attr_value, name) | |
| return super().__new__(mcs, name, bases, attrs) |
| [Unit] | |
| Description=aplay passthrough audio from arecord | |
| BindsTo=arecord.service | |
| [Service] | |
| Environment=INPUT=/var/run/arecord | |
| ExecStart=/usr/bin/aplay $INPUT |
| #!/bin/sh | |
| set -eu | |
| borg create \ | |
| --filter AME \ | |
| --list \ | |
| --stats \ | |
| --exclude-caches \ | |
| --exclude-from "$HOME/.config/borg/exclude" \ |
| #!/usr/bin/env bash | |
| exportall() { | |
| export $(grep -v '^#' "${1:-.env}" | xargs) | |
| } |