This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
light: | |
- platform: neopixelbus | |
type: GRB | |
variant: WS2812 | |
pin: GPIO1 | |
num_leds: 1 | |
name: "NeoPixel 1" | |
internal: true | |
- platform: neopixelbus | |
type: GRB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import os | |
import shutil | |
import subprocess | |
def get_width(default=80): | |
'''Attempt to detect console width and default to 80''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: plant_moisture | |
platform: ESP32 | |
board: esp32dev | |
wifi: | |
ssid: "spam" | |
password: "eggs" | |
# Enable logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
A very simple kubernetes secrets dump tool. You can use it like this: | |
# kubectl get secret -o yaml -A | python decode_secrets.py | |
''' | |
import sys | |
import yaml | |
import base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import enum | |
import types | |
import aioudp | |
import struct | |
import asyncio | |
import blessings | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Use an influxdb query like this to fetch the data and store it as `meterstanden.csv`: | |
``` | |
SELECT max("value") FROM "m3" WHERE ("entity_id"::tag = 'gas_consumption') AND $timeFilter GROUP BY time(1d) fill(linear) | |
``` | |
''' | |
import pandas as pd | |
import json | |
import requests | |
import progressbar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import mmap | |
import typing | |
import hashlib | |
import logging | |
import argparse | |
import datetime | |
import ipaddress | |
import dataclasses | |
import xml.etree.cElementTree as ET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set ft=dosini: | |
# Supervisord config for the barman exporter | |
[program:barman_exporter] | |
environment=PATH=/usr/local/bin:%(ENV_PATH)s | |
command=/usr/local/bin/env python3 /var/barman/barman_exporter.py | |
user=barman | |
autostart=true | |
stopasgroup=true | |
killasgroup=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
// Uses https://github.com/PaulStoffregen/TimerOne for sending on a regular interval | |
#include <TimerOne.h> | |
// ECHO pin, needs to be a pin that supports interrupts! | |
#define ULTRASONIC_PIN_INPUT 2 | |
// TRIG pin, can be any output pin | |
#define ULTRASONIC_PIN_OUTPUT 3 | |
// update interval, make sure to keep it above 20ms | |
#define ULTRASONIC_TIMER_US 50000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:global wanInterface "wan1" | |
:global wanIP "$wanIP" | |
# Get the current IP on the interface | |
:local currentIPtemp [/ip address get [find interface="$wanInterface" disabled=no] address]; | |
# IP without netmask | |
:local currentIP [:pick $currentIPtemp 0 ([:len $currentIPtemp]-3)]; | |
:if ($currentIP != $wanIP) do={ |
NewerOlder