Skip to content

Instantly share code, notes, and snippets.

David Beitey davidjb

Block or report user

Report or block davidjb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
davidjb / configuration.yaml
Last active Nov 27, 2019
MQTT-based water meter configuration for Home Assistant
View configuration.yaml
# MQTT Broker - mosquitto
broker: localhost
port: 1883
source: sensor.water_meter
cycle: hourly
davidjb / homeassistant-rc.d
Created Apr 13, 2019
FreeBSD rc.d script to run Home Assistant
View homeassistant-rc.d
# Based upon work by tprelog at
# PROVIDE: homeassistant
# KEYWORD: shutdown
# homeassistant_enable: Set to YES to enable the homeassistant service.
# Default: NO
davidjb /
Last active Oct 29, 2017
SNX IR CTRL Documentation
SN98601 IO port SN98660 IO port SN98661 IO port Design function Remarks
MS1_IO2 MS1_IO2 MS1_IO2 IR CUT Drive Control Output A
AUD1_IO3 AUD_IO0 AUD_IO0 Infrared Lamp Control
AUD1_IO4 AUD_IO1 AUD_IO1 IR CUT Drive Control Output B
MS1_IO5 AUD_IO2 AUD_IO2 Day / Night mode Detection Port
MS1_IO6 AUD_IO3 AUD_IO3 Sensor Power Control H: Enable L: Disable
MS1_IO7 AUD_IO4 AUD_IO4 Speaker SNAP01 Control H: Enable L: Disable
davidjb /
Created Oct 27, 2017
Shibboleth debugging steps

Shibboleth Debugging

Throught this whole process, if you're unsure whether a Shibboleth login session worked (such as if it looks like your application isn't getting attributes etc), you can test by accessing /Shibboleth.sso/Session after going a /Shibboleth.sso/Login cycle and it'll list various details, or state:

A valid session was not found

if it didn't work or you haven't logged in yet.

davidjb / disable-fixed-bg.html
Created Oct 10, 2017
Short snippet for disabling all fixed backgrounds on a HTML page
View disable-fixed-bg.html
[style], * {
background-attachment: scroll !important;
davidjb / rpm-guide.rst
Last active Aug 31, 2017
Helpful resources for RPM building
View rpm-guide.rst
davidjb /
Created Aug 23, 2017
Fix vagrant configuration
sudo wget -O vbox.iso
sudo mount -o loop vbox.iso /media
sudo /media/ uninstall
sudo yum install -y kernel kernel-devel
# Now, reboot and vb-guest will auto-install the correct version
davidjb / inject.js
Created Jan 5, 2017
Adding JS/CSS into a live page
View inject.js
// These could be anything
var js = ''
var css = ''
$('body').append('<link href="' + css + '" rel="stylesheet">')
davidjb /
Created Dec 21, 2016
Create macOS Sierra Recovery Partition Without Reinstalling
TARGET="/Volumes/Macintosh HD" # Specify where to configure Recovery partition
MACOS_INSTALLER="/Applications/Install\ macOS\" # Path to your macOS installer
# Remaining paths ahead are dependant on OS version
# This *should* support 10.9 and above but is only tested on 10.12
curl -L -o ~/Downloads/RecoveryHDUpdate.dmg
hdiutil mount ~/Downloads/RecoveryHDUpdate.dmg
pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg /tmp/recoveryupdate
davidjb /
Created Sep 29, 2016
Certbot install and certificate renewal for nginx
  • Install Certbot (via

  • Insert this into /etc/crontab:

    /usr/local/bin/certbot-auto renew --renew-hook "service nginx reload" --no-self-upgrade -v >> /var/log/letsencrypt/renew.log 2>&1

Check to make sure everything is working okay. This should cause nginx to auto-reload whenever there's a new cert.

You can’t perform that action at this time.