Skip to content

Instantly share code, notes, and snippets.

View mlazzarotto's full-sized avatar

Marco Lazzarotto mlazzarotto

View GitHub Profile
@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 June 16, 2024 07:50
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 June 21, 2024 14:44
AutoHotkey script to control Spotify with global keyboard shortcuts
; SpotifyGlobalKeys.ahk:
; AutoHotkey script to control Spotify with global keyboard shortcuts
; Author: James Teh <jamie@jantrid.net>
; 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 June 30, 2024 15:05 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@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
@sirbrillig
sirbrillig / pgsql_backup.sh
Last active June 11, 2024 05:41 — forked from dangerousbeans/pgsql_backup.sh
Postgresql daily backup script.
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR=/pg_backup
DAYS_TO_KEEP=14
FILE_SUFFIX=_pg_backup.sql
DATABASE=
USER=postgres