Skip to content

Instantly share code, notes, and snippets.

View skylord123's full-sized avatar

Skylar Sadlier skylord123

  • Skylar.Tech LLC
  • č̶̢ṙ̶̥̩e̴̮̞̓͝e̵̤͚͌̈́ṕ̵͈͖y̸̨͗̑ ̶̧̍͒y̴̭̰͒̾o̴̯̹͝u̸͖̾̚ ̷͇̊͆c̶͈͚͐à̸̛̙r̸͇͙̅e̷̹̓
View GitHub Profile
@skylord123
skylord123 / completed.py
Created July 17, 2014 16:27
deluged, filebot, and plex integration
#!/usr/bin/python
import sys
import subprocess
import logging
from os import path
from deluge.ui.client import client
from twisted.internet import reactor
# Customizable filebot and script options. Lines starting with # are disbled. Remove # to enable them.
@skylord123
skylord123 / gist:892b6e30b724b81a8a48
Created November 11, 2015 05:38
Linux machine to chromcast server
Following is taken from: https://plus.google.com/111475821387295047208/posts/KDEfS6S2hyk
-------------------------
How to turn your Linux machine into a Chromecast Server
Stream YouTube, Netflix, Hulu, Etc. from your smartphone or tablet onto your server or laptop. ...without buying Chromecast hardware...
Prerequisite- Install Google Chrome on your Desktop. Install Chromecast application onto your portable device.
@skylord123
skylord123 / sithous.js
Last active February 22, 2017 19:24
Associative array helpers
/**
*
* @param a
* @param b
* @param options
* ignoreMissingKeys (false) => if true will only compare keys that exist in both objects.
* caseSensitive (true) => if false strings will be compared without case sensitivity
* boolComparison (false) => if true will also compare using the Boolean values (helps match empty strings '' and NULL for example)
* @returns {boolean}
*/
@skylord123
skylord123 / mqtt_helper.py
Last active July 30, 2017 23:46
Helper class for paho-mqtt to quickly integrate into existing sensor code (with reliable connection handling)
# Author: Skylar Sadlier
# Author URL: https://github.com/skylord123
# Script Link: https://gist.github.com/skylord123/a54ce88aa79dfcd268a1cd92b499883d
import paho.mqtt.client as mqtt_client
# - Class Terminal -
# Uses curses to draw data to the terminal window.
class MQTT_Helper():
@skylord123
skylord123 / example.js
Created August 12, 2019 16:55
Home Assistant open card full screen by entity ID
(function(ev, detail, entity=null) {
ev = new Event(ev, {
bubbles: true,
cancelable: false,
composed: true,
});
ev.detail = detail || {};
if(entity) {
entity.dispatchEvent(ev);
} else {
@skylord123
skylord123 / grafana-power-usage-dashboard.json
Created October 18, 2019 00:53
grafana-power-usage-dashboard
{
"__inputs": [
{
"name": "DS_GOLIATH_INFLUXDB",
"label": "goliath influxdb",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
@skylord123
skylord123 / gist:0cf2d2e3c558b3c928be3bd242ebf4b7
Created October 23, 2019 01:48
Node-RED flow only fire on payload changes
[{"id":"59ea6981.ad14b8","type":"mqtt in","z":"582717cf.467f78","name":"","topic":"some/input/channel","qos":"2","datatype":"auto","broker":"5a59e251.9e1d4c","x":1110,"y":260,"wires":[["fe4cd5f9.d74f98"]]},{"id":"577b26e7.fcf1c8","type":"change","z":"582717cf.467f78","name":"","rules":[{"t":"set","p":"someinput_last_value","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":260,"wires":[["e47f530b.00cea"]]},{"id":"fe4cd5f9.d74f98","type":"switch","z":"582717cf.467f78","name":"","property":"someinput_last_value","propertyType":"flow","rules":[{"t":"neq","v":"payload","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":1270,"y":260,"wires":[["577b26e7.fcf1c8"]]},{"id":"5a59e251.9e1d4c","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.10","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]
@skylord123
skylord123 / skylar.tech.conf
Last active November 16, 2019 22:56
Ghost blog letsencrypt example for skylar.tech
# I used to redirect all traffic to https but that broke
# letsencrypt validation because it needs to run on http.
#server {
# listen 80;
# server_name skylar.tech;
# return 301 https://$host$request_uri;
#}
server {
listen 80;
@skylord123
skylord123 / flow.json
Created January 20, 2020 22:44
Hue remote disabling input_boolean in Home Assistant from Node-RED
[{"id":"f984031f.c223d","type":"hue-switch","z":"ff717302.0c688","name":"Living room switch","bridge":"d2b1d65b.cbe438","sensorid":"6","x":290,"y":3680,"wires":[["229b2298.8b45fe","65985f7.4e331a"]]},{"id":"65985f7.4e331a","type":"switch","z":"ff717302.0c688","name":"Off button","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"Off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":500,"y":3720,"wires":[["ffb041d6.1476d"]]},{"id":"229b2298.8b45fe","type":"switch","z":"ff717302.0c688","name":"On button","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"On","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":500,"y":3660,"wires":[["fe8a3935.8a63d8"]]},{"id":"fe8a3935.8a63d8","type":"switch","z":"ff717302.0c688","name":"action","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"holded","vt":"str"},{"t":"eq","v":"short released","vt":"str"},{"t":"eq","v":"long released","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"
@skylord123
skylord123 / wiegand_device.h
Created June 8, 2021 21:45
My edits for ESPHOME Wiegand
#include "esphome.h"
#include <sstream>
/**
* Wiegand Reader Custom Device
*
* Copied from https://github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino
* Implemented by Greg Doerr (https://github.com/gdoerr)
*
* In my example, hooked to an Olimex ESP32-POE device connected to a Retekess H1EM-W