Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: Cusotm climate from binary sensor
description: This blueprint intelligently manages your heating or cooling systems
based on window sensor activity, conserving energy by suspending climate control
when a window is open and restoring settings after user-defined delays for opening
and closing the window.
domain: automation
input:
window_sensor:
name: Window Sensor
@fipski
fipski / tud-eduroam.sh
Created November 2, 2021 15:51
Eduroam TU Darmstadt
# Assuming you have T-TeleSec_GlobalRoot_Class_2.pem in /etc/ssl/certs.
# Replace TU-ID with your ID
# replace wlan0 with your interface name
nmcli connection add type wifi con-name eduroam ifname wlan0 ssid "eduroam" -- wifi-sec.key-mgmt wpa-eap 802-1x.eap peap 802-1x.anonymous-identity [email protected] 802-1x.identity [email protected] 802-1x.phase2-auth mschapv2 802-1x.domain-suffix-match radius.hrz.tu-darmstadt.de 802-1x.ca-cert /etc/ssl/certs/T-TeleSec_GlobalRoot_Class_2.pem
nmcli connection up eduroam --ask
@fipski
fipski / parse_nginx_time.py
Created August 1, 2020 14:52
compare time from nginx to a max timeout
#!/usr/bin/python3
from datetime import datetime, timedelta
# sample logstring from nginx
logstring = '185.128.120.94 - - [01/Aug/2020:16:04:47 +0200] "POST /http-bind?room=test HTTP/2.0" 200 342 "https://foo" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.85 Safari/537.36"'
start = logstring.find('[')+1
end = logstring.find(']')
@fipski
fipski / escape_html_body_to_json.py
Created August 1, 2020 13:13
read a html file and print body content as json escaped string including html
#!/usr/bin/python3
import sys
import json
import html
from escapejson import escapejson
from lxml import etree
import lxml.html
from io import StringIO, BytesIO
with open(str(sys.argv[1]),'r') as f: