Skip to content

Instantly share code, notes, and snippets.

View adlerweb's full-sized avatar

Florian Knodt adlerweb

View GitHub Profile
@adlerweb
adlerweb / motorrad.yaml
Last active October 4, 2026 00:08
motorrad.yaml
# Board: ESP32-C3 Super Mini (Generic)
esphome:
name: motorrad
friendly_name: Motorrad
min_version: 2024.6.0
on_boot:
priority: -100
then:
- delay: 2s
@adlerweb
adlerweb / tfttest.cpp
Created March 22, 2026 01:24
TFT Example
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include "time.h"
#include <WiFi.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <Adafruit_INA219.h>
esphome:
name: rgbtube
friendly_name: rgbtube
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable logging
@adlerweb
adlerweb / pvlvs.py
Created December 4, 2025 22:17
LVM: Script to show all LVs (or segments of LVs) on a specific PV. Handy for rebalancing. Beware: Vibecoded, might kill your system and some kittens.
#!/usr/bin/env python3
import sys
import subprocess
import shlex
try:
import humanize
except ImportError:
humanize = None
@adlerweb
adlerweb / battest.yaml
Created April 27, 2025 02:47
battest.yaml
esphome:
name: battest
friendly_name: battest
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable logging
@adlerweb
adlerweb / main.cpp
Created March 8, 2025 22:45
LoRaWAN Sensor Node based on Heltec Wireless Stick Lite V3 + DS18B20
#include <Arduino.h>
#include <heltec_unofficial.h>
#include <LoRaWAN_ESP32.h>
#include <OneWire.h>
#define HELTEC_WIRELESS_STICK_LITE
#define MINIMUM_DELAY 300 //300 Sekunden = 5 Minuten
const char* band = "EU868";
const uint8_t subband = 0;
@adlerweb
adlerweb / postLimit.sh
Last active April 18, 2025 22:09
Mastodon v4.3.x (<4.3.4) docker post character limit change
#!/bin/bash
# Mastodon v4.3.x docker character limit change
# Does *NOT* word with >= 4.3.4 as the handling was changed
# Based on https://mpp-service.de/en/mastodon-character-limit-increase-in-a-docker-environment/
# Based on https://fouquet.me/2024/10/10/mastodon-4-3-char-limit
# ./postLimit.sh 2500 → change post limit to 2500
# Must be executed in the directory Mastodons docker-compose.yaml is located
set -e
#include <Arduino.h>
#include <SoftwareSerial.h>
SoftwareSerial SRSerial(D1, D0);
void setup() {
Serial.begin(115200);
SRSerial.begin(9600);
}
esphome:
name: smlgw
friendly_name: smlgw
esp32:
board: esp32-c3-devkitm-1
# Enable logging
logger:
level: WARN
@adlerweb
adlerweb / res-change.py
Last active July 13, 2024 00:11 — forked from sohailshaukat/res-change.sh
Linux Screen Resolution Change script
#!/usr/bin/env python3
import argparse
import subprocess
def set_resolution(output, mode, refresh, apply):
modeline = False
width, height = mode.split('x')
gtf_cmd = f"gtf {width} {height} {refresh}"
gtf_output = subprocess.check_output(gtf_cmd, shell=True, text=True)