Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Wowfunhappy / proxy.go
Last active March 12, 2025 11:18
Go Proxy
// Written (entirely) by a combination of o1, o3-mini, and claude 3.5 sonnet, with lots of human testing and trial-and-error.
// This proxy will mitm https requests so that old apps on legacy versions of OS X can connect to modern https servers.
// Unlike Squid, this proxy does not appear to cause issues with pip or websockets.
// It does not require special rules for Apple domains to avoid breaking iMessage. It appears to be side effect free!
// Also unlike Squid, this proxy uses OS X's System Trust store for remote certificate validation.
// This is a good thing, but it means you probably want to manually add some modern certificates to Keychain Access,
// such as ISRG Root X1 certificate and GTS Root R1.
@Wowfunhappy
Wowfunhappy / download-mavericks.sh
Last active March 13, 2025 13:47
Download a Mac OS X 10.9 Mavericks installer image Apple
#!/bin/bash
#!/bin/sh
# Download script written by Wowfunhappy. Last updated 2025/03/07.
# Thank you to Krackers, Jazzzny, and others for helping analyze Apple's download process and debug this script.
# Thank you to dosdude1 for donating identifiers from a broken Mac.
# Any mistakes are mine alone.
BOARD_SERIAL_NUMBER="C0243070168G3M91F"
@pudquick
pudquick / self_signed.sh
Last active April 2, 2024 21:04
Non-interactive self-signed unencrypted keypair generation for HTTPS for arbitrary domain with SAN
# Make a self-signed private/public keypair usable for HTTPS, including SAN / Subject Alternative Name and CN / Common Name, non-interactively and without additional files
# Parentheses around the command spin it up in a subshell so that the FQDOMAIN variable is local to execution and doesn't persist after it's created
(FQDOMAIN="example.local" && openssl req -x509 -nodes -newkey rsa:4096 -keyout server_key.pem -keyform PEM -days 365 -subj "/CN=${FQDOMAIN}" -addext 'basicConstraints=CA:FALSE' -addext "subjectAltName=DNS:${FQDOMAIN}" -addext 'keyUsage=digitalSignature' -addext 'extendedKeyUsage=serverAuth' -out server_cert.pem -outform PEM 2>/dev/null)
# Alternatively, if you're setting FQDOMAIN somewhere else, you can just run directly:
openssl req -x509 -nodes -newkey rsa:4096 -keyout server_key.pem -keyform PEM -days 365 -subj "/CN=${FQDOMAIN}" -addext 'basicConstraints=CA:FALSE' -addext "subjectAltName=DNS:${FQDOMAIN}" -addext 'keyUsage=digitalSignature' -addext 'extendedKeyUsage=serverAuth' -out server_
@rtrouton
rtrouton / pkg_cheatsheet.md
Created November 14, 2022 22:00
Working with Apple pkgs

Mac Packaging Cheatsheet

Create a component pkg from a DMG

pkgbuild --component /Volumes/ApplicationName/*.app --install-location \
    /Applications ApplicationName-Version.pkg

Install pkg from command line

@itsmikita
itsmikita / README.md
Last active March 4, 2025 11:04
Create bootable USB drive from InstallMacOSX.pkg

Create bootable USB drive from InstallMacOSX.pkg

  1. Erase USB drive with Disk Utility using format Mac OS Extended (Journaled) and Master Boot Record and call it MyVolume
  2. Use Finder to mount/open InstallMacOSX.dmg.
  3. Run following commands:
pkgutil --expand /Volumes/Install\ OS\ X/InstallMacOSX.pkg /tmp/El\ Capitan
diskutil eject Install\ OS\ X
cd /tmp/El\ Capitan
@mdeanda
mdeanda / prepare.sh
Last active March 16, 2025 22:23
Scripted generation of Arch Linux ARM image to run in QEMU in an Arch Linux host (x86_64)
#!/bin/bash
#
# Script to build and run Arch Linux ARM in QEMU inside of Arch Linux (x86_64)
#
#
# Original how-to and script from:
# * https://gist.github.com/thalamus/561d028ff5b66310fac1224f3d023c12
# * https://git.sr.ht/~whynothugo/m1-vm/tree/main/item/prepare.sh
set -euo pipefail
@piotrkundu
piotrkundu / msys2_with_git_for_windows.md
Last active April 11, 2025 03:42
Full MINGW64 environtment with MSYS2 instead of Git Bash for Windows

BACKGROUND (WHY?)

I switch dev-environments every single year with each customer having their own setup. Git on Linux and MacOSX just works most of the time - there are some SSH keys needed to be setup, but "sudo apt-get" or "brew install" mostly does the trick.

Git for Windows is a box a sourcery, so when you install that you will get a version of slim MSYS2, MinGW64 and most importantly bash and git that runs from the bash. This is what you need 9 out of 10 times, if you ONLY need to use git to manage your source and then use other/external toolchains like VS Code, VS2022 or Windows Powershell or Command to compile your sh.ttt I mean stuff.

Then that 10th out of 10 times, you want to compile windows applications from the same terminal that you run git - just like you do on linux or OSX. If you are running Windows alone then having two terminals, one for git (with mingw64/msys2) and one for your ms whatever the compiler name is for C++.

@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Last active June 18, 2023 08:11
Simple bash script to create a Bootable ISO from macOS Monterey Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
# Change this at your desire. Sometimes this works out of the box, sometimes not.
# Default size: ~16 GB
DISK_SIZE="15361m"
@lombax85
lombax85 / gist:e25d331c063da83c5060693cada1a54f
Created April 15, 2021 09:14
Powernap on M1 and Big Sur
# check wake requests
pmset -g log | grep "Wake Requests"
# check wake logs
pmset -g log | grep darkwake
# statistics
pmset -g stats
# check if powernap is enabled

UPDATE

Although below are methods to extract the contents of a macOS package without actually installing it, the best way might be to create a blank disk image and install the package to this disk image in order to inspect the package contents. To do so:

  • Open the Disk Utility app.
  • Choose "File > New Image > Blank Image". Alternatively, simply press CMD-N.
  • Set the parameters and click on "Save" to create the blank disk image.
  • After creation, it should be already mounted. If not, you can mount it by navigating to the directory that it is placed at and double clicking on the disk image file.
  • Run the package installer by double clicking on the package file.
  • Select this newly created blank disk image as the destination and install it.
  • If the script is preventing you from installing by saying, for example, "macOS isn't installed", you can: