home blog portfolio Ian Fisher

macOS

The Unix-like operating system that runs on Macbook computers. Long known as "OS X".

Cheatsheet

Launchd

See wiki/launchd

Keyboard shortcuts

Screenshots

Finder

Other

Flush DNS cache

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

sandbox-exec

$ sandbox-exec -f restrictions.sb CMD ARG1...
$ cat restrictions.sb
(version 1)

(deny default)
(allow process-exec)
(allow sysctl-read)
(allow file-read* (subpath "/"))

Make a file downloaded from the Internet executable

xattr -d com.apple.quarantine path/to/file

Set default application to open file type

Find a file of the desired type, click "Get Info" in Finder, and use "Open With" section.

Can't eject drive because it is in use