Skip to content

Instantly share code, notes, and snippets.

View acodega's full-sized avatar

Adam Codega acodega

View GitHub Profile
set theDialogText to "The current date and time is " & (current date) & "."
display dialog theDialogText
--> Result: {button returned:"OK"}
startosinstall command & syntax
Command: startosinstall
Requires root access: Yes
Parameters:
- -usage: Displays all parameters available for the command.
- -agreetolicense: Agrees to the license agreement during deployment (Required for automated deployments).
@acodega
acodega / SIP how to
Created March 13, 2019 13:08
See what's SIPed from Terminal
cat /System/Library/Sandbox/rootless.conf
ls -ale # and look for com.apple.rootless
#!/bin/bash
ibridge="$(/usr/sbin/system_profiler SPiBridgeDataType | /usr/bin/grep 'Model Name')"
if [[ "$ibridge" == "" ]] ;
then
defaults write /Library/Preferences/org.myorg.machineDetails.plist awesomechip -string "None"
else
defaults write /Library/Preferences/org.myorg.machineDetails.plist awesomechip -string "$ibridge"
fi
@acodega
acodega / Redirections
Created March 1, 2019 14:26
in macOS Terminal
# Output to a file, overwriting it if it exists
ls > ~/Desktop/file.txt
# Output to a file, appending to it if it exists
ls >> ~/Desktop/file.txt
# Pipe output to an application, the "-fe" tag will instruct to read the piped input and open it as a new unsaved file
ls | open -fe
# Pipe output to the Mac's clipboard
log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h
@acodega
acodega / Clearing DNS cache
Created January 15, 2019 14:29
Clearing DNS cache, 10.5 through 10.14
# 10.10.4-Current
sudo killall -HUP mDNSResponder
# 10.10.0-10.10.3
sudo discoveryutil mdnsflushcache
# 10.7-10.9
sudo killall -HUP mDNSResponder
# 10.5-10.6
# Run in Terminal, no restart required.
sudo sysctl debug.lowpri_throttle_enabled=0
# Reverted at restart.
@acodega
acodega / macOS Recovery Mode in VMware Fusion
Created October 12, 2018 18:53
macOS Recovery Mode in VMware Fusion
1) Choose Power on to Firmware from the Virtual Machine menu
2) then Enter Setup
3) Boot from a file
4) Arrow down to Recovery HD
5) Hit enter until you can pick boot.efi
6) select boot.efi
7) hit enter
@acodega
acodega / UMAD Identifier
Created October 11, 2018 03:52
Find your ProfileIdentifier to configure UMAD
profiles -C -o stdout-xml | grep -A 1 ProfileIdentifier