Skip to content

Instantly share code, notes, and snippets.

View dotWee's full-sized avatar
🧑‍🎨
N06 G41 G00 X1.1 Z1.1 T0303 M08

Lukas Wolfsteiner dotWee

🧑‍🎨
N06 G41 G00 X1.1 Z1.1 T0303 M08
View GitHub Profile
# This is a anonymized version of the script I use to renew all my SSL certs
# across my servers. This will not work out of the box for anyone as your network will be
# different. But may be useful starting place for others.
#
# I use a cronjob that runs this every week. It only replaces certificates when a certificate has been renewed.
# Renews/creates cert from letsencrypt & places it where it needs to be.
# Currently, that is:
# * Nginx (local for plex)
# * Plex Media Server
@PicoMitchell
PicoMitchell / man2pdf.sh
Last active April 27, 2024 14:24
Display "man" pages as PDFs on macOS, with nice filenames and caching.
#!/bin/sh
man2pdf() {
##
## Created by Pico Mitchell (of Random Applications) on 11/16/22
##
## https://gist.github.com/PicoMitchell/619c12fd6a53ae6ec657514915d4edf9
##
## MIT License
##
@greghesp
greghesp / esphome_ble_config.yaml
Last active May 26, 2023 18:01 — forked from kmdm/esphome_ble_config.yaml
esphome, esp32 ble tracker and Home Assistant mqtt_room sensors
# MQTT broker configuration
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_username
password: !secret mqtt_password
discovery: False # Only if you use the HA API usually
id: mqtt_client
# Define the room for this ESP32 node
substitutions:
@HarHarLinks
HarHarLinks / Mixcloud RSSifier
Last active December 26, 2023 10:32 — forked from ilevantis/Mixcloud RSSifier
Turn mixcloud streams into an RSS feed e.g. for mixcloud.com/<mixcloudstream>/playlists/<streamplaylist-if-there-is-one>/ go to mysite.com/mixcloud-rssifier/?fname=<mixcloudstream>&lname=<streamplaylist-if-there-is-one> to get an RSS feed of the stream or the playlist from the stream
<?php
header('Content-Type: application/rss+xml; charset=UTF-8');
// suck in the query string variables
$feed_name = htmlspecialchars($_GET['fname']);
$list_name = htmlspecialchars($_GET['lname']);
// compose the api urls + other stuff depending on presence of playlist
if(isset($_GET['lname'])) {
$json_url = 'http://api.mixcloud.com/'.$feed_name.'/playlists/'.$list_name.'/cloudcasts/';
#!/usr/bin/env python3
# Domain Search Option Format generator for Unifi Security Gateway
# Usage: python3 dhcp_option_119.py example.com example.net
import sys
hexes = []
for domain in sys.argv[1:]:
for label in domain.split('.'):
hexes.append('%02x' % len(label))
@bruvv
bruvv / Repair synology BTRFS volume
Created December 6, 2019 18:12
Synology BTRFS repair
btrfs fi show -d
(/dev/mapper/vg1000-lv)
syno_poweroff_task -d
(or: umount /volume1)
(or2: umount /volume1 -f -k)
Check to see if all us unmounted:
df -h
@n8henrie
n8henrie / repair.sh
Last active July 7, 2021 00:16
Fix time machine backup
#!/usr/bin/env bash
# http://tonylawrence.com/post/unix/fixing-corrupted-time-machine-backups/
set -euf -o pipefail
set -x
if [[ $(whoami) != 'root' ]]; then
echo "Please run as root" > /dev/stderr
exit 1
fi
@PattaFeuFeu
PattaFeuFeu / HA_Migrate-sqlite-to-mysql.md
Last active April 28, 2024 19:20
Steps necessary to migrate from HomeAssistant’s standard sqlite database to an external MariaDB(10) SQL database

Migrate Home Assistant’s sqlite database to MySQL, specifically MariaDB (10)

After having added a decent amount of entities to my Home Assistant setup, the user interface—especially the history tab, but also the history for each entity—became very sluggish. Having to wait for up to 30 seconds to see the history graph for a single entity became the norm with an sqlite file weighing in at 6GB and millions of entries in the “events” and “states” tables.

I wanted to keep my acquired data, so I had to migrate it from the current sqlite file to a MySQL database instead of starting anew. I’ve done this using Home Assistant version 0.81 and MariaDB 10. Some parts might change in the future.

Dump Home Assistant sqlite database

@simon987
simon987 / youtube-dl_soundcloud.md
Created October 16, 2018 00:10
snippet for using youtube-dl to download soundcloud playlists

Heres a snippet for using youtube-dl to download soundcloud playlists:

youtube-dl -w -o "Playlist/%(playlist_title)s (%(playlist_uploader)s) - %(playlist_id)s/%(title)s.%(ext)s" -f bestaudio --embed-thumbnail --add-metadata https://soundcloud.com/tommisch/sets