Skip to content

Instantly share code, notes, and snippets.

View jasonmadigan's full-sized avatar

Jason Madigan jasonmadigan

View GitHub Profile
@jasonmadigan
jasonmadigan / winter_wonderland.yaml
Created December 7, 2025 16:06
Recreate Winter Wonderland Light Effect with Home Assistant, without Philips Hue
alias: Winter Wonderland Light Effect from Hue, without Hue
triggers:
- seconds: /10
trigger: time_pattern
actions:
- repeat:
for_each: "{{ my_lights }}"
sequence:
- variables:
col: "{{ colours | random }}"
apiVersion: extensions.kuadrant.io/v1alpha1
kind: APIProduct
metadata:
creationTimestamp: "2025-11-10T15:34:48Z"
generation: 2
name: toystore2
namespace: toystore
resourceVersion: "13596"
uid: 1e5ff20a-a8cb-4550-91c0-3b3e1468af20
spec:

GoodHome Takoma Mobile AC – IR Code Reference (Flipper Zero captures)

All codes are NEC protocol with Address 0x20.

Function Command (C) Notes
Power Toggle 0x02 Toggles ON / OFF
Settings 0x09 Cycles modes / settings
Fan Speed Up 0x1A Increase fan speed
Fan Speed Down 0x19 Decrease fan speed
#!/bin/bash
# Remember to start cloud-provider-kind first:
# sudo cloud-provider-kind --enable-lb-port-mapping=true
set -euo pipefail
command_exists() {
command -v "$1" >/dev/null 2>&1
@jasonmadigan
jasonmadigan / configuration.yaml
Created January 1, 2025 15:55
Generic Home Assistant Assist - "Add" todo list items
conversation:
intents: {}
intent_script:
ShoppingListAddItem:
action:
action: todo.add_item
target:
entity_id: todo.shopping_list
data:
@jasonmadigan
jasonmadigan / gate.yaml
Created December 12, 2024 20:44
Gate cover, no contact sensor. input_text for state
input_text:
gate_state:
name: Gate State
---
template:
cover:
- name: Gate
friendly_name: "Gate"
@jasonmadigan
jasonmadigan / kup.sh
Last active December 9, 2024 16:32
kup.sh
#!/bin/bash
# Ref: https://github.com/Kuadrant/kuadrant-operator/blob/main/doc/user-guides/full-walkthrough/secure-protect-connect-openshift.md
export PREPEND="-jmtest1"
export KUADRANT_GATEWAY_NS=api-gateway$PREPEND # Namespace for the example Gateway
export KUADRANT_GATEWAY_NAME=external$PREPEND # Name for the example Gateway
export KUADRANT_DEVELOPER_NS=toystore$PREPEND # Namespace for an example toystore app
export KUADRANT_AWS_ACCESS_KEY_ID=$KUADRANT_AWS_ACCESS_KEY_ID # AWS Key ID with access to manage the DNS Zone ID below

DCO

git commit templates only work with interactive message writing. Need a hook for -m commits.

Create a hook

cd .git/hooks
touch commit-msg
chmod +x commit-msg
@jasonmadigan
jasonmadigan / mongo_prune.js
Last active April 7, 2024 20:29
Unifi Client prune
// keep N-day worth of data
var days=7;
// change to false to have the script to really exclude old records
// from the database. While true, no change at all will be made to the DB
var dryrun=true;
var now = new Date().getTime(),
time_criteria = now - days * 86400 * 1000,
time_criteria_in_seconds = time_criteria / 1000;