Skip to content

Instantly share code, notes, and snippets.

@smagoun
smagoun / nut_osx.txt
Last active May 25, 2023 04:27 — forked from 2b/nut_osx.txt
Network UPS Tools on OS X Catalina for Synology client
# Tested with nut 2.7.4_2 from homebrew
# Configure OSX Energy Saver UPS tab for the UPS
#install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#install network ups tools
brew install nut
# Set permissions on state dirs to allow running as daemon
sudo mkdir -p /usr/local/var/state/ups/
@ilude
ilude / !proxmox_k3s_cluster.sh
Last active August 21, 2024 11:03
Proxmox k3s cluster creation scripts
#!/bin/bash
# curl -s https://gist.githubusercontent.com/ilude/457f2ef2e59d2bff8bb88b976464bb91/raw/cluster_create_setup.sh?$(date +%s) > ~/bin/setup_cluster.sh; chmod +x ~/bin/setup_cluster.sh; setup_cluster.sh
echo "begin cluster_create_setup.sh"
export CREATE_TEMPLATE=1 #false
while test $# -gt 0; do
case "$1" in
--template)
export CREATE_TEMPLATE=0 #true
@triangletodd
triangletodd / README.md
Last active April 3, 2025 16:29
k3s in LXC on Proxmox

On the host

Ensure these modules are loaded

cat /proc/sys/net/bridge/bridge-nf-call-iptables

Disable swap

sysctl vm.swappiness=0
swapoff -a
@qrtt1
qrtt1 / 000_2020-12th-ironman.md
Last active September 3, 2023 07:16
ITHome 第 12 屆鐵人賽 (updated UTC 2020-10-19 00:40:39.204524)
@andy-shi88
andy-shi88 / logid.cfg
Created August 18, 2020 12:28
logitech m590 mouse logiops configuration
devices: ({
name: "M585/M590 Multi-Device Mouse";
// A lower threshold number makes the wheel switch to free-spin mode
// quicker when scrolling fast.
smartshift: { on: true; threshold: 20; };
hiresscroll: { hires: false; invert: false; target: false; };
// Higher numbers make the mouse more sensitive (cursor moves faster),
// 4000 max for MX Master 3.
dpi: 1500;

1.0 Introduction to btrfs

  • Btrfs: “ZFS lite” for Linux
  • Oracle’s Btrfs filesystem project (“B-tree file system,” officially pronounced “butter FS” or “better FS,” though it’s hard not to think “butter face”) aimed to repeat many of ZFS’s advances on the Linux platform during the long interregnum when ZFS seemed like it might be lost to Linux because of licensing issues.
  • BtrFS VS ZFS

btrfs1.png

btrfs2.png

btrfs3.png

@dsabanin
dsabanin / enable-xcode-debug-menu.sh
Last active November 7, 2022 16:17
Enable internal Xcode debug menu in Xcode 11
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode
sudo touch /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/AppleInternal.plist
# Don't forget to restart Xcode
@jat001
jat001 / namebase.py
Created February 20, 2020 10:05
Sell HNS automatically
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from decimal import Decimal
from datetime import datetime
try:
import requests
import simplejson as json
@MakiseKurisu
MakiseKurisu / proxmox_btrfs_raid1.sh
Last active December 3, 2024 19:31
Convert Proxmox VE over Btrfs to RAID-1 configuration
# Please follow https://gist.github.com/MakiseKurisu/3a44918bccf3383c0b5ccf362f429c8b first to set up rootfs
# Assuming rootfs on /dev/sdb2, and adding /dev/sda to the RAID-1 configuration
# Remove existing Proxmox installation and LVM Thin storage
pvesm remove local-lvm
vgremove pve -y
# Set up partition table
(echo g; echo n; echo ''; echo ''; echo '+512M'; echo t; echo 1; echo n; echo ''; echo ''; echo ''; echo w) | fdisk /dev/sda
@jmurphyau
jmurphyau / download.sh
Created February 9, 2020 22:47
Download HLS Stream with FFmpeg
#this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy project5.mp4
# or this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy -bsf:a aac_adtstoasc project3.mp4