Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am quantenschaum on github.
  • I am quantenschaum (https://keybase.io/quantenschaum) on keybase.
  • I have a public key whose fingerprint is EE79 0D57 FBE4 ED59 35A4 A605 59F4 B751 7603 7FD1

To claim this, I am signing this object:

#!/bin/bash
# turns power supply for active speakers on/off when sound is played/not played
# very handy on a RaspberryPi with active speakers
# you need to install "gpio" from http://wiringpi.com/ first
# see http://wiringpi.com/pins/ for pin numbers
# run this as service with
#[Unit]
#After=mpd.target
#[Service]
#ExecStart=/speakerd
@quantenschaum
quantenschaum / sms.py
Last active October 9, 2017 13:16
script to send sms via sms77.io
#!/usr/bin/env python3
"send SMS with https://www.sms77.io/"
# wget -O sms https://gist.github.com/quantenschaum/ae476d34839db61c95cee9ccbc059b5f/raw && chmod +x sms
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
parser = ArgumentParser(
description=__doc__,
formatter_class=ArgumentDefaultsHelpFormatter,
@quantenschaum
quantenschaum / hue.sh
Created October 9, 2017 12:52
simple shell script for Philips HUE
#!/bin/bash
# !!!!!!!!!!!!!! edit URL and TOKEN
URL="http://hue/api/TOKEN/lights/"
LIGHTS=""
while [[ "$1" -gt 0 ]]; do
LIGHTS="$LIGHTS $1"
shift
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=/opt/eclipse/icon.xpm
Exec=bash -c 'SWT_GTK3=0 nice -10 /opt/eclipse/eclipse'
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Eclipse
@quantenschaum
quantenschaum / u2f.rules
Created October 17, 2017 12:24
udev rules for FIDO U2F usb key, place this in `/etc/udev/rules.d/70-u2f.rules`
# Copyright (C) 2013-2015 Yubico AB
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
@quantenschaum
quantenschaum / ssl.conf
Last active January 7, 2018 16:54
nginx ssl config
# this is based on information from
# https://cipherli.st
# https://mozilla.github.io/server-side-tls/ssl-config-generator/
# https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
# https://scotthelme.co.uk/a-plus-rating-qualys-ssl-test/
# test it with https://www.ssllabs.com/ssltest/
#listen 443 ssl http2;
#listen [::]:443 ssl http2;
@quantenschaum
quantenschaum / default.conf
Created January 7, 2018 17:02
nginx default config
server {
listen 80 default_server;
server_name _;
# For Lets Encrypt, this needs to be served via HTTP
location /.well-known/acme-challenge/ {
root /var/www/html; # Specify here where the challenge file is placed
}
# enforce https
@quantenschaum
quantenschaum / kodi-setup.sh
Last active December 19, 2023 17:08
install script for kodi standalone mediacenter
#!/bin/bash
# prepare a Ubuntu server minimal installation with working network using network manager
# this works on raspbian, too
apt-get install software-properties-common -y
# install KODI
add-apt-repository ppa:team-xbmc/ppa -y
apt-get update && apt-get install -y kodi xserver-xorg xinit dbus-x11 alsa-utils avahi-daemon