note; I have all my scripts setup so that the lwt (last will and testament) publishes 'offline' if the scripts die.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#------------------------------------------------------------------------------ | |
# | |
# Automated IMDB Top 250 Plex collection script by /u/SwiftPanda16 | |
# | |
# *** Use at your own risk! *** | |
# *** I am not responsible for damages to your Plex server or libraries. *** | |
# | |
#------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title>Domain Flyover</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.8.0/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.8.0/mapbox-gl.css' rel='stylesheet' /> | |
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443 default_server ssl; | |
server_name CHANGEME | |
server_tokens off; | |
ssl_certificate CHANGEME.crt; | |
ssl_certificate_key CHANGEME.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache shared:ssl_session_cache:10m; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def degrees_to_cardinal(d): | |
''' | |
note: this is highly approximate... | |
''' | |
dirs = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", | |
"S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"] | |
ix = int((d + 11.25)/22.5) | |
return dirs[ix % 16] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <PubSubClient.h> | |
#include <ESP8266WiFi.h> | |
const char* ssid = "................."; | |
const char* password = "................"; | |
char* topic = "esp8266_arduino_out"; | |
char* server = "iot.eclipse.org"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import time | |
import datetime | |
import ephem #pyephem integration for checking if lights need to remain on | |
o=ephem.Observer() | |
o.lat='30' #change to your latitude | |
o.long='-98' #change to your longitude | |
running=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth_basic "Restricted"; | |
auth_basic_user_file /usr/local/etc/nginx/htpasswd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add this first part to the top of the functions file | |
#for reversegeo | |
import time | |
#import logging | |
from urllib import urlencode | |
from urllib2 import urlopen | |
#this filter will reverse geo the address for you | |
def OwnTracksConvertWithAdd(data): |
I use an MQTT 'bus' to communicate with openHAB.
forecast-io.py
queries a weather service once an hour and publishes retained messages to MQTT at, say,
home/weather/today/sunsetTime 1391963342
home/weather/today/sunsetTime-iso 2014-02-09T17:29:02
home/weather/today/sunsetTime-hhmm 17:29
NewerOlder