Ability to see the state and condition of ice rinks in Montreal.
The left is a typical rink widget, the right has an additional row for debugging.
| --- | |
| alias: Canadiens 1st Intermission Timer Trigger | |
| description: "Trigger the Canadiens Timer when the 1st period ends" | |
| triggers: | |
| - trigger: template | |
| value_template: >- | |
| {{ is_state_attr('sensor.team_tracker_canadiens', 'clock', 'End of 1st') }} | |
| conditions: [] | |
| actions: | |
| - action: timer.start |
| #!/usr/bin/env bash | |
| # get your api key from https://my.pingdom.com/app/api-tokens | |
| SECRET="$1" | |
| # | |
| ids=$(curl -s -X GET https://api.pingdom.com/api/3.1/checks -H 'Authorization:Bearer '"${SECRET}"| jq '.checks | .[] | .id ') | |
| echo "| name | threshold |" | |
| for id in $ids; do | |
| curl -s -X GET https://api.pingdom.com/api/3.1/checks/"${id}" -H 'Authorization:Bearer '"${SECRET}"| jq -r '.check | "| \(.name): | \(.responsetime_threshold) ms |"'; | |
| done |
| #!/usr/bin/env | |
| # strict mode | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # from https://github.com/aws/aws-cdk/issues/25742 | |
| # why am i debugging^Wworking in awk | |
| format_cdk_diff() { | |
| DEBUGGING=$1; | |
| awk 'BEGIN{ inTagBlock=0; previousLine=""; debugging='$DEBUGGING'; } |
| fields @timestamp, @message | |
| | parse @message /^(?<local>\S+) (?<remoteA>\S+)(, (?<remoteB>\S+))? - - \[(?<date>[\w:\+\/ -]*?)\] "(?<method>[A-Za-z-]+) (?<path>[\/\w_-]+) (?<protocol>[\/\w0-9\.-]+)" (?<status>[0-9-]+) (?<bytes>[0-9-]*) "(?<url>\S*?)" "(?<web>.*)"$/ | |
| | filter path like /^\/\S+\/?$/ and status like /404/ | |
| | stats count(*) as hits by path | |
| | sort hits desc |
| Verifying my Blockstack ID is secured with the address 1NgV5rvZJa6w1cEjEdXkokfS4BAWJv92Bc https://explorer.blockstack.org/address/1NgV5rvZJa6w1cEjEdXkokfS4BAWJv92Bc |
| #!/usr/bin/env python | |
| # Convert a data uri file into the data part | |
| # | |
| # Usage: daturi.py infile | |
| # | |
| # Copy a response from Chrome | |
| # pbaste > foo | |
| # daturi.py foo | |
| # creates foo.mimetype |
| #!/bin/sh | |
| # Output the HostName value from ~/.ssh/config | |
| # SOURCE this, don't execute (e.g. "source ssh_host.sh" or ". ssh_host.sh") | |
| # echos $@ if no HostName present | |
| # Useful for shell substitution | |
| # e.g. iperf -u -p 6970 -c $(ssh_host dev_backend) | |
| ssh_host() { | |
| ssh -G "$@" | grep -i '^hostname ' | awk '{print $2}' | |
| } |
| #!/usr/bin/env python | |
| from mitmproxy import ctx | |
| # an intermittent 404 for .ts files - HLS m3u8 streaming chunks | |
| def start(): | |
| return Foo() | |
| class Foo: | |
| MUCHO = 0 |
| /** | |
| * Created by jonathan.longman on 2017-06-15. | |
| */ | |
| var list = [ | |
| "www.foo.com", | |
| "bar.com" | |
| ]; | |
| // searches as substring now | |
| function FindProxyForURL(url, host) { | |
| for (var i = list.length - 1; i >= 0; i--) { |