Skip to content

Instantly share code, notes, and snippets.

View don-code's full-sized avatar

Don Luchini don-code

View GitHub Profile
@don-code
don-code / dvr_archiver.sh
Created February 9, 2021 03:40
Transcode and burn DVRed shows to a DVD.
#!/bin/bash
set -euo pipefail
# This script determines a set of files recorded by a no-name ATSC DVR between a start and end
# date, concatenates them by recording, then transcodes then to H.264 and burns them to a DVD. It
# uses a constant bitrate for the audio track, then calculates how much of the DVD is available for
# video and calculates a bitrate for use with two-pass encoding. It also guesses whether the source
# is interlaced, and enables interlaced encoding if so.
function usage() {
@don-code
don-code / sync_music_to_mp3_player.rb
Created January 3, 2021 17:46
Sync FLAC music library to dumb MP3 players.
#!/usr/bin/env ruby
# This script syncs music to an MP3 player that only plays MP3s, according to
# the following rules:
#
# 1. Always copy files using a scheme that makes it easy to navigate based on folders:
# $ARTIST/$ALBUM/$TRACK.mp3
# 2. If the destination track already exists as an MP3, do nothing.
# 3. If the source track is an MP3, copy it without any processing.
# 4. If the source track is a FLAC, transcode it to MP3 and copy the MP3.
@don-code
don-code / connectivity_alert.sh
Created January 3, 2021 17:29
Script to detect connectivity loss on a Raspberry Pi and notify with the LEDs
#!/bin/bash
# This script will provide visual feedback that a Raspberry Pi 2B/3B has lost
# local network or Internet connectivity by blinking the two LEDs. Link state
# and Internet connectivity are represented as two different blink patterns,
# to help determine whether the Pi or the switch has had its cable fall out.
# The following table describes the LED flash patterns:
# Local | Internet | LED Flash Pattern
#=======|==========|=========================================================