Skip to content

Instantly share code, notes, and snippets.

View derpeter's full-sized avatar
🖖

derpeter derpeter

🖖
  • planet earth, milkiway
View GitHub Profile
# Modified adalight arduino version which uses the FastLED ( http://fastled.io/ ) library.
# I found this code at https://forums.adafruit.com/viewtopic.php?f=47&t=59464#p301431 .
# For me it works much more smooth then the original code using SPI.h .
# It works pretty well with Colorswirl boblight and hyperion
#include "FastLED.h"
#include <hsv2rgb.h>
#include <platforms.h>
#include <fastspi_types.h>
#include <colorpalettes.h>
// Uses Adalight protocol and is compatible with Boblight, Prismatik etc
// "Magic Word" for synchronisation is 'Ada' followed by LED High, Low and Checksum
// source http://thai-fighter.blogspot.de/2014/05/arduino-adalight-clone-with-any-led.html
//
#include <FastLED.h>
///// User definitions /////
// Define the number of LED Controllers
#define NUM_LEDS 30
for i in "*.m4a"; do echo ffmpeg -i $i -ab 192k "$(basename -s .m4a $i).mp3"; done
or
for i in *.m4a; do out=`echo $i | cut -d '.' -f1`; ffmpeg -i $i -ab 192k $out.mp3; done
#!/bin/sh
confdir="`dirname "$0"`/../"
. $confdir/default-config.sh
if [ -f $confdir/config.sh ]; then
. $confdir/config.sh
fi
ffmpeg -y -nostdin \
-i - \
-ac 2 \
@derpeter
derpeter / media-dl.sh
Last active December 22, 2017 11:54
Download a conference from media.ccc.de
#!/bin/sh
curl https://media.ccc.de/c/gpn17/podcast/mp4.xml | awk -F '"' '/url="/{print $2}' | wget -c -i -
#!/usr/bin/python3
import sys
import time
import threading
import os
import stat
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gst, GstNet
@derpeter
derpeter / gist:306452b1b6a8c569690a43de49145d8b
Last active October 22, 2017 09:41
reencode unsupported audio codec to a second audio track
ffmpeg -y -i in.mkv -map 0:v -c:v copy -map 0:a:0 -c:a:0 copy -map 0:a:0 -c:a:0 ac3 out.mkv
@derpeter
derpeter / reencode.sh
Created October 14, 2017 01:50
reencode all video files in an folder that a bigger than a configured value to save disk space
#!/bin/bash
MIN_SIZE=6G
IN_DIR=.
OUT_DIR=out
find $IN_DIR -maxdepth 1 -type f -size +$MIN_SIZE -exec ffmpeg -y -i {} -c:v libx264 -preset slow -tune film -profile:v high -level 4.2 -crf 23 -c:a copy -c:s copy $OUT_DIR/{} \;
@derpeter
derpeter / compare.sh
Created October 15, 2017 12:21
compare the size of files with the same filename in two directorys
#!/bin/bash
DIR1=~/bar/
DIR2=~/foo/
SIZE1=0
SIZE2=0
for file in $DIR1*; do
file2=$DIR2$(basename "$file")
if [[ -f $file ]] && [[ -f $file2 ]]; then
This can be used as a starting point for developing your own image e.g. for running MirageOS on an Pi3
You will need an arm64 / aarch64 cross compiler. You can use e.g. the cross compiler shipped by Ubuntu or get the toolchain of your choice for your OS.
apt-get install gcc-aarch64-linux-gnu
Now we setup the SD card. We need to create two partitions like shown below
Device Boot Start End Sectors Size Id Type
2018-03-13-raspbian-stretch-lite.img1 8192 93802 85611 41,8M c W95 FAT32 (LBA)