Requires PiKVM OS version 2022.06.20 or newer.
-
Install ZeroTier, then start and stop it to generate an identity
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) | |
} |
example usage:
const envArray = [
'PATH=/usr/local/bin:/usr/bin:/usr/sbin',
'HOME=/home/alex',
'FOO=bar'
];
const envObject = toEnvObject(envArray);
import React from 'react'; | |
export interface $TM_FILENAME_BASE$Props { | |
} | |
const $TM_FILENAME_BASE$: React.FC<$TM_FILENAME_BASE$Props> = props => { | |
return ( | |
<> | |
$END$ |