Skip to content

Instantly share code, notes, and snippets.

View benjaminbellamy's full-sized avatar

Benjamin Bellamy benjaminbellamy

View GitHub Profile
@benjaminbellamy
benjaminbellamy / WebLEDStripMobile.ino
Created December 19, 2012 16:44
iPhone controlled / Arduino Powered Christmas rgb LED Strip
// iPhone controlled / Arduino Powered Christmas rgb LED Strip
/* https://github.com/adafruit/LPD8806 */
/* https://github.com/sirleech/Webduino */
/* Web_AjaxRGB_mobile.pde - example sketch for Webduino library */
/* - offers web-based slider controllers for RGB led - */
#include "SPI.h"
#include "Ethernet.h"
@benjaminbellamy
benjaminbellamy / media-to-flac-split.sh
Created February 3, 2023 09:59
Splits a media file (such as mkv) into flac files, one file per chapter
#!/bin/bash
# Splits a media file (such as mkv) into flac files, one file per chapter
if [[ $# -ne 2 ]] ; then
echo 'Syntax: media-to-flac-split.sh input-file.mkv stream-number'
exit 1
fi
DIRECTORY="${1//[\. \"\']/-}-stream-$2"
mkdir -p $DIRECTORY
ffprobe -i $1 2>&1 | grep "Chapter #" | sed -E "s/ *Chapter #[0-9]+.([0-9]+): start ([0-9]+.[0-9]+), end ([0-9]+.[0-9]+)/-map 0:$2 -ss \2 -to \3 -metadata track=\"\1\" $DIRECTORY\/track-\1.flac/" | xargs ffmpeg -y -i $1