for name in $(zfs list -H -o name | grep pvc); do zfs snapshot $name@snap1; zfs send $name@snap1 | pv | gzip > ${name##*/}.gz; done
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 multiprocessing | |
from logging import LogRecord, getLogger, Logger, DEBUG | |
from logging.handlers import QueueHandler | |
from queue import Queue | |
from typing import Optional, TypedDict, List | |
from .log_combiner import log_combiner_thread | |
logger = getLogger(__name__) |
- https://askubuntu.com/questions/348838/how-to-check-available-webcams-from-the-command-line
- https://www.linuxtv.org/wiki/index.php/Saa7134-alsa
- https://www.linuxtv.org/wiki/index.php/Philips_SAA7134
- https://www.linuxtv.org/wiki/index.php/Saa713x_devices
- https://www.linuxtv.org/wiki/index.php/Saa713x_devices:_Generic_SAA7134_Card_Installation
- https://trac.ffmpeg.org/wiki/Capture/ALSA
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
from __future__ import annotations | |
from typing import Generator, TypedDict | |
from subprocess import run, CalledProcessError | |
import re | |
import logging | |
from datetime import date, datetime | |
import click | |
import yaml | |
logger = logging.getLogger(__name__) |
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 | |
set -eu | |
DEVICE="$1" # e.g.: /dev/ttyUSB0 | |
BAUD_RATE="$2" # e.g.: 115200 | |
OUTPUT_FILE="$3" # e.g.: uart.txt | |
echo "Waiting for $DEVICE to become available ..." | |
while true |
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 bash | |
# Delete old recordings. | |
DIR="$HOME/rec" | |
EXPIRE=7 | |
find $DIR -mtime +$EXPIRE -type f -delete |
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 numpy as np | |
def find_silences_of_minimum_length(data: np.array, min_length: int) -> Generator[Tuple[int, int], None, None]: | |
""" | |
Get a (start, stop) tuple for each detected silence of minimum length. | |
The start is inclusive, and the stop is exclusive, to match Python's list slicing. | |
>>> list(find_silences_of_minimum_length([1,0,1], 1)) | |
[(1, 2)] |
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
<?php | |
namespace Drupal\my_module; | |
use Drupal; | |
use Drupal\Core\Entity\Sql\SqlContentEntityStorage; | |
/** | |
* Utilities for updating field type definitions. | |
* |
NewerOlder