Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* MPD Playlist Updater
*
* @version 0.1.0
* @since 2012-03-14
*/
define('MPCPF_VERSION', '0.1.0');
define('MPCPF_MPD_CONF', '/etc/mpd.conf');
define('MPCPF_USER', 'mpd');
#!/bin/bash
# record_vlc.sh
# Nanawel 2014
# https://lanterne-rouge.info/2014/01/num%C3%A9risation-de-vhs-sous-linux
echo "====== VHS Record (VLC) ======"
VIDEO_DEV="/dev/video0"
SOUND_DEV="alsa://hw:2,0"
NORM="SECAM_LC"
#!/bin/bash
# transcode_ffmpeg.sh
# Nanawel 2014
# https://lanterne-rouge.info/2014/01/num%C3%A9risation-de-vhs-sous-linux
echo "====== Transcode (FFmpeg) ======"
#OUTPUT=/mnt/workspace/videos/record_$(date +%s).tr.mkv
VCODEC="mpeg4" # Video codec
ACODEC="mp3" # Audio codec
@nanawel
nanawel / fix_exif_tz.sh
Last active June 7, 2022 12:05
Set or update OffsetTime and OffsetTimeOriginal EXIF tags on pictures using current timezone and pictures DateTimeOriginal
#!/bin/bash
DIR="${DIR:-$1}"
OVERWRITE_EXISTING_TZ="${OVERWRITE_EXISTING_TZ:-0}"
ECHO_ONLY="${ECHO_ONLY:-0}"
[ ! -z "$DIR" ] || { echo -e >&2 "Usage:\n\t$0 <directory>"; exit 1; }
trap 'echo -e >&2 "\nCanceled."; exit 255;' INT
@nanawel
nanawel / cleanup_docker.sh
Created December 12, 2019 08:27
Delete all untagged images and - optionally - images from specified {repository} if older than {max-age}
#!/bin/bash
#
# Usage:
# $ cleanup_docker.sh [repository max-age]
echo "Deleting untagged images...."
UNTAGGED_IMAGES=$(docker images | grep "^<none>" | awk '{print $3}')
if [ ! -z "$UNTAGGED_IMAGES" ]; then
docker rmi $UNTAGGED_IMAGES
else
@nanawel
nanawel / dnsmasq_custom-lan.conf
Created June 27, 2015 17:10
dnsmasq configuration
# http://www.drazzib.com/docs/admin/dnsmasq.html
# See also http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
bogus-priv
cache-size=512
no-resolv
no-hosts
@nanawel
nanawel / tenkitemp_
Created May 26, 2015 22:02
Munin plugin to monitor Tenki sensor Temperature
#!/bin/sh
#
# Plugin to monitor Tenki sensor Temperature
#
# Magic markers (optional - only used by munin-config and some installation scripts):
#%# family=contrib
TENKIGET=/usr/local/bin/usbtenkiget
WARN=30
CRIT=38
#!/bin/bash
# Simple Directory Watcher
# Lists the content of the specified folder and uses zenity to display
# regularly its content as notifications on the desktop.
#
# Author: Nanawel 2015-04 - nanawel {at} remove-that gmail {dot} com
DIALOG_TIMEOUT=10 # seconds
POLLING_DELAY=30 # minutes