https://support.apple.com/en-sg/guide/mac-help/mchlp1599/
Apple silicon:
- use Erase Assistant to reset your Mac to factory settings
- Apple menu > Shut Down. Press and hold the power button until “Loading startup options” appears
Intel based:
- Power on, Alt -> Startup Disk
- Power on, Command (⌘)-R -> Recovery
- Power on, Command (⌘)-Option-R -> Internet Recovery (original version of macOS)
- Power on, Option-⌘-P-R -> reset NVRAM
Download old macOS https://support.apple.com/en-us/HT211683 https://osxdaily.com/where-download-macos-installers/
Create bootable installer https://support.apple.com/en-us/HT201372
sudo nvram –d SystemAudioVolume
softwareupdate --all --install --force
Add a Brewfile
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew bundle --file bundle-file
see new macOS setup automation
Add to new users .zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew install python
using SDKMAN
install
curl -s "https://get.sdkman.io" | bash
run
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk version
sdk install java
sdk list
change install JDK version
java -version
export JAVA_VERSION=11
unset JAVA_HOME
java -version
open -a ApplicationName
Restart remotely system using FileVault run this command to restart
sudo fdesetup authrestart
When restart normally, system will wait for password at startup. Remote screen sharing will not be able to connect until the password is entered locally.
manage the startup services
launchctl list
launchctl disable system/
List of startups
cd /Library/LaunchAgents/
brew install jq
curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" > /tmp/curlout
DLURL=$(cat /tmp/curlout | jq -r '.assets | .[0].browser_download_url' | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg
rm /tmp/curlout
from, edited to
- fix
curl: (23)
error - fix
no match found: .assets[].browser_download_url
Some basics (run as the user)
dockutil -L
To see hidden files command+shift+.
tmutil listlocalsnapshots /
crash reports
~/Library/Logs/DiagnosticReports/
touch /Volumes/portableDisk/.metadata_never_index
View settings
pmset -g
From man page: hibernatemode = 25 is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you should use this setting.
standby setting
set standby to 12h after sleep
sudo pmset -a standbydelayhigh 43200
sudo pmset -a standbydelaylow 7200
set autopoweroff to 24h after sleep
sudo pmset -a autopoweroffdelay 86400
After sleeping for seconds, the system will write a hibernation image and go into a lower power chipset sleep.
change resolution option + click on Scaled
fix hidden screen
xcode-select --install
To enable completion
brew install zsh-completions
follow the steps to enable and also to fix `zsh compinit: insecure directories`` warnings
.zshrc