This file contains hidden or 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
#!/usr/bin/env python | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import json | |
import requests | |
# HTML to send to browser | |
html = """<!DOCTYPE html> | |
<html> | |
<head> <title>Moon State</title> </head> |
This file contains hidden or 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
#!/usr/bin/env python | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import json | |
import requests | |
# HTML to send to browser | |
html = """<!DOCTYPE html> | |
<html> | |
<head> <title>Moon State</title> </head> |
This file contains hidden or 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
#!/usr/bin/python3 | |
# An example Puppet External Node Classifier written in Python3 | |
# This supposes a PE Installation, as I've used PE Classes for the Master config. | |
# ***NOTICE*** This is not supported by Puppet Support and will likely cause issues | |
# if you try to raise Support Tickets on it!! | |
import sys | |
import yaml | |
node_fqdn = sys.argv[1] |
This file contains hidden or 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
#!/usr/bin/python3 | |
import RPi.GPIO as GPIO | |
from time import sleep | |
import os | |
# Define Pin Numbers | |
red1 = 4 | |
green1 = 17 | |
button1 = 14 | |
red2 = 27 |
This file contains hidden or 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
#!/usr/bin/python3 | |
from gpiozero import StatusBoard | |
import requests | |
import datetime | |
import time | |
# instantiate a StatusBoard instance | |
status = StatusBoard('gb7ny', 'gb7hi', 'gb7mw','gb7ah','gb7ni') | |
# define the check function |
This file contains hidden or 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
#!/usr/bin/python3 | |
from gpiozero import StatusBoard | |
import requests | |
import time | |
# instantiate a StatusBoard instance | |
status = StatusBoard('gb7ny', 'gb7hi', 'gb7mw','gb7ah','gb7ni') | |
# define the check function | |
def bmcheck(): |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# Stefan Pynappels, 2017 | |
# v0.1 | |
# Due to the slow refresh rate of the Pimoroni inky pHAT, this is best called at | |
# intervals from cron. I use a 15min interval on my test system. | |
# Import pre-requisite modules | |
import json |
This file contains hidden or 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
#!/usr/bin/python3 | |
import time | |
import json | |
import requests | |
import Adafruit_GPIO.SPI as SPI | |
import Adafruit_SSD1306 | |
from PIL import Image | |
from PIL import ImageFont |