macOS
Apple's Unix-like OS.
Launchd
A system and service manager for macOS (like systemd for Linux).
Launchd services are called agents (user) and daemons (root).
The launchctl
command is used to interact with launchd.
Scripting
Key remapping
With hidutil
(builtin):
With Karabiner-Elements (3rd party):
Terminal
macOS-only tools:
pbcopy
: copy to system clipboardpbpase
: paste from system clipboardopen
: open files and applicationsdiskutil
: manage disks and volumescaffeinate
: prevent system from sleepingnetworkQuality
: builtin speed testtextutil
: text file convertersay
: text-to-speech engine
Gatekeeper
Disable:
- Permanently: https://disable-gatekeeper.github.io
- Per app:
xattr -d com.apple.quarantine <path/to/app>
⚠️ Warning
Quarantine stores information about downloads by all kinds of applications.
UTI
A Uniform Type Identifier is a unique string describing a file format,
e.g. com.microsoft.word.doc
for a Microsoft Word documents.
Get the UTI of a file:
mdls -name kMDItemContentType -name kMDItemKind path/to/file
💡 Hint
Use duti to set default applications for document types.
Misc
- Defaults: https://macos-defaults.com
- Hardening: https://www.bejarano.io/hardening-macos
- Safari bookmarks location:
~/Library/Safari/Bookmarks.plist
How to
Authenticate sudo
with TouchID:
cd /etc/pam.d
sudo mv sudo_local.template sudo_local
## uncomment the last line
Enable Metal HUD:
launchctl setenv MTL_HUD_ENABLED 1