home blog portfolio Ian Fisher

macOS cheatsheet

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 "/"))

See also