Skip to content

Instantly share code, notes, and snippets.

@FelixHuang9977
FelixHuang9977 / builder.sh
Created April 22, 2025 21:48 — forked from ryancdotorg/builder.sh
Script to statically cross compile various useful binaries (dropbear, socat, rsync, rpcapd, tcpdump, openssl, zstd) using musl-libc via musl.cc toolchains,
#!/bin/bash
# From https://gist.github.com/ryancdotorg/84275935f0b82578d8c222e2e915fc78
# built binaries at https://ryanc-musl-bins.s3.amazonaws.com/SHA256SUMS.html
set -eo pipefail
set -x
export BUILD_SCRIPT_DATE="$(date -r "$0" -Iseconds)"
PV_VERSION=1.8.5

Lima Cheatsheet for macOS

I stumbled on an incredible open source solution, Lima. In some ways, it has some of Hashicorp's Vagrant's resemblance, but in my opinion, it's so much superior in many ways as it doesn't use external dependencies such as Oracle's VirtualBox.

If you're used to docker on the command line but wanted to play with VMs rather than containers, then this is for you! No need to fuss with cloud-init as a user account (using your existing username in whoami) with a proper home directory would be auto-generated for you with full passwordless sudo privilege. SSH access to the VMs from the host is seamlessly integrated as well.

This quick guide is for those who need to set up virtual machines with modern Linux OSes (only few selected OSes are best supported) from scratch using only the command line. You can have a VM up and running within minutes from absolutely nothing.

NOTE: This was last tested using:

  • `lima
@eduwass
eduwass / readme.md
Last active September 20, 2025 12:50
force 5g wifi on mac

Force 5 GHz WiFi Connection on macOS

If you're experiencing issues with your Mac connecting to the slower 2G band on routers that share SSID between 5G/2G (like the Google Wifi Nest), here's a guide to help you force a 5 GHz connection.

Identifying the 5G Channel

  1. Check Current Band: Hold option and click on the wifi icon on the macOS status bar. This will display the band you are currently connected to.
  2. Scan WiFi Channels: Use the following command to list all channels your WiFi is operating on:
    /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport scan
@levihuayuzhang
levihuayuzhang / alarm-m1-vm-build.md
Created January 2, 2023 07:20
Arch Linux ARM build for M1 (Apple Silicon) VMs

Arch Linux ARM build for M1 (Apple Silicon) VMs

This guide is for building your own Arch Linux ARM VM image and runnig in QEMU, UTM, Parallels...

Preparations in Linux

What you need in Linux phase:

1. qemu-img
2. fdisk
3. kpartx
4. bsdtar
@ejkarne
ejkarne / StageManagerOptions.md
Last active May 18, 2025 15:28
Stage Manager Options

defaults write com.apple.WindowManager GloballyEnabled -bool [True/False] Adjusts whether Stage Manager is enabled or not.

defaults write com.apple.WindowManager AutoHide -bool [True/False] Adjusts auto hide behavior. This option controls the "Show Recent Apps" and "Hide Recent Apps" GUI option.

defaults write com.apple.WindowManager AutoHideOverlapThreshold -int [-2147483647...2147483647] Unsure what this option does. Should be noted that when AutoHide is set to False and this option is set to -17 or lower Stage Manager behaves as if AutoHide is set to True.

defaults write com.apple.WindowManager LeftStripMaximumRowCount -int [-2147483647...2147483647]

@adsau59
adsau59 / ffmpeg_target_size.cmd
Last active August 4, 2022 12:42 — forked from Black-Platypus/ffmpeg_target_size.cmd
Windows Script: FFMPEG video compression/specific file size
@echo off
REM Windows implementation of Marian Minar's answer to "ffmpeg video compression / specific file size" https://stackoverflow.com/a/61146975/2902367
SET "video=%~1"
SET "target_video_size_MB=%~2"
SET "output_file=%~dpn1-%~2MB.mp4"
REM I usually don't see a big difference between two-pass and single-pass... set to anything but "true" to turn off two-pass encoding
SET "twopass=true"
REM We need a way to do floating point arithmetic in CMD, here is a quick one. Change the path to a location that's convenient for you
set "mathPath=%~dp0Math.vbs"
REM Creating the Math VBS file
# Example to use Docker instead of containerd & nerdctl
# $ limactl start ./docker.yaml
# $ limactl shell docker docker run -it -v $HOME:$HOME --rm alpine
# To run `docker` on the host (assumes docker-cli is installed):
# $ export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock')
# $ docker ...
# This example requires Lima v0.8.0 or later
images:
@ryancdotorg
ryancdotorg / builder.sh
Last active October 14, 2025 19:40
Script to statically cross compile various useful binaries (dropbear, socat, rsync, rpcapd, tcpdump, openssl, zstd) using musl-libc via musl.cc toolchains,
#!/bin/bash
# From https://gist.github.com/ryancdotorg/84275935f0b82578d8c222e2e915fc78
# built binaries at https://ryanc-musl-bins.s3.amazonaws.com/SHA256SUMS.html
set -eo pipefail
set -x
export BUILD_SCRIPT_DATE="$(date -r "$0" -Iseconds)"
PV_VERSION=1.8.14
$ cd "path to your SSL"
$ mkdir -p Fingerprints
$ openssl req -x509 -nodes -days 365 -subj /CN=barrier -newkey rsa:4096 -keyout barrier.pem -out barrier.pem
$ openssl x509 -fingerprint -sha1 -noout -in barrier.pem > Fingerprints/Local.txt
$ sed -e "s/.*=//" -i Fingerprints/Local.txt
@bashtheshell
bashtheshell / create_clover_bootloader_usb_macos.md
Last active October 13, 2025 17:16
Guide on Creating Clover Bootloader USB on macOS - useful for users with PCIe NVMe SSDs installed on Legacy BIOS machines.

How to Create Clover Bootloader USB on macOS (for PCIe NVMe SSD booting on Legacy BIOS system):

SUMMARY:

If you are a macOS user like me, and you want to create a Clover Bootloader USB on it just so that you can boot up the operating systems that are installed on PCIe NVMe SSDs on your archaic hardware using legacy BIOS? Then you've come to the right place. You may be a homelabber like myself wanting to boot up the hypervisor (e.g. Proxmox).

I've spent numerous hours, searching for a clear step-to-step guide on this, and apparently there isn't an easily-searchable one for macOS users at the time of this writing. Fortunately for us, the Clover project, hosted on GitHub, has a convenient package for us to create a bootloader USB. This project is also hosted on SourceForge.

DOWNLOADING CLOVER: