Skip to content

Instantly share code, notes, and snippets.

View rgee0's full-sized avatar

Richard Gee rgee0

View GitHub Profile
@rgee0
rgee0 / pico.py
Created March 2, 2025 09:41
pico pi code for a DHT22 sensor
from machine import Pin
from dht import DHT22
import urequests as requests
import network
import ujson
import utime
import gc
SSID=''
WIFI_PASS=''
@rgee0
rgee0 / steps.md
Created October 13, 2024 06:50 — forked from lordneon/steps.md
UK Light Wiring with Shelly 1

Intro

This is a simple guide on how to automate UK lights with a Shelly 1 by installing the shelly 1 relay into the ceiling pendant which has both permanent live, neutral and a switched live back from the wall switch.

These steps are from my own experience making my lighting "smart" but also user friendly (it works via a wall switch!). This simple guide will go through replacing an a normal ceiling pendant with one with room for a Shelly 1. If you have a ceiling light with a bigger base it's even easier.

Warning Electrical regulations must be followed by law. If you are not a competent person under the regulations do not attempt electrical work. https://www.diydoctor.org.uk/projects/electrical_safety.htm

Wiring Diagram

This diagram has been taken from here and modified to include the Shelly 1. Wiring Diagram

@rgee0
rgee0 / secrets.yml
Last active January 26, 2019 22:24
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: rgee0-snowman
namespace: openfaas-fn
spec:
encryptedData:
accessSecret: AgC8QpnpxiDiorKbnWhvrnZg+QHXOzWBt+tq5WNifA53Si9iPM7yqIuBSXXz+q3Tg5iCab/y4vS9FYXOBolG7VFrsv0DRsVgjOr8luTNK0OTJ4hJ2rPXbv+vOs8EnlkIs8ST3BJ44wz2eL4gEuWp+wL/3VN9FVirLuXxTrILoBPP8gyHKAEEiPuFabvj1zx3scmXW5EyIt3TwIdOP9hezroXl68HVuFy4hXfLbrjtlg1+BJwm+1QhhJ5c+7ehxxGf2Mt6luExU1EtQIzPbhhvCQm1KrNihcz3n7j0Afw31KNYQWQCSAK+wVeUGI73/OraW2di/H3QCTfXcFJvObxNcLhwfMxJ6TXQZNXndJinITTrhtHdMGkH0DD9VwiCG2ZEwMeuTg3Tv/yCe6lm2QgQsRzK4uDY+Sv5ZxpA8s3AbnncJs9mdDLkuMytV9+PXuyIOFViutjfrpuQS8q3DA02aYn9Xn25fq1oukgVAa9qsf80Hu7mY0bRwyx7JGzNlP9+lMk5zSKBvIJeNCRcByDcZoZaKx10VaDvqg1mCyedFh4XrICMV1qdaEoomzPwSP4myNYW1TP9e2qFt5gMeP1DoKvXjpDr6jrFCeLp4IBNCfNkhSDzavzZVtW/P0094bhURKh0CMg3HbgRmcmSXmiaCkQi4dKnM9pM5VwtkhpOT8MTOYqPI4QEh3BCQdYxeeE52PGuWT1Hxn+1ia4ZG0qQqtKyjc8/iyozk1Qsa+MeeVtyGm3f5HcK4RH2eN4UXQ=
accessToken: AgCZ2yi/Cz54CV7Tr3PHgCPK0xycSLncdLuaFAIv2WvUhRefK2B0UTXuh6q64F
import requests
import json
import tweepy
import os
def lambda_handler(event, context):
if (event['session']['application']['applicationId'] != os.environ['appID']):
raise ValueError("Invalid Application ID")
@rgee0
rgee0 / dockerfile.md
Created August 12, 2018 17:14
Dockerfile for Ansible
@rgee0
rgee0 / pydash.md
Last active July 25, 2018 18:35
Quick example of trapping amazon dash button presses on the network using python

This is an adaptation of something I found over 12 months ago. If it looks familiar, please say as I'm more than happy to credit.

#!/usr/bin/env python

from scapy.all import *
import datetime
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
def arp_display(pkt):
if pkt[ARP].op == 1: #who-has (request)
if pkt[ARP].psrc == '0.0.0.0': # ARP Probe
if pkt[ARP].hwsrc == '74:75:48:5f:99:30': # Huggies
print "Pushed Huggies"
elif pkt[ARP].hwsrc == '10:ae:60:00:4d:f3': # Elements
print "Pushed Elements"
else:
print "ARP Probe from unknown device: " + pkt[ARP].hwsrc