Skip to content

Instantly share code, notes, and snippets.

@camerongray1515
camerongray1515 / shelly_smart_bulb_control.js
Created October 4, 2025 12:27
Shelly Smart Bulb Control with Fallback
// Shelly 1 Mini Gen4 script
// Input: detached push button (input:0)
// Relay: switch:0
// Virtual boolean: id=200 ("Confirm")
let SW_INPUT = 0;
let SW_OUTPUT = 0;
let CONFIRMED_ID = 200;
let TIMEOUT_MS = 1000;
@aigarius
aigarius / shelly_with_ha.js
Created April 12, 2023 10:48
Shelly script to revert to direct switch control if Home Assistant is not available
// Preconditions:
// Shelly connected to a manual switch and to a smart light
// Shelly set to disconnected mode and to restore power to on after power loss
// Input mode is button (might need a minor change for switch - untested)
// Shelly is added to Home Assistant
// An automation is created in Home Assistant to toggle the light when single button press is
// detected on the Shelly (other automations may also exist)
let online_status = 0;
// Change this to the URL of your Home Assistant base URL + "/api/ping"
@stoyanovgeorge
stoyanovgeorge / change_vlan_ip_mask.bat
Last active January 27, 2025 17:09
A batch script for Windows 10 which can change the IP address, the network mask, the gateway, the DNS and the VLAN ID of an interface. You need to execute the script with admin rights.
@echo off
:: Configuration Variables
set "ifName=Ethernet 2"
set "ipAddress=10.88.167.35"
set "subnetMask=255.255.255.240"
set "vlanID=702"
:: set "defaultGateway=x.x.x.x"
:: set "primaryDNS=x.x.x.x"
@mrpeardotnet
mrpeardotnet / PVE-postinstall-5x.md
Last active March 31, 2025 23:30
PVE-postinstall-6.x

Proxmox PVE 6.x Post Installation Steps

This cheatsheet helps to set up your Proxmox Virtual Environment (PVE) host after fresh installation. Designed and tested on PVE version 6.x.

Note about sudo

I do not prepend sudo command to any of commands listed here, but keep in mind that nearly all commands requires su privileges, so use sudo if your account happen to not have root access.

How to edit config files

The simplest way to edit config file is to use vim.tiny editor, for example to edit vzdump.conf file use this command: