Skip to content

Instantly share code, notes, and snippets.

@cobryan05
cobryan05 / notification_light_beta.py
Created March 9, 2022 23:26
AppDaemon MQTT SmartBulb controller
View notification_light_beta.py
import hassapi as hass
import asyncio
import colorsys
import json
"""
*BETA* - EXPECT ISSUES!
App to control a Smart Bulb using MQTT
@cobryan05
cobryan05 / webcamDetect.py
Created February 9, 2022 19:08
Query registry for active webcam
View webcamDetect.py
import winreg
class WebcamDetect:
REG_KEY = winreg.HKEY_CURRENT_USER
WEBCAM_REG_SUBKEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\webcam\\NonPackaged"
WEBCAM_TIMESTAMP_VALUE_NAME = "LastUsedTimeStop"
def __init__(self):
self._regKey = winreg.OpenKey( WebcamDetect.REG_KEY, WebcamDetect.WEBCAM_REG_SUBKEY )
@cobryan05
cobryan05 / fixNvPe.py
Last active June 7, 2023 08:24
Python Script to disable ASLR and make nv fatbins read-only to reduce memory commit
View fixNvPe.py
# Simple script to disable ASLR and make .nv_fatb sections read-only
# Requires: pefile ( python -m pip install pefile )
# Usage: fixNvPe.py --input path/to/*.dll
import argparse
import pefile
import glob
import os
import shutil
@cobryan05
cobryan05 / turn_off_idle_switch.yaml
Last active May 6, 2022 18:36
Blueprint - Turn off switch when no motion
View turn_off_idle_switch.yaml
blueprint:
name: Turn off unoccupied switches
source_url: https://gist.github.com/cobryan05/24f19bad93b642b7e0c5f8f1da0515d0
description: Turn off a switch that has been left on with no motion
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity: