Skip to content

Instantly share code, notes, and snippets.

@Blackshome
Blackshome / smart-light.yaml
Last active April 27, 2025 10:04
smart-light.yaml
blueprint:
name: Smart Light
description: >
# 🔆 Smart Light
**Version: 2.9**
Smart Lighting: Your Lights, Your Way - Take Control and Customize it to Perfection!💡✨
@timrprobocom
timrprobocom / AveryLabels.py
Last active March 20, 2025 11:35
A class to manage printing on Avery labels with ReportLab
import os
from collections.abc import Iterator
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import LETTER, landscape
from reportlab.lib.units import inch
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
# Usage:
# label = AveryLabels.AveryLabel(5160)
@sbyx
sbyx / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active May 5, 2025 10:14
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Low battery level detection & notification for all battery sensors
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').
@zeegin
zeegin / maintenance.bat
Created April 2, 2019 22:58
1c postgres maintenance and backup for windows
@echo off
chcp 65001 > nul
set E1C_RAS=localhost:3545
set E1C_RAC=C:\Program Files\1cv8\current\bin\rac.exe
set DB_SERVER=localhost:3541
set DB_NAME=1C_DATABASE
set DB_USER=1C_ADMINISTRATOR
set DB_PWD=1C_PASSWORD
set PGUSER=PG_ADMINISTRATOR
@lgaetz
lgaetz / lgaetz-didloopback.php
Last active July 28, 2022 16:25
Asterisk AGI file for a FreePBX system that examines outbound dialed digits against inbound DIDs specified in inbound routes. With Asterisk dial plan, it can be used to redirect outbound calls back in for local DIDs.
#!/usr/bin/php -q
<?php
/*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*
* Latest Version: https://gist.github.com/lgaetz/8633920
*
* Description:
*
* Script lgaetz-didloopback.php is used on a FreePBX server, with custom dialplan that calls
@jasny
jasny / mysql_splitdump.sh
Last active February 27, 2025 17:45
Split MySQL dump SQL file into one file per table or extract a single table
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit