Skip to content

Instantly share code, notes, and snippets.

@seamus65
seamus65 / zha_symfonisk_remote_lights.yaml
Last active March 29, 2023 19:28
blueprint tutorial
blueprint:
name: ZHA - IKEA Symfonisk sound controller for lights
description: 'Control lights with an IKEA Symfonisk sound controller (the spinny ones).
You can set functions for single press, double press and triple press. This allows you to assign,
e.g., a scene or anything else.
Rotating left/right will change the brightness smoothly of the selected light.'
domain: automation
@JustinGrote
JustinGrote / BootstrapPowershellUniversal.ps1
Last active September 7, 2023 10:48
Powershell Universal BootStrap
<#
.SYNOPSIS
Bootstraps the Powershell Universal Dashboard with per-folder configurations on a random port
.DESCRIPTION
Saves a copy of Universal Dashboard to the LocalAppData/UniversalDashboard folder and starts it for the current folder.
This is useful for rapid testing, or integrating into scripts for easy deployment
.EXAMPLE
Start-UD -DashboardVersion 1.2.9
Bootstraps version 1.2.9 of the dashboard specifically
.EXAMPLE
@ttscoff
ttscoff / logr.bash
Last active November 28, 2024 18:37
Bash logging utility that simplifies use of logger command
#!/bin/bash
# Logging utility that simplifies user of bash logger command
# # First source the script
# source ~/scripts/logr.bash
# # Start the logger, generates log name from scripts filename
# logr start
# # or define your own
# logr start LOG_NAME
@ttscoff
ttscoff / changelog.rb
Last active November 3, 2025 14:34
Generate release notes from git commit messages
#!/usr/bin/ruby -W1
# frozen_string_literal: true
require 'optparse'
require 'shellwords'
# A script to automate changelog generation from Git commit messages
#
# For use with a git-flow workflow, it will take changes from the last tagged
# release where commit messages contain NEW, FIXED, CHANGED, and IMPROVED
@ttscoff
ttscoff / findercomment.rb
Created December 10, 2016 00:28
Set a finder comment from a script (Ruby, work in progress)
# Currently sets the metadata but .DS_Store isn't updated and comment doesn't show up in Finder
# Likely have to go with osascript `osascript -e 'tell application "Finder" to set comment of (file) to "comment"'
plist =<<ENDPLIST
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string>#{comment}</string>
</plist>
ENDPLIST
plist = `echo #{Shellwords.escape(plist)}|plutil -convert binary1 -o - -|xxd -ps`
%x{xattr -wx "com.apple.metadata:kMDItemFinderComment" "#{plist}" #{Shellwords.escape(@file)}}
@ttscoff
ttscoff / shorten.bash
Created April 28, 2016 18:34
Bash function to shorten all lines of output to specified length
# Truncate each line of the input to X characters
# flag -s STRING (optional): add STRING when truncated
# switch -l (optional): truncate from left instead of right
# param 1: (optional, default 70) length to truncate to
shorten () {
local helpstring="Truncate each line of the input to X characters\n\t-l Shorten from left side\n\t-s STRING replace truncated characters with STRING\n\n\t$ ls | shorten -s ... 15"
local ellip="" left=false
OPTIND=1
while getopts "hls:" opt; do
case $opt in
@nico-lab
nico-lab / ffmpeg_cut_and_concat.bat
Last active March 16, 2018 21:10
comskip_vdr_to_ffmpeg_cut_and_concat
@echo off
set VIDEO="video.ts"
set MEDIAINFO="MediaInfo.exe"
set FFMPEG="ffmpeg.exe"
%FFMPEG% -analyzeduration 100M -probesize 100M -i %VIDEO% -acodec copy -vn %VIDEO%.aac
set time1=%1
set sec0=%time1:~-5,-3%
@jpawlowski
jpawlowski / msys_hetzner-etc_network_interfaces
Created August 12, 2012 12:06
Debian network configuration for Proxmox VE server running on a Hetzner host
# /etc/network/interfaces
#
auto lo
iface lo inet loopback
# device: eth0
iface eth0 inet manual
# IPv4 bridge
# (connect ONLY your firewall/router KVM instance here, this is the WAN device!)