Skip to content

Instantly share code, notes, and snippets.

@tlyakhov
tlyakhov / 10-wancarp
Last active June 8, 2024 05:54
single-wan OpnSense HA setup. Put this file into /usr/local/etc/rc.syshook.d/carp on both primary/backup firewalls
#!/usr/local/bin/php
<?php
require_once("config.inc");
require_once("system.inc");
require_once("interfaces.inc");
require_once("util.inc");
$subsystem = !empty($argv[1]) ? $argv[1] : '';
$type = !empty($argv[2]) ? $argv[2] : '';
@spali
spali / 10-wancarp
Last active March 27, 2025 12:10
Disable WAN Interface on CARP Backup
#!/usr/local/bin/php
<?php
require_once("config.inc");
require_once("interfaces.inc");
require_once("util.inc");
$subsystem = !empty($argv[1]) ? $argv[1] : '';
$type = !empty($argv[2]) ? $argv[2] : '';
@gullyn
gullyn / flappy.html
Last active January 24, 2025 00:41
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@a-gu
a-gu / latest_vanilla.sh
Last active October 22, 2022 20:14
Downloads the latest VanillaMC jarfile (requires jq)
#!/usr/bin/env bash
# -h or --help CLI helptext
if [[ "$1" =~ ^-{1,2}h(elp)?$ ]] ; then
echo "Usage:"
echo " ./latest_vanilla.sh [branch] [asset] [output]"
echo
echo "Positional Arguments:"
echo " [branch] is \"release\" or \"snapshot\""
echo " [asset] is \"client\", \"client_mappings\", \"server\", or \"server_mappings\""
@ruanbekker
ruanbekker / tree_style_tab_firefox.md
Created November 28, 2019 06:18
Hide Native Tabs with Tree Style Tabs for Firefox
@a-gu
a-gu / latest_paper.sh
Last active October 22, 2022 20:14
Downloads the lateset PaperMC jarfile (using messy gawk JSON "parsing")
#!/usr/bin/env bash
base='https://papermc.io/api/v1/paper'
version=$(curl -s $base | gawk 'match($0, /"versions"\s*:\s*\[\s*"([^"]+)/, a) {print a[1]}')
build=$(curl -s "${base}/${version}" | awk '{print gensub(/^.+"builds"\s*:\s*{\s*"latest"\s*:\s*"([^"]+)".+$/, "\\1", "g");}')
url="${base}/${version}/${build}/download"
curl -JLO $url
@Alexey-Tsarev
Alexey-Tsarev / zfs_install.sh
Last active March 2, 2021 14:00
ZFS 0.8 at Raspberry Pi
#!/usr/bin/env sh
set -e
set -x
CUR_PWD="$(pwd)"
cd "$(dirname $0)"
if [ ! -d zfs ]; then
# https://github.com/zfsonlinux/zfs/wiki/Building-ZFS
@EnigmaCurry
EnigmaCurry / README.md
Last active February 25, 2024 02:33
Proxmox install log on bare metal

Proxmox install log on Bare Metal

Assumptions

  • A single node proxmox v5.4-3 install
  • Only one public IP address
  • LXC/KVM for "pet" (development) containers
  • Portainer / Docker for less stateful more automated use-cases
  • My server's FQDN is stardust.gtown.lan.rymcg.tech - use your own domain name.
@whiskerz007
whiskerz007 / gist:53c6aa5d624154bacbbc54880e1e3b2a
Last active November 10, 2024 02:39
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
apt-get update
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
apt-get update
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
@a-gu
a-gu / fio.sh
Last active October 12, 2019 02:49
Upload a file to File.io using a bash function in "~/.bash_functions"
#!/usr/bin/env bash
# Upload file to File.io (optional expiration)
# fio file_name [expiration]
fio () {
if [[ "$#" -ge "2" ]]; then
curl -F "file=@$1" "https://file.io/?expires=$2";
elif [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Uploads a file to file.io"