Skip to content

Instantly share code, notes, and snippets.

@tomdaley92
tomdaley92 / README.md
Last active March 4, 2026 21:56
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@GetVladimir
GetVladimir / Force-RGB-Color-on-M1-Mac.md
Last active March 7, 2026 06:28
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

@xbb
xbb / update-terminfo.sh
Last active February 15, 2025 23:37
terminfo termcap update linux freebsd
#!/usr/bin/env sh
set -e
NAMES="xterm,xterm-256color,screen,screen-256color,tmux,tmux-256color,xterm-ghostty,ghostty,Ghostty"
if [ "$(uname -s)" = "FreeBSD" ]; then
curl -o /tmp/termcap.src https://raw.githubusercontent.com/freebsd/freebsd-src/main/share/termcap/termcap
# Add ghostty termcap
cat << 'EOF' >> /tmp/termcap.src
@lazywebm
lazywebm / filebeat_armhf.sh
Last active February 19, 2025 21:24
Repackaging filebeat as .deb for 32 bit Raspbian
#!/usr/bin/env bash
# v1.2 / 2021-05-29 / Jan Schumacher / mail@jschumacher.info
# https://jschumacher.info/2021/03/up-to-date-filebeat-for-32bit-raspbian-armhf/
#
# v1.2: shellcheck'd, fixing variable double quoting. Using "awk 'FNR <= 1'" instead of "head -n 1" to avoid PIPEFAIL and 141 error.
# v1.1: Removing realtive paths, fixing dpkg-deb repackage method, updating help text, typos.
set -Eeuo pipefail
#set -Eeu
@vhermecz
vhermecz / custom_keys_git_ssh
Created June 8, 2020 11:20
Allow configuring multiple ssh deploy keys with git
#!/bin/bash
# Script to use custom ssh keys for various git repositories
# Run without arguments to get usage info.
#
# How it works:
# When used with SSH, git sends the path to the repository in the SSH command.
# @see: https://github.com/git/git/blob/e870325/connect.c#L1268
# We extract this info and search for a key with the name.
# Based on the source, this seems to be used format since v2.0 at least.
# @see: https://github.com/git/git/commit/a2036d7
@ryankurte
ryankurte / backup.env
Last active November 20, 2022 12:02
Linux backup automation
# Systemd environment file for backup.sh daily backup service
# Place in /etc/backup.env
# Destination for rsync file system clone
BACKUP_DEST=/media/large1/backups/raw
# Destination for restic repository
RESTIC_REPOSITORY=/media/large1/backups/restic
# Restic password file
@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
#include <Windows.h>
#include <iostream>
#include <lowlevelmonitorconfigurationapi.h>
#include <physicalmonitorenumerationapi.h>
#pragma comment(lib, "Dxva2.lib")
using namespace std;
BOOL CALLBACK MyInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
@bbqtd
bbqtd / macos-tmux-256color.md
Last active February 9, 2026 03:28
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@raplin
raplin / Hopi_HP-9800_Python_simple.py
Last active September 21, 2025 16:21
Dependency-free reading of the Hopi HP-9800 power meter (USB version) in python. Windows or Linux etc.
#
# By Richard Aplin, released into the public domain for any purpose, no warranties implied, 8/17/2022
#
#
import struct
import serial
#Super lightweight code to read Hopi HP-9800 power meter
class Hopi(object):