Skip to content

Instantly share code, notes, and snippets.

View aerobless's full-sized avatar

Theo Winter aerobless

View GitHub Profile
@aerobless
aerobless / server.py
Last active April 7, 2019 10:02
Simple HTTPS Basic Auth server in python
# generate certificates for 10years with the following command:
# openssl req -new -x509 -keyout key.pem -out server.pem -days 3000 -nodes
# Startup with the following command:
# python3 server.py
import http.server
import ssl
import subprocess
import base64
@aerobless
aerobless / raspberry_autostart.md
Created April 7, 2019 11:54
Add service to raspberry pi to start automatically

1. Create unit file

sudo vim /lib/systemd/system/servicename.service

2. Insert config

 [Unit]
 Description=My Service
 After=multi-user.target

 [Service]
[{"id":"a5733396e98a6fbf","type":"function","z":"e550f91e.577438","name":"insert metrics","func":"msg.payload = {\n\"data\" : {\n\"metrics\" : [\n{\n\"units\" : \"count\",\n\"data\" : [\n{\n\"qty\" : 5472,\n\"date\" : \"2021-12-11 00:00:00 -0500\"\n},\n{\n\"qty\" : 8169,\n\"date\" : \"2021-12-12 00:00:00 -0500\"\n},\n{\n\"date\" : \"2021-12-13 00:00:00 -0500\",\n\"qty\" : 3446\n},\n{\n\"date\" : \"2021-12-14 00:00:00 -0500\",\n\"qty\" : 4784\n},\n{\n\"date\" : \"2021-12-15 00:00:00 -0500\",\n\"qty\" : 4837.7652613770606\n},\n{\n\"qty\" : 4852,\n\"date\" : \"2021-12-16 00:00:00 -0500\"\n}\n],\n\"name\" : \"step_count\"\n}\n],\n\"workouts\" : [\n\n]\n}\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":220,"y":3440,"wires":[["aaeb804e202a0508"]]},{"id":"9513551692b17c69","type":"inject","z":"e550f91e.577438","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":
@aerobless
aerobless / Samsung TV to Apple TV Remote Emulation Flow
Created March 24, 2022 09:55
A Node-RED flow to emulate an Apple TV remote for a samsung TV via Logitech Harmony IR commands
[
{
"id": "398bef58.0823b",
"type": "server-events",
"z": "7d4c9938.2a0338",
"name": "Apple TV Remote",
"server": "78fe396.483dac8",
"event_type": "homekit_tv_remote_key_pressed",
"exposeToHomeAssistant": false,
"haConfig": [
- theme: Backend-selected
icon: mdi:city-variant
path: zurich
badges: []
cards:
- type: vertical-stack
cards:
- camera_view: auto
type: picture-glance
title: Uetliberg Zürichsee