Skip to content

Instantly share code, notes, and snippets.

@ZsZs73
ZsZs73 / pbs_up-down.sh
Last active March 6, 2025 18:29
Proxmox backup server on-demand wakeonlan wake-on-lan
#!/bin/bash
#
# This script expects that the ssh key authentication is set up between root@pve and root@pbs
#
# PBS server name
PBS_NAME=pve0
# Broadcast ip of the interface of the local server where the PBS is reachable
PBS_BROADCASTIP=192.168.99.255
# MAC address of the PBS server
PBS_MAC=90:1b:0e:aa:bb:cc
@ov1d1u
ov1d1u / micstatus.py
Last active August 26, 2024 10:43
Get MacOS mic status
import time
import requests
import atomacos
sysui = atomacos.getAppRefByBundleId('com.apple.controlcenter')
hass_api_url = "https://hassio.ov1d1u.net/api/webhook/<webhook_id>"
state = { "incall": False }
while True:
import { Controller } from '@hotwired/stimulus'
export default class extends Controller {
connect () {
this.element.addEventListener('change', this.handleChange.bind(this))
}
handleChange (event) {
this.traverseDown(event.target, event.target.checked)
@andrewfraley
andrewfraley / pbs_on_rpi.md
Last active April 18, 2025 05:23
Backup a Raspberry Pi to Proxmox Backup Server using the Proxmox Backup Client

Backup a Raspberry Pi to Proxmox Backup Server using the Proxmox Backup Client

This works on a Pi 4, and should work on a Pi 3, but to work on a Pi Zero you would have to figure out how to compile your own client. More info in this thread on the Proxmox forums.

Determine if your Pi is 32bit or 64bit

Run the following command. If you get arm64, it's 64bit, otherwise you'll see armv7l which is 32bit.

uname -m
@dantheman213
dantheman213 / Xbox Controller (GCPad).ini
Last active January 8, 2025 01:21
Dolphin Gamecube/Wii emulator / Xbox One Controller profile
# Dolphin Gamecube/Wii emulator / Xbox One Controller profile
# Gamecube Controller
# Location -> C:\User\<your user>\Documents\Dolphin Emulator\Config\Profiles\GCPad\Xbox Controller (GCPad).ini
[Profile]
Device = XInput/0/Gamepad
Buttons/A = `Button A`
Buttons/B = `Button B`
Buttons/X = `Button X`
Buttons/Y = `Button Y`
@leastbad
leastbad / select_controller.js
Created June 10, 2021 23:53
SlimSelect Stimulus wrapper
import ApplicationController from '../application_controller'
import SlimSelect from 'slim-select'
export default class extends ApplicationController {
static values = {
limit: Number,
placeholder: String,
searchText: String,
searchingText: String,
reflex: String,
@cadavre
cadavre / garage.yml
Created April 23, 2021 20:05
Garage parking sensor for ESP32
esphome:
name: garage_hub
platform: ESP32
board: nodemcu-32s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
mqtt:
@leastbad
leastbad / README.md
Created April 16, 2020 08:08
Choices.js Stimulus wrapper preview

Choices.js Stimulus wrapper

https://joshuajohnson.co.uk/Choices/

Soon, this will be published as an NPM package, but there's an absence of documentation right now. It supports almost all functions from the original library; soon it will support 100% of them.

This wrapper adds Ajax pre-fetch search. Happens if controller has a data-search-path attribute.

Stimulus controller targets use new v2 syntax. Controller attaches a reference to itself on the element so that you can access the internal state from external scripts.

@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@coorasse
coorasse / eager_loading.rb
Last active February 10, 2023 02:16
Eager loading of association with parameter in Rails
begin
require 'bundler/inline'
rescue LoadError => e
warn 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '~> 5.2'