Skip to content

Instantly share code, notes, and snippets.

View dale3h's full-sized avatar

Dale Higgs dale3h

View GitHub Profile
@dale3h
dale3h / udp-forward.js
Last active December 14, 2015 22:37
Simple NodeJS UDP forwarding server
/**
* 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 February 23, 2017 17:54
Default YAML Configuration for Home Assistant 0.38.3
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 / radarr-bulk.bookmarklet
Last active October 12, 2017 00:28
[Radarr] Bulk Import: Compare and Highlight
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 October 20, 2017 18:40
unRAID Docker Template for FIND
<?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 / switchmate-notes.md
Created August 24, 2017 05:24
Notes for setting up Switchmate on Linux with python3

Switchmate Notes

node-switchmate

Status: working Adapter: ASUS BLE4.0

$ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
@dale3h
dale3h / custom_components--automation--mqtt.py
Last active April 3, 2018 15:53
Parse Modbus MQTT Data with Home Assistant
# 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 April 6, 2018 00:13
Time and button restricted light control
################################################################
## 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 April 6, 2018 19:18
I2C based light with dimming
################################################################
## Packages / Dimmer Test
##
## @description I2C based light with dimming
## @component input_number, light, shell_command
## @license MIT
## @author Dale Higgs <@dale3h>
################################################################
################################################
@dale3h
dale3h / telnet-wrapper.sh
Created April 19, 2018 03:24
[Home Assistant] Hass.io - Install Packages and Execute Telnet Command
#!/bin/bash
################################################################
## @usage telnet-wrapper.sh "uptime"
## @usage telnet-wrapper.sh "ping -c1 10.0.0.2"
## @description Install Alpine packages and run telnet command
## @license MIT
## @author Dale Higgs <@dale3h>
################################################################
@dale3h
dale3h / clog
Created April 19, 2018 19:03
[Hass.io] Colored Log Viewer for Home Assistant
#!/bin/bash
################################################################
## @usage clog folder_watcher=magenta,system_log=red
## @colors https://www.npmjs.com/package/colors#text-colors
## @license MIT
## @author Dale Higgs <@dale3h>
################################################################
[[ -n "$(command -v apk)" ]] \