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
davidjb / homeassistant-rc.d
Created Apr 13, 2019
FreeBSD rc.d script to run Home Assistant
View homeassistant-rc.d
#!/bin/sh
#
# Based upon work by tprelog at https://www.ixsystems.com/community/resources/fn-11-2-iocage-home-assistant-jail-plugins-for-node-red-mosquitto-amazon-dash-tasmoadmin.102/
#
# PROVIDE: homeassistant
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# homeassistant_enable: Set to YES to enable the homeassistant service.
# Default: NO
@davidjb
davidjb / snx_ir_ctl-README-translated.md
Last active Oct 29, 2017
SNX IR CTRL Documentation
View snx_ir_ctl-README-translated.md
IR_CTRL
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
davidjb / shibboleth-debug.md
Created Oct 27, 2017
Shibboleth debugging steps
View shibboleth-debug.md

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
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>
[style], * {
background-attachment: scroll !important;
}
</style>
@davidjb
davidjb / rpm-guide.rst
Last active Aug 31, 2017
Helpful resources for RPM building
View rpm-guide.rst
@davidjb
davidjb / fix-centos6-vagrant.sh
Created Aug 23, 2017
Fix vagrant configuration
View fix-centos6-vagrant.sh
sudo wget http://download.virtualbox.org/virtualbox/4.3.30/VBoxGuestAdditions_4.3.30.iso -O vbox.iso
sudo mount -o loop vbox.iso /media
sudo /media/VBoxLinuxAdditions.run uninstall
sudo yum install -y kernel kernel-devel
# Now, reboot and vb-guest will auto-install the correct version
@davidjb
davidjb / inject.js
Created Jan 5, 2017
Adding JS/CSS into a live page
View inject.js
// These could be anything
var js = 'https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js'
var css = 'https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css'
$.getScript(js)
$('body').append('<link href="' + css + '" rel="stylesheet">')
@davidjb
davidjb / recovery.sh
Created Dec 21, 2016
Create macOS Sierra Recovery Partition Without Reinstalling
View recovery.sh
TARGET="/Volumes/Macintosh HD" # Specify where to configure Recovery partition
MACOS_INSTALLER="/Applications/Install\ macOS\ Sierra.app" # 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 http://support.apple.com/downloads/DL1464/en_US/RecoveryHDUpdate.dmg -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
davidjb / readme.md
Created Sep 29, 2016
Certbot install and certificate renewal for nginx
View readme.md
  • Install Certbot (via https://certbot.eff.org/)

  • 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.

@davidjb
davidjb / nbsp-bug.html
Created Aug 2, 2016
Squiz Matrix Viper &nbsp; bug
View nbsp-bug.html
<!-- When the following snippet is pasted into the source code editor, this code
including the whitespace indentation (which fits into a well-formatted HTML document):
-->
<p class="card-text">
With temperatures near 30&deg;C and 600mm of rain a year, Fletcherview has a dry
season of 6 to 9 months.
</p>
<!-- turns into this. Note the &nbsp; chars break the layout: -->
<p class="card-text">
You can’t perform that action at this time.