Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jschlyter on github.
  • I am jakob (https://keybase.io/jakob) on keybase.
  • I have a public key whose fingerprint is 7B6B 7819 39E5 067B C48B EF03 52EE 4645 1B13 F78C

To claim this, I am signing this object:

@jschlyter
jschlyter / gist:50df06126e1be15cf404
Last active August 29, 2015 14:23
summary.json example
{
"date" : "2015-06-23",
"reports" : [
{
"domain" : "afaforsakring.se",
"type" : "Finans",
"org" : "AFA Försäkring",
"https" : 1,
"fqdn" : "afaforsakring.se",
"sts" : 1,
@jschlyter
jschlyter / summary.json
Created June 24, 2015 07:20
tls-report summary 2015-06-23
{
"date" : "2015-06-23",
"reports" : [
{
"domain" : "afaforsakring.se",
"type" : "Finans",
"org" : "AFA Försäkring",
"https" : 1,
"fqdn" : "afaforsakring.se",
"sts" : 1,
@jschlyter
jschlyter / certstream2logstalgia.sh
Last active December 4, 2017 03:05
Certstream + Logstalgia = True
#!/bin/sh
certstream --json |\
jq -r '.data | [ (.seen|floor|tostring), .leaf_cert.all_domains[0], .chain[0].subject.CN, "200", "0" ] | join("|")' |\
logstalgia
@jschlyter
jschlyter / letsencrypt4halon.sh
Created October 15, 2018 06:46
Letsencrypt for Halon
#!/bin/sh
EMAIL=
MX_HOSTNAME=
SPG_HOSTNAME=
SPG_USERNAME=
SPG_PASSWORD=
. `dirname $0`/`basename $0 .sh`.conf
@jschlyter
jschlyter / twinkly.yaml
Created December 17, 2018 07:22
Twinkly scripts for Home Assistant
# https://xled-docs.readthedocs.io/en/latest/msqtt_api.html
twinkle:
alias: Twinkle
sequence:
- service: script.twinkle_effect
data_template:
id: "{{id}}"
effect: "{{effect1}}"
- delay:
@jschlyter
jschlyter / gist:2af596135d5c15e2eb6a9c52454608eb
Created December 17, 2018 07:35
Twinkly Home Assistent Switch
- platform: mqtt
name: twinkly
state_topic: "xled/appstatus/MAC_OF_TWINKLY"
command_topic: "xled/command/MAC_OF_TWINKLY"
available_topic: "xled/status/MAC_OF_TWINKLY"
payload_on: '{"command": "switchon"}'
payload_off: '{"command": "switchoff"}'
retain: true
value_template: |
{% if value_json.appstatus is defined %}
@jschlyter
jschlyter / kem-decryptor.py
Created November 11, 2023 10:53
Python script to decrypt Kamstrup KEM files (adopted to pyca/cryptography)
# A Python script that decrypts the content of Kamstrup KEM file and imports meter files
# to wmbusmeters' config folder.
#
# The KEM file is a (sometimes zipped) xml file that contains xml-encrypted data using
# the xml-enc standard (http://www.w3.org/2001/04/xmlenc). The password needed to decrypt
# the xml-encrypted data can either be the CustomerId or something else selected by the
# person that has created the KEM file using Kamstrup software.
#
# This script takes the encrypted KEM file and decrypts its content (it automaticly detects
# the zip archive and extracts the kem file from it). The result is a XML with a list of meters