Skip to content

Instantly share code, notes, and snippets.

View simeon-walker's full-sized avatar

Simeon Walker simeon-walker

View GitHub Profile
@mildsunrise
mildsunrise / README.md
Last active May 21, 2024 13:02
Documentation of Tuya's weird compression scheme for IR codes

[Tuya][]'s IR blasters, like the [ZS08][], have the ability to both learn and blast generic IR codes. These IR codes are given to the user as an opaque string, like this:

A/IEiwFAAwbJAfIE8gSLIAUBiwFAC+ADAwuLAfIE8gSLAckBRx9AB0ADBskB8gTyBIsgBQGLAUALA4sB8gRAB8ADBfIEiwHJAeARLwHJAeAFAwHyBOC5LwGLAeA97wOLAfIE4RcfBYsB8gTyBEAFAYsB4AcrCYsB8gTyBIsByQHgPY8DyQHyBOAHAwHyBEAX4BVfBIsB8gTJoAMF8gSLAckB4BUvAckB4AEDBfIEiwHJAQ==

Not much is known about the format of these IR code strings, which makes it difficult to use codes obtained through other means (such as a

@andrewcchen
andrewcchen / tuya_ir_encode.js
Created August 13, 2023 19:44
Encode an NEC IR command into code for Tuya ZS06/ZS08/TS1201
/*
Encode an NEC IR command into code for Tuya ZS06/ZS08/TS1201
Usage: encode_nec("<four bytes in hex, two bytes of address followed by two bytes of command>")
If your address and/or command is just one byte (8 bits), append the complement of the byte after it to make it two bytes.
Example:
encode_nec("04fb08f7") // encodes nec address 0x04 and command 0x08
See:
@sbyx
sbyx / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active June 14, 2024 22:32
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Low battery level detection & notification for all battery sensors
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').
@avishayil
avishayil / route53.sh
Created October 14, 2018 17:00
Update Route53 Record With Machine IP Address
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
# PATH=PATH
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="ZONEID"
# The CNAME you want to update e.g. hello.example.com
@arjunmenon
arjunmenon / Raspberry Pi system wide audio DSP
Last active June 16, 2020 12:22
Easy robust Audio DSP guide for Raspberry Pi 3/ Pi Zero
https://github.com/bmc0/dsp/wiki/System-Wide-DSP-Guide
Supports Linkwitz Transform, Reverb, EQ and more.
Mostly you will be installing development packages. Some packages may be already installed. Check with dpkg -l <package name>
Configuration file needs to be created separately after make install.
INSTALL DEPENDENCIES
pi@raspberrypi:~ $ sudo apt-get update
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 15, 2024 12:13 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@random-robbie
random-robbie / BBC.m3u
Last active June 15, 2024 15:53
BBC HLS Streams - let me know if i missed any
#EXTM3U
#EXTINF:-1 tvg-id="BBC One HD" tvg-name="BBC One HD" tvg-logo="https://s4.postimg.org/k5xl5dmf1/bbc_one.png" group-title="BBC",BBC One HD
http://a.files.bbci.co.uk/media/live/manifesto/audio_video/simulcast/hls/uk/abr_hdtv/ak/bbc_one_hd.m3u8
#EXTINF:-1 tvg-id="BBC One London" tvg-name="BBC One London" tvg-logo="https://s4.postimg.org/z61nj8qd9/Bbc_london_logo.jpg" group-title="BBC",BBC One London
http://a.files.bbci.co.uk/media/live/manifesto/audio_video/simulcast/hls/uk/hls_tablet/ak/bbc_one_london.m3u8
#EXTINF:-1 tvg-id="BBC One Northern Ireland HD" tvg-name="BBC One Northern Ireland HD" tvg-logo="https://s3.postimg.org/ltztuojqr/6y_QROLCn_400x400.png" group-title="BBC",BBC One Northern Ireland HD
http://a.files.bbci.co.uk/media/live/manifesto/audio_video/simulcast/hls/uk/abr_hdtv/ak/bbc_one_northern_ireland_hd.m3u8
#EXTINF:-1 tvg-id="BBC One Scotland HD" tvg-name="BBC One Scotland HD" tvg-logo="https://s3.postimg.org/ltztuojqr/6y_QROLCn_400x400.png" group-title="BBC",BBC One Scotland HD
http://a.fi
@fstnando
fstnando / adminview.py
Last active May 7, 2016 06:13
DJANGO - Administrador con permisos para consulta
"""
Administrador con permisos para consulta(view)
Es una clase que extiende de admin.ModelAdmin y se utilizar para integrar
el admin con permiso de consulta.
Hay que integrarlo con el script que agrega a todos los modelos el permiso
de consulta(view):
https://gist.github.com/nicpottier/880901
@ajokela
ajokela / gist:1846191
Created February 16, 2012 16:22
Decrypt passwords stored in Oracle SQL Developer.
import javax.crypto.*;
import javax.crypto.spec.*;
import java.security.*;
/**
* Decrypt passwords stored in Oracle SQL Developer.
* This is intended for password recovery.
*
* Passwords are stored in ~/.sqldeveloper/system2.1.1.64.39/o.jdeveloper.db.connection.11.1.1.2.36.55.30/connections.xml
*/
@bgreenlee
bgreenlee / logging_subprocess.py
Created November 29, 2011 00:58
Variant of subprocess.call that accepts a logger instead of stdout/stderr #python
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.