Skip to content

Instantly share code, notes, and snippets.

Avatar

Dale Higgs dale3h

View GitHub Profile
@dale3h
dale3h / udp-forward.js
Last active Dec 14, 2015
Simple NodeJS UDP forwarding server
View udp-forward.js
/**
* Simple NodeJS UDP forwarding server
*
* @author dale3h
*
* This script was built to run on a Raspberry Pi that is connected to two networks (wired + wireless).
* By default it listens on port 443, but only serves HTTP (not HTTPS)
*
* @usage
* http://192.168.1.102:443/send-udp?host=192.168.1.113&port=12345&device=wlan0&command=PACKET_CONTENTS
@dale3h
dale3h / configuration.yaml
Created Feb 23, 2017
Default YAML Configuration for Home Assistant 0.38.3
View configuration.yaml
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 32.8208
longitude: -97.0107
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 196
# metric for Metric, imperial for Imperial
unit_system: imperial
@dale3h
dale3h / gitter-backup.sh
Created May 17, 2017
Perform local backups of Gitter.im chat rooms.
View gitter-backup.sh
#!/bin/bash
#
# Perform local backups of Gitter.im chat rooms.
GITTER_ARCHIVE_URL="https://gitter.im/%s/archives/%s"
usage() {
echo "usage: $(basename $0) -f -r <chat-room> [-o <output-dir>] [-s <YYYY/MM/DD>] [-e <YYYY/MM/DD>]" 1>&2
exit 1
}
@dale3h
dale3h / switchmate-notes.md
Created Aug 24, 2017
Notes for setting up Switchmate on Linux with python3
View switchmate-notes.md

Switchmate Notes

node-switchmate

Status: working Adapter: ASUS BLE4.0

$ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
@dale3h
dale3h / radarr-bulk.bookmarklet
Last active Oct 12, 2017
[Radarr] Bulk Import: Compare and Highlight
View radarr-bulk.bookmarklet
javascript:var bulkConfig={path:"/movies/",good:0.95,okay:0.75};jQuery.getScript("http://glench.github.io/fuzzyset.js/lib/fuzzyset.js",function(){var e=jQuery;var g=bulkConfig.path;var b=bulkConfig.good;var f=bulkConfig.okay;var c="rgba(0, 255, 0, 0.2)";var a="rgba(255, 255, 0, 0.2)";var d="rgba(255, 0, 0, 0.2)";e("div#x-movies-bulk table tbody tr").each(function(){var i=e(this).find(".series-title-cell");var m=e(i[0]);var j=e(i[1]);var h=m.find("a").text().trim();var l=j.clone().children().remove().end().text().replace(g,"").trim();cleaner=/[^a-z0-9]/ig;h=h.replace(cleaner,"");l=l.replace(cleaner,"");fz=FuzzySet([h]);score=fz.get(l)[0][0];if(!m.find(".score").length){m.append('<span><br><em>Match: <span class="score"></span>%</em></span>')}m.find(".score").text(Math.round(score*100));var k=true;if(score>=b){e(this).css("background-color",c)}else{if(score>=f){e(this).css("background-color",a)}else{k=false;e(this).css("background-color",d)}}$select=e(this).find(".select-row-cell input");if($select.prop("checke
@dale3h
dale3h / find.xml
Last active Oct 20, 2017
unRAID Docker Template for FIND
View find.xml
<?xml version="1.0"?>
<Container version="2">
<Beta>False</Beta>
<Category>HomeAutomation:</Category>
<Name>FIND</Name>
<Overview>High-precision indoor positioning framework for most wifi-enabled devices.</Overview>
<Project>https://www.internalpositioning.com/</Project>
<Support>https://github.com/schollz/find/issues</Support>
<Description>High-precision indoor positioning framework for most wifi-enabled devices.</Description>
<Registry>https://hub.docker.com/r/schollz/find/</Registry>
@dale3h
dale3h / hassio_rpi3bp
Last active Jun 12, 2019
Hass.io Installer for Raspberry Pi 3 B+
View hassio_rpi3bp
#!/bin/bash
###########################################################
###########################################################
## ##
## THIS SCRIPT SHOULD ONLY BE RUN ON A RASPBERRY PI 3 B+ ##
## ##
###########################################################
###########################################################
@dale3h
dale3h / custom_components--automation--mqtt.py
Last active Apr 3, 2018
Parse Modbus MQTT Data with Home Assistant
View custom_components--automation--mqtt.py
# File: custom_components/automation/mqtt.py
"""
Offer MQTT listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/docs/automation/trigger/#mqtt-trigger
"""
import asyncio
import json
@dale3h
dale3h / boys_room_light.yaml
Created Apr 6, 2018
Time and button restricted light control
View boys_room_light.yaml
################################################################
## Packages / Boy's Room Brightness
##
## @description Time and button restricted light control
## @component input_datetime, input_number, light, script
## @license MIT
## @author Dale Higgs <@dale3h>
################################################################
################################################
@dale3h
dale3h / dimmer_test.yaml
Created Apr 6, 2018
I2C based light with dimming
View dimmer_test.yaml
################################################################
## Packages / Dimmer Test
##
## @description I2C based light with dimming
## @component input_number, light, shell_command
## @license MIT
## @author Dale Higgs <@dale3h>
################################################################
################################################