Skip to content

Instantly share code, notes, and snippets.

View mlazzarotto's full-sized avatar

Marco Lazzarotto mlazzarotto

View GitHub Profile
@Blackshome
Blackshome / low-battery-notifications-and-actions.yaml
Last active May 22, 2025 07:42
low-battery-notifications-and-actions.yaml
blueprint:
name: Low Battery Notifications & Actions
description: >
# 🪫 Low Battery Notifications & Actions
**Version: 2.9**
🚀 Stay Charged, Stay Smart! Let's automate and take charge of your battery maintenance!🔋⚡
@albe-rosado
albe-rosado / ubuntu-nm-wiregard.sh
Created May 8, 2021 22:42
Command to install Ubuntu Wireguard network manager plugin
# instal dependencies
sudo apt install wireguard git dh-autoreconf libglib2.0-dev intltool build-essential libgtk-3-dev libnma-dev libsecret-1-dev network-manager-dev resolvconf
# clone repo and build
git clone https://github.com/max-moser/network-manager-wireguard
cd network-manager-wireguard
./autogen.sh --without-libnm-glib
./configure --without-libnm-glib --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/NetworkManager --localstatedir=/var
It's been a while since this gist was written. In the meantime the package homeassistant-supervised apt
package was introduced for debian based systems. If you used that way the first thing you should do use
the normal package uninstaller with something like: (sudo) apt remove homeassistant-supervised
If for some reason that doesn't work proceed with the below instructions for a manual cleanup.
1) stop services:
sudo systemctl stop hassio-supervisor.service
sudo systemctl stop hassio-apparmor.service
2) disable services:
@dgarros
dgarros / duplicate_ip.py
Created October 25, 2018 16:35
Netbox Report Duplicate IP
from django.db.models import Q
from extras.reports import Report
from collections import defaultdict
from dcim.models import Device
from ipam.models import IPAddress
from ipam.constants import IPADDRESS_ROLE_ANYCAST, IPADDRESS_ROLE_VIP
class UniqueIPReport(Report):
@webartoli
webartoli / README.md
Last active December 20, 2021 20:38
Home assistant - appdeamon - deconz - IKEA tradfri remote control

Home Assistant - Reuse dimming logic using AppDaemon

I have a multiple IKEA tradfri remotes attached to deconz and I want write once the logic to dim lights.

After some searches I discover the AppDaemon solution and this is the results of my draft works.

Install

I have installed the plugin provided by community addons

@carry0987
carry0987 / RPi3-Auto-WiFi.md
Last active April 2, 2025 07:26
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connection

Before you start, make sure ip command is available on your system. In modern Linux distributions, ip replaces older ifconfig command. If net-tools package (that includes ifconfig) is not installed and you prefer using it, you can install it via sudo apt-get install net-tools.

Create script file

Use touch /home/pi/wifi-reconnect.sh to create a shell script file, with the following content:

#!/bin/bash
@jcsteh
jcsteh / SpotifyGlobalKeys.ahk
Last active April 9, 2025 13:51
AutoHotkey script to control Spotify with global keyboard shortcuts
; SpotifyGlobalKeys.ahk:
; AutoHotkey script to control Spotify with global keyboard shortcuts
; Author: James Teh <[email protected]>
; Copyright 2017-2018 James Teh
; License: GNU General Public License version 2.0
DetectHiddenWindows, On
; Get the HWND of the Spotify main window.
getSpotifyHwnd() {
@autoize
autoize / backupToB2.sh
Created September 8, 2017 17:20
NextCloud Backup to BackBlaze B2
#!/bin/sh
# NextCloud to BackBlaze B2 Backup Script
# Author: Autoize (autoize.com)
# This script creates an incremental backup of your NextCloud instance at BackBlaze's off-site location.
# BackBlaze B2 is an object storage service that is much less expensive than using Amazon S3 for the same purpose, with similar versioning and lifecycle management features.
# Uploads are free, and storage costs only $0.005/GB/month compared to S3's $0.022/GB/month.
# Requirements
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 28, 2025 09:41 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@adrianlzt
adrianlzt / stale_sensor.py
Created February 19, 2017 22:40
Home Assistant, App Daemon module to monitor for stale sensors
import appdaemon.appapi as appapi
import homeassistant.util.dt as dt_util
#
# Notify stale sensors.
# Each minute last update of sensor is checked to see if it is higher than the configured value
#
# Args:
# sensor = sensor to monitor
# tiempo = minutes threshold to notify