Skip to content

Instantly share code, notes, and snippets.

View brianonn's full-sized avatar

Brian Onn brianonn

  • Vancouver, Canada
  • 05:18 (UTC -08:00)
View GitHub Profile
@brianonn
brianonn / README.md
Last active October 16, 2026 11:44 — forked from ErilovNikita/README.md
Proxmox Boot Order Checker

Proxmox Boot Order Checker

This script displays a table of all virtual machines (KVM) and containers (LXC) on a Proxmox node, along with their startup order. It neatly displays the ID, Name, Type, OnBoot, Order, and Delay, sorted by startup priority, making it convenient for visually auditing the service startup order.

This script is useful for quickly auditing and verifying the correct order of launching virtual machines and containers on a Proxmox node to avoid dependency conflicts during startup.

Peculiarities

  • Supports both VMs and LXC containers.
  • Converts the onboot parameter to yes/no.
@brianonn
brianonn / av1-gpu-setup.yaml
Last active March 20, 2026 05:32
Playbook to build a AV1 encoder GPU VM on Digital Ocean
---
- name: Compile FFmpeg with NVENC AV1 for RTX 4000
hosts: localhost
connection: local
become: yes
tasks:
- name: Install build dependencies
apt:
name:
- build-essential
@brianonn
brianonn / sfv_verify.py
Created November 9, 2025 05:04
SFV verifier
#!/usr/bin/env python3
"""
SFV (Simple File Verification) file validator.
Reads an SFV file and verifies the CRC32 checksum of each listed file.
"""
import sys
import os
import zlib
@brianonn
brianonn / Makefile
Last active June 25, 2025 23:29
a single Makefile bootstrap for a simple C++ project with cmake
PROJECT = main
MAINCPP = main.cpp
CMAKELISTS = CMakeLists.txt
.PHONY: clean run bootstrap all
all: build/$(PROJECT)
build/$(PROJECT): $(MAINCPP) build
$(MAKE) -C build
@brianonn
brianonn / format_seconds.py
Last active April 14, 2025 04:11
A Python function to format a float seconds value into a string representation for milliseconds, microseconds, nanoseconds, or picoseconds
def format_seconds(seconds):
"""
Format a decimal number of seconds into the most appropriate unit
(ms, μs, ns, ps) with engineering notation exponents (3, 6, 9, 12),
truncated to 2 decimal places.
Args:
seconds (float): Time in seconds
Returns:
@brianonn
brianonn / README.md
Last active March 13, 2025 09:58
delete all resources in a Google Cloud Private Network (aka VPC)

Usage

$ delete-gcloud-network.sh ny-vpc1

Below is the output

#!/usr/bin/env bash

##
@brianonn
brianonn / apikey.go
Last active January 11, 2025 01:02
Create a 256-bit API key and secret key from random data using Blake2 hash and displayed in base32 and base56. Includes PBKDF2 for DB
package main
import (
"crypto/rand"
"encoding/base32"
"fmt"
"log"
"github.com/btcsuite/btcutil/base58"
"golang.org/x/crypto/blake2b"
#!/bin/sh
# test -f /root/wakeup.sh && exit 0
uci batch <<EOF
set system.@system[0].hostname='WR703N'
set system.@system[0].conloglevel=8
set system.@system[0].cronloglevel=8
set system.@system[0].timezone=HKT-8
set system.@system[0].zonename='Asia/Hong Kong'
@brianonn
brianonn / pandoc.css
Created September 14, 2024 23:25 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@brianonn
brianonn / github-pandoc.css
Created September 14, 2024 23:24 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/