Mac - techniq/wiki GitHub Wiki

Terminal

QuickLook preview from command line

qlmanage -p <file>

Why is my Mac slow?

top -o vsize

Stop your Mac from sleeping for an hour

caffeinate -u -t 3600

Execute command at given time

echo "ls -l" | at midnight

Restart apps

The Finder crashed:

killall -KILL Finder

(you can also restart the Finder by option (=alt) + rightclicking the Finder icon in the Dock and selecting Relaunch. It doesn't always work though.)

The Dock crashed:

killall -KILL Dock

Spaces crashed:

killall -KILL Dock

The Menubar crashed/refuses to be clickable:

killall -KILL SystemUIServer

Create .img from .dmg image

hdiutil convert disk.dmg -format RdWr -o disk.img

Setup Dnsmasq

Watch network packets

Watch interface en4 for DNS packets

sudo tcpdump -A -s0 -nni en4 port 53

Mount ssh partitions

Install osxfuse and sshfs

brew install Caskroom/cask/osxfuse
brew install homebrew/fuse/sshfs\

Mount ssh directory

sshfs [email protected]:/home/pi some_directory

Unmount

umount some_directory

⚠️ **GitHub.com Fallback** ⚠️