Skip to content

Instantly share code, notes, and snippets.

@TerryE
TerryE / load_readings.py
Last active May 2, 2020 12:30
Python script to download daily OVO smart meter usage
#!/usr/bin/env python
# This requires Python 2.7. This will not work with Python 3
# Thanks to PaulW for the idea. In this case it was a matter of using
# the Ff Inspector Netwroks analyser to log the interactive query with
# "Persistent Logs" enabled, dumping the HAR to to pick out the key
# queries and with a bit of trial and error to refine them.
#
# I run this daily as a cron job.
@analogrelay
analogrelay / EventSourcesAndCountersOhMy.md
Last active September 13, 2021 07:58
EventSource/EventCounters patterns
@paoloantinori
paoloantinori / keycloak.sh
Created January 26, 2016 15:59
Keycloak Admin API Rest Example
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \