Skip to content

Instantly share code, notes, and snippets.

Avatar

Felix Eckhofer tribut

View GitHub Profile
@tribut
tribut / ds102-3.yaml
Created Aug 6, 2019
Esphome config for DS102 (3 Gang)
View ds102-3.yaml
substitutions:
device_name: your_device_name
friendly_name: "Your Device Name"
api_password: !secret api_password
ota_password: !secret ota_password
esphome:
name: ${device_name}
platform: ESP8266
board: esp01_1m
@tribut
tribut / ds102-1.yaml
Last active Jan 31, 2020
Esphome config for DS102 (1 Gang)
View ds102-1.yaml
substitutions:
device_name: your_device_name
friendly_name: "Your Device Name"
api_password: "pass1"
ota_password: "pass2"
esphome:
name: ${device_name}
platform: ESP8266
board: esp01_1m
@tribut
tribut / VirtualBox
Created Jul 5, 2019
Workaround for VirtualBox and dark mode themes
View VirtualBox
#!/bin/sh
# This is a workaround for Virtualbox drawing white text on light background
# when using dark mode, see https://www.virtualbox.org/ticket/18258
exec "$(which -a VirtualBox | grep -v "$(readlink -e "$0")" | head -n1)" -style Fusion "$@"
@tribut
tribut / git-safe-clone.sh
Last active Nov 10, 2019
Git clone with signature verification
View git-safe-clone.sh
#!/bin/sh
# Clone a git repository, but make sure that it has a valid signature
# before actually checking it out.
#
# Note that this will always clone the master branch and probably doesn't
# exactly behave like "git clone" in other ways.
set -e
fail() {
echo "$*" >&2
@tribut
tribut / jpgsplit.sh
Created Apr 9, 2018
Split Samsung Motion Photo from files and strip video from original file / Samsung Bewegungsaufnahme aus Datei extrahieren und Video aus Originalbild entfernen
View jpgsplit.sh
#!/bin/bash
set -e
info() {
echo "$*" >&2
}
warn() {
info "WARNING: $*"
}
@tribut
tribut / backup-owncloud.sh
Created Oct 20, 2015
Backup ownCloud calendar and contacts to a git repository
View backup-owncloud.sh
#!/bin/sh
MYNAME="$(readlink -f "$0")"
BASEDIR="$(dirname "$MYNAME")"
AUTHFILE="$HOME/private/owncloud"
CURL="curl --netrc-file $AUTHFILE --fail --silent --show-error"
CONTACTSPATH="$BASEDIR/contacts"
CALENDARSPATH="$BASEDIR/calendars"
@tribut
tribut / btrfs-scrub.sh
Created Sep 15, 2015
Btrfs scrub cronjob with logs from systemd's journalctl
View btrfs-scrub.sh
#!/bin/sh
# also see http://marc.merlins.org/perso/btrfs/post_2014-03-19_Btrfs-Tips_-Btrfs-Scrub-and-Btrfs-Filesystem-Repair.html
for fs in $(grep ' btrfs ' /proc/mounts | cut -d' ' -f1 | sort -u)
do
starttime="$(date "+%Y-%m-%d %H:%M:%S")"
logger "Starting btrfs scrub on $fs"
btrfs scrub start -Bd "$fs"
journalctl -q -k --since "$starttime" | grep BTRFS
@tribut
tribut / vcsh-new.sh
Created Sep 10, 2015
Create new repo for mr/vcsh
View vcsh-new.sh
#!/bin/sh
set -e
repourl="$1"
reponame="$(echo "$repourl" | sed -r 's#.*/([^.]+).git#\1#')"
status() {
echo "[vcsh-new] $@" >&2
}
@tribut
tribut / keybase.md
Created Apr 15, 2014
Keybase Identification
View keybase.md

Keybase proof

I hereby claim:

  • I am tribut on github.
  • I am tribut (https://keybase.io/tribut) on keybase.
  • I have a public key whose fingerprint is 7A3D F066 029F B9FF C538 1AF5 B454 3DCD E458 BF73

To claim this, I am signing this object:

View apg.sh
#!/bin/sh
if [ -x /usr/bin/apg ]; then
if [ -z "$1" ]; then
/usr/bin/apg -m 10 -x 15 -n 1 -a 1
else
/usr/bin/apg $@
fi
elif [ -x /usr/bin/pwgen ]; then
if [ -x /usr/bin/shuf ]; then