Mac

From Torben's Wiki

Shortcuts

Control + K : fill 2nd clipboad by cut text from cursor till end of line
Control + Y : paste from 2nd clipboad

Finder / Open file Dialogs

Command + Shift + . : show hidden files

Windows Management

Control + Tab : Switch between applications
Control + <   : Switch between windows of same application
swipe 3-finger-upwards : Mission Control

Disabling/speedup animations

# Window opening animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool true
# revert
# defaults write NSGlobalDomain

# The resizing animation
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# revert
# defaults write NSGlobalDomain NSWindowResizeTime -float 0.2

# The Quick Look window animation
defaults write -g QLPanelAnimationDuration -float 0
# revert
# defaults delete -g QLPanelAnimationDuration

# Launching an app from the Dock
defaults write com.apple.dock launchanim -bool false
# revert
# defaults write com.apple.dock launchanim -bool true

Time Machine Backups

Prepare external Hard Disk

Formating problem

Erase process has failed, press done to continue. Mediakit reports not enough space on device for requested operation.

Quoting [1] : Here's what I would try. First run

diskutil list

to get the name to the disk you're trying to format. The below commands assume this is "disk1", but replace "disk1" with the correct disk if it's something different. Now unmount the disk:

diskutil unmountDisk force disk1

and then write zeros to the boot sector:

sudo dd if=/dev/zero of=/dev/disk1 bs=1024 count=1024

finally attempt to partition it again:

diskutil partitionDisk disk1 GPT JHFS+ "My External HD" 0g

Encryption Takes For Ever

Quoting [2]: To speed up the process of TM encryption, go to Disk Utility, select your external HDD and erase and use the option journaled/encrypted. Once your external HDD is erased, you can redo the backup and the encryption will be as fast as a flash.

Delete old backups

mount backup drive in filder via connect to server

afp://my_DS_Hostname

now it can be found under Locations and you can delete old backups by sending them to bin (and cleaning that one afterwards)

Install Google Keep Notes as Application via Chromium

First download Chromium and move to applications than follow this guide to create a shell script for automator.

Type     = Application
Action   = Run Shell Script
Contents = /Applications/Chromium.app/Contents/MacOS/Chromium --app=https://keep.google.com

Save as .app in Application folder and drag to dock, done!

Settings

Hide top panel from secondary screen from [3]

Mission Control -> Uncheck the box next to 2Displays have separate Spaces"

Tools

Git

Git requires apple xcode tools

xcode-select --install

HomeBrew Package Manager

from [4] First update the formulae and Homebrew itself:

brew update

install

brew install mypackage

list installed pakages

brew list

uninstall

brew remove mypackage

You can now find out what is outdated with:

brew outdated

Upgrade everything with:

brew upgrade

By default, Homebrew does not uninstall old versions of a formula, so over time you will accumulate old versions. To remove them, simply use:

brew cleanup mypackage

or clean up everything at once:

brew cleanup

or to see what would be cleaned up:

brew cleanup -n

Special Commands

show dependancies

brew deps gnuplot

search for a package/version

brew search gnuplot

manual download file into cache to install a local file [5] ignore dependencies

brew install gnuplot --ignore-dependencies

Eraze Disk/fill by Zeros

diskutil zeroDisk /Volumes/myDiskName/

alternative: create a big file

dd if=/dev/zero of=tmp_file.txt

Spelling: unlearn a word/edit custom words

vim ~/Library/Spelling/LocalDictionar