Skip to content

Instantly share code, notes, and snippets.

@mdonoughe
mdonoughe / get_lutron_cert.py
Last active January 17, 2022 03:11 — forked from mhofman/get_lutron_cert.sh
Generate a signed certificate valid to connect locally to a Lutron Caseta Smart Bridge
"""Guide the user through pairing and save the necessary files."""
# `python -m venv env`
# bash: `source ./env/bin/activate`
# powershell: `./env/scripts/activate.ps1`
# `pip install cryptography==2.1.3 requests==2.18.4`
# `python get_lutron_cert.py`
# your client key -> caseta.key
# your client certificate -> caseta.crt
@mhofman
mhofman / get_lutron_cert.sh
Created October 13, 2017 09:48
Generate a signed certificate valid to connect locally to a Lutron Caseta Smart Bridge
#!/bin/sh
# Usage: get_lutron_cert.sh [bridge_ip] | tee cert.pem
function error() {
echo "Error: $1" >&2
exit 1
}
login_server="device-login.lutron.com"
@rgl
rgl / wait_for_http_200.sh
Last active March 7, 2024 17:08
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76