Skip to content

Instantly share code, notes, and snippets.

@disconn3ct
disconn3ct / upgrade-pg.py
Created May 28, 2025 12:29 — forked from wvengen/upgrade-pg.py
Major upgrade PostgreSQL on cloudnative-pg
#!/usr/bin/env python3
#
# Helper script to do major version upgrades of a cloudnative-pg based
# PostgreSQL cluster.
#
# Usage: python3 upgrade-pg.py <cluster-name> <new-pg-version>
#
# Example: python3 upgrade-pg.py my-backend-db 17.0
#
# Make sure to include major and minor version in the pg version.
@disconn3ct
disconn3ct / mosquitto-relay.yaml
Last active February 2, 2025 14:17
Mosquitto relay for Bambu Labs printers - deprecated
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &name mosquitto-printer
namespace: homeautomation
spec:
chart:
spec:
chart: mosquitto
@disconn3ct
disconn3ct / prowlarr.json
Last active December 3, 2024 13:48 — forked from Dan6erbond/prowlarr.json
Exportarr Dashboards
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
@disconn3ct
disconn3ct / copy-favorites.sh
Created November 6, 2024 19:06
Mealie favorites sync
# Copy favorites from $ACCOUNT1 to $ACCOUNT2. No effort is made to prevent duplicates. It doesn't sync, it just copies.
set TOK='admin token here'
set ACCOUNT1='fff-fff-fff-fff-etc'
set ACCOUNT2='aaa-aaa-aaa-aaa-aaa'
set MEALIE='https://mealie.local'
# prints 'null' or error for each
curl -sSX 'GET' "$MEALIE/api/users/$ACCOUNT1/favorites" -H 'accept: application/json' -H"Authorization: Bearer $TOK" | \
jq -r '.ratings[].recipeId' | while read a ; do
curl -sSX 'POST' "$MEALIE/api/users/$ACCOUNT2/favorites/$a" -H'accept: application/json' -H"Authorization: Bearer $TOK" | jq .
@disconn3ct
disconn3ct / automations.yaml
Created April 7, 2023 14:07
Home Assistant automation for temperature (F) lights with time-decay brightness
- alias: LED - Temperature
description: ''
trigger:
# How often to decay:
- platform: time_pattern
seconds: /30
# And whenever the source is freshened:
- platform: state
entity_id:
- sensor.tomorrow_io_weather_feels_like
@disconn3ct
disconn3ct / jellyfin-intro-scanner.yaml
Last active May 8, 2025 07:40
Jellyfin Intro Scanner/Skipper
---
# https://mueslimak3r.github.io/tv-intro-detection/
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: "jellyfin-intro-scanner"
spec:
releaseName: "jellyfin-intro-scanner"
chart:
spec:
@disconn3ct
disconn3ct / Dockerfile
Created February 20, 2022 14:35
betaflight docker build
FROM ubuntu:20.04
VOLUME /opt/betaflight
WORKDIR /opt/betaflight
RUN apt update; apt install -y make build-essential python git curl
COPY entrypoint.sh /sbin/entrypoint.sh
ENTRYPOINT [ "/sbin/entrypoint.sh" ]
CMD [ "make" ]
@disconn3ct
disconn3ct / build.sh
Created January 23, 2012 20:32
modified build for spanner
#!/bin/bash
#
# Script to build CM9 for Galaxy Tab (with Kernel)
# 2012 Chirayu Desai
# Common defines
txtrst='\e[0m' # Color off
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
avg-cpu: %user %nice %system %iowait %steal %idle
7.00 0.20 1.20 91.60 0.00 0.00
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
mmcblk0 0.00 0.00 0.00 0 0
mmcblk0p2 0.00 0.00 0.00 0 0
mmcblk0p7 0.00 0.00 0.00 0 0
mmcblk0p8 0.00 0.00 0.00 0 0
mmcblk1 6.80 0.10 50.10 0 250
mmcblk1p2 0.00 0.00 0.00 0 0
$ echo $CROSS_COMPILER
/opt/CodeSourcery/bin/arm-none-eabi-
$ make ARCH=arm CROSS_COMPILE=$CROSS_COMPILER uImage -j4
CHK include/linux/version.h
SYMLINK include/asm -> include/asm-arm
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h