Skip to content

Instantly share code, notes, and snippets.

View rudolfbyker's full-sized avatar
🌍
The grass withers, the flower falls, but the word of the Lord remains forever.

Rudolf Byker rudolfbyker

🌍
The grass withers, the flower falls, but the word of the Lord remains forever.
View GitHub Profile
@rudolfbyker
rudolfbyker / author.sh
Created March 30, 2024 08:12
How to mux a DVD
dvdauthor -t -o author walle_remuxed_3.mpg
export VIDEO_FORMAT=NTSC
dvdauthor -T -o author
@rudolfbyker
rudolfbyker / remove-drivers.py
Created November 2, 2023 07:26
Remove drivers newer than a given date from Windows
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__)
@rudolfbyker
rudolfbyker / grab_uart.sh
Created August 16, 2023 13:34
Wait for UART device, read it, and dump the received data to a text file and to the screen
#!/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
@rudolfbyker
rudolfbyker / purge.sh
Last active January 26, 2022 21:35
Linux ffmpeg background audio recorder
#!/usr/bin/env bash
# Delete old recordings.
DIR="$HOME/rec"
EXPIRE=7
find $DIR -mtime +$EXPIRE -type f -delete
@rudolfbyker
rudolfbyker / find_silence.py
Created October 4, 2021 18:58
Find silences in audio samples
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)]
@rudolfbyker
rudolfbyker / FieldTypeUpdateUtil.php
Created August 3, 2021 15:53
Utilities for updating Drupal field type definitions.
<?php
namespace Drupal\my_module;
use Drupal;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
/**
* Utilities for updating field type definitions.
*
@rudolfbyker
rudolfbyker / ConfigUtil.php
Created August 3, 2021 15:52
Utilities for managing Drupal module configuration during module updates.
<?php
namespace Drupal\my_module;
use Drupal;
use Drupal\Core\Config\FileStorage;
/**
* Utilities for managing module configuration during module updates.
*
@rudolfbyker
rudolfbyker / bb-deploy-key.py
Created February 18, 2020 14:23
Add deploy key to multiple Bitbucket repositories
#!/usr/bin/env python
import argparse
import requests
import os
import getpass
parser = argparse.ArgumentParser(description='Add deployment key to bitbucket repository.')
parser.add_argument('-a', '--accountname', help='The team or individual account.', type=str, required=True)
parser.add_argument(
'-r',
// Go to https://www.youtube.com/playlist?list=WL&disable_polymer=true
// Open the javascript console (CTRL+SHIFT+K in Firefox)
// Run the following code:
function loadMore() {
// Click the "Load More" button
var el = document.getElementsByClassName('browse-items-load-more-button');
if (el.length) {
el[0].click();
return true;