Skip to content

Instantly share code, notes, and snippets.

View kkroesch's full-sized avatar

Karsten Kroesch kkroesch

View GitHub Profile
@kkroesch
kkroesch / register.ino
Created January 2, 2026 13:38
Universal Input/Output
#include "Adafruit_TLC5947.h"
// --- KONFIGURATION TLC5947 (Ausgabe) ---
#define CLOCK_PIN A1
#define DATA_PIN A0
#define LATCH_PIN A2
Adafruit_TLC5947 tlc = Adafruit_TLC5947(1, CLOCK_PIN, DATA_PIN, LATCH_PIN);
// --- KONFIGURATION EINGABE ---
const int NUM_BITS = 4;
// --- Konfiguration ---
const int ledLinks = 0;
const int ledRechts = 1;
// Timing
const int blitzDauer = 20; // An-Zeit
const int blitzPause = 40; // Pause zwischen Blitzen
const int seitenPause = 100; // Pause beim Wechsel
void setup() {
@kkroesch
kkroesch / Deno-Justfile
Last active December 14, 2025 09:33
Some Deno Experiments
PORT := "8000"
VERSION := "v2.6.0"
ARCH := "x86_64-unknown-linux-gnu"
install: # Deno binary for architecture
curl -LO https://github.com/denoland/deno/releases/download/{{VERSION}}/deno-{{ARCH}}.zip
unzip deno-{{ARCH}}.zip
rm deno-{{ARCH}}.zip
@kkroesch
kkroesch / postgres.service
Created October 4, 2025 14:35
.service-Datei für Podman-PostgreSQL (Wegen Problemen mit Quadlet-Generator auf IoT Edition)
[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
Description=PostgreSQL Container
# Stellt sicher, dass der Service erst nach dem Netzwerk startet
After=network-online.target
Wants=network-online.target
RequiresMountsFor=%t/containers
RequiresMountsFor=/srv/postgres
@kkroesch
kkroesch / mkthumbs.sh
Created May 7, 2025 08:48
Thumbnail generation for website gallery
#!/bin/bash
# mkthumbs.sh – generates thumbnails and large versions only when needed
# Usage: ./mkthumbs.sh [subdirectory]
set -euo pipefail
SUBDIR="${1:-}" # optional first argument
SRC_DIR="content/gallery/${SUBDIR}"
DST_THUMB="static/gallery/thumbs/${SUBDIR}"
DST_FULL="static/gallery/full/${SUBDIR}"
@kkroesch
kkroesch / .alias
Created March 10, 2025 12:32
Useful aliases for Podman and Docker
alias pps='printf "%-12s %-25s %-12s %-30s %s\n" "ID" "NAME" "STATUS" "IMAGE" "PORTS"; podman ps --format "{{printf \"%.12s %-25s %-12s %.30s %s\" .ID .Names .Status .Image .Ports}}"'
# ... to be continued
@kkroesch
kkroesch / Justfile
Last active May 19, 2025 11:59
Certificate creation with OpenSSL for devices with Subject Alternative Names (SAN)
@pkey:
# Create private key.
# Most certification authorities only support RSA alogrithm.
openssl genpkey -algorithm RSA -out device.key
@pkeyec:
# Create private key with elliptic curve algorithm.
openssl ecparam -name prime256v1 -genkey -noout -out device.key
@csr:
@kkroesch
kkroesch / uptime_panel.json
Last active February 24, 2025 19:06
Grafana Uptime Panel
{
"datasource": {
"uid": "bc2d6911-2640-41d7-a568-5cc56f6c2b37",
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
"mappings": []
},
"overrides": []
@kkroesch
kkroesch / Justfile
Last active December 23, 2024 16:46
Provision QEMU Debian images.
image_name := "debian.qcow2"
set shell := ["bash", "-cu"]
ansible_password := `(openssl rand -base64 12)`
download:
@curl -Lo {{image_name}} https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2
prepare:
@echo {{ansible_password}} > .password
@kkroesch
kkroesch / main.rs
Last active October 25, 2024 18:16
Rust Tracing
//! ## Dependencies
//! [dependencies]
//! tracing = "0.1"
//! tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
use tracing::{debug, error, info, instrument, warn};
use tracing_subscriber::{fmt, EnvFilter};
#[instrument(level = "trace")]