Skip to content

Instantly share code, notes, and snippets.

iODD
----
Files go in \_ISO
vhd/rmd is simply a raw disk image without header
.ISO - appears as a CD/DVD
.VHD USB fixed drive
hdd.vhd
#mkfile on macOS. creates sparse files if possible
#mkfile -n size[b|k|m|g] filename
#1GB sparse file
mkfile -n 1g newfile
#dd
#1GB file
dd if=/dev/zero of=newfile bs=1024 count=1000*1000
@patrickgill
patrickgill / quit_app.sh
Last active April 20, 2019 05:40
quit an app in OS X
#Quit app with AppleScript
osascript -e 'quit app "TextEdit"'
#kill by TERM signal
killall 'TextEdit'
#!/bin/bash
#About the SMC Firmware Updates (outdated), https://support.apple.com/en-au/HT202040
sysctl hw.model
system_profiler SPHardwareDataType | grep -i "Version" | awk -F ':' '{print $1 $2}'
/usr/libexec/firmwarecheckers/eficheck/eficheck --integrity-check
/System/Library/LaunchDaemons for native macOS processes
/Library/LaunchDaemons for installed third-party apps
/Library/LaunchAgents for all user accounts
~/Library/LaunchAgents for a specific user account
/System/Library/LaunchAgents for macOS only
# Kext info dump
# (c) Patrick Gill, 2019
first_arg, *the_rest = ARGV
Dir.chdir "/Volumes/Macintosh HD/System/Library/Extensions"
# Dir.chdir "/Library/Extensions"
puts "#Path, " + Dir.pwd
# Paths
/System/Library/Extensions/
/Library/Extensions/
# see what third-party extensions are currently there on your machine.
Kextstat | grep –v com.apple
# find the file defining a kext you only know the bundle name of.
kextfind -b <bundlename>
kextfind -b com.AmbrosiaSW.AudioSupport
@patrickgill
patrickgill / macos_usb_installer.txt
Last active October 25, 2021 17:11
macOS Installer USB preparation
download full installer on Catalina and above:
softwareupdate --fetch-full-installer
also download specific version:
softwareupdate --fetch-full-installer --full-installer-version 10.14.6
macOS 12 Monterey
sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled
macOS 11 Big Sur
sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled
@patrickgill
patrickgill / ASD
Last active April 27, 2023 05:44
3S106
iMac (Early 2006 17-inch):3S106
iMac (Early 2006 20-inch):3S106
MacBookPro (15-inch):3S106
MacBookPro (17-inch):3S106
Mac mini (Early 2006):3S106
MacBook (13-inch):3S106
iMac (Mid 2006 17- inch):3S106
Xserve (Early 2008):3X106
Xserve (Early 2009):3X106