58
GET THE MOST OUT OF YOUR MAC OS X TRAINING 25.11.2015 JANNE WARÉN

Get the most out of your Mac OS X

Embed Size (px)

Citation preview

Page 1: Get the most out of your Mac OS X

GET THE MOST OUT OF YOUR MAC OS X

TRAINING 25.11.2015 JANNE WARÉN

Page 2: Get the most out of your Mac OS X

INTRODUCTION

WHAT? WHY?

▸ School assignment

▸ Share some knowledge

▸ Just one option, not the truth

▸ Lot of topics, just the basics

▸ Some of the apps are not free of charge

▸ Please don’t try these during the presentation

Page 3: Get the most out of your Mac OS X

INTRODUCTION

AGENDA

▸ Warm up - OS X built-in shortcuts and tricks

▸ A better terminal emulator: iTerm

▸ Alternative to bash: zsh

▸ Manage your windows with Spectacle

▸ smcpuff: why isn't this built-in to git?

▸ Back to basics: readline is awesome

▸ Spotlight on steroids: Alfred

▸ Keep your connections open with mosh

▸ Tmux: like screen, only better

▸ Learn and memorise keyboard shortcuts with Hotkey EVE

Page 4: Get the most out of your Mac OS X

BUILT-IN OS X TIPS & TRICKS

WARM-UP ROUND

Page 5: Get the most out of your Mac OS X

ALT-CLICKING NOT JUST FOR CHOOSING SOUND OUTPUT

+

Page 6: Get the most out of your Mac OS X

WARM UP - OS X BUILT-IN SHORTCUTS AND TRICKS

ALT-CLICKING…

▸ …on a file

▸ Always open with

▸ Copy file path

Page 7: Get the most out of your Mac OS X

WARM UP - OS X BUILT-IN SHORTCUTS AND TRICKS

ALT-CLICKING…

▸ …on the Apple menu

▸ Real system info

▸ Restart without annoying questions

Page 8: Get the most out of your Mac OS X

WARM UP - OS X BUILT-IN SHORTCUTS AND TRICKS

ALT-CLICKING…

▸ …on the Wi-Fi menu

▸ Connection information

Page 9: Get the most out of your Mac OS X

WARM UP - OS X BUILT-IN SHORTCUTS AND TRICKS

FINDER▸ Add your home directory to favourites: Finder -> Preferences -> Sidebar

▸ Show path bar and status bar: Finder -> View menu

▸ Show/hide hidden files in Open… dialog: [Cmd + Shift + .]

▸ Delete file: [Cmd + backspace]

COPY/PASTE ON THE TERMINAL ▸ pbcopy

▸ pbpaste

RE-ARRANGE YOUR MENUBAR ICONS ▸ [Cmd + Click] + Drag with mouse

Page 10: Get the most out of your Mac OS X

ITERMA BETTER TERMINAL EMULATOR

Page 11: Get the most out of your Mac OS X

A BETTER TERMINAL EMULATOR: ITERM

WHY?

▸ A lot of features

▸ Split panes

▸ Search

▸ Autocomplete

▸ Paste history

Page 12: Get the most out of your Mac OS X

A BETTER TERMINAL EMULATOR: ITERM

KILLER FEATURES (FOR ME)

▸ Hotkey window

▸ Terminal is never missing, always one click away

▸ My choice is [Alt + >/<]

▸ Instant replay

▸ Get back the small amount of data you just lost

▸ Move back in time: [Alt + Cmd + B]

▸ Move forward in time: [Alt + Cmd + F]

▸ Configuration

▸ Map anything to any key easily

▸ You should map at least numpad number keys and Alt + arrows

▸ ⎇→ = Esc + f and ⎇← = Esc + b

Page 13: Get the most out of your Mac OS X

A BETTER TERMINAL EMULATOR: ITERM

HOW?

▸ It’s free

▸ https://www.iterm2.com/downloads.html

Page 14: Get the most out of your Mac OS X

ZSHALTERNATIVE TO BASH

Page 15: Get the most out of your Mac OS X

ALTERNATIVE TO BASH: ZSH

WHY?

▸ Better autocomplete

▸ Cycling trough options

▸ Path expansion

▸ Git autocomplete

▸ Right prompt

▸ History search with arrows (eg. git ⇧)

Page 16: Get the most out of your Mac OS X

ALTERNATIVE TO BASH: ZSH

… AND MUCH MORE

▸ osx / Finder plugin (cdf)

▸ Path replacement

▸ Suffix aliases

Page 17: Get the most out of your Mac OS X

ALTERNATIVE TO BASH: ZSH

HOW?

▸ Free of charge

▸ Install oh-my-zsh

▸ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

▸ http://ohmyz.sh/

▸ Edit ~/.zshrc

Page 18: Get the most out of your Mac OS X

SPECTACLEWINDOW MANAGEMENT

Page 19: Get the most out of your Mac OS X

MANAGE YOUR WINDOWS WITH SPECTACLE

WHY?

▸ OS X seems to lack proper windows control

▸ Spectacle does one thing and does it right

▸ [Alt + Cmd + F] - fullscreen

▸ [Alt + Cmd + / ] - left/right side of screen (repeat for sizing)

▸ [Alt + Cmd + ⇧/ ] - top/bottom of screen (repeat for sizing)

▸ [Ctrl + Cmd + / ] - high quarters

▸ [Shift + Ctrl + Cmd + / ] - low quarters

▸ [Ctrl + Alt + Cmd + / ] - move window between screens

Page 20: Get the most out of your Mac OS X

MANAGE YOUR WINDOWS WITH SPECTACLE

ARE YOU SERIOUS?

▸ These shortcuts might seem a bit hard but I’m 100% sure you can learn them with a little bit of practise

Page 21: Get the most out of your Mac OS X

MANAGE YOUR WINDOWS WITH SPECTACLE

HOW?

▸ Free of charge

▸ https://www.spectacleapp.com/

▸ Note: Disable [Ctrl + C] for centering, if you use Alfred’s clipboard for that

Page 22: Get the most out of your Mac OS X

SCMPUFFGIT COMMAND LINE ENHANCEMENTS

Page 23: Get the most out of your Mac OS X

GIT COMMAND LINE ENHANCEMENTS: SCMPUFF

NUMBERS FOR FILES IN GIT

Page 24: Get the most out of your Mac OS X

TEXT

USAGE▸ Use the numbers

▸ git add 1

▸ git add 2-4 5 7 9-12

▸ Also there’s more aliases for git commands

▸ gs='scmpuff_status'

▸ ga='git add'

▸ gd='git diff'

▸ gl='git log'

▸ gco='git checkout'

▸ grs='git reset'

Page 25: Get the most out of your Mac OS X

GIT COMMAND LINE ENHANCEMENTS: SCMPUFF

HOW?

▸ Free of charge

▸ https://github.com/mroth/scmpuff

▸ Install:

▸ brew install scmpuff

▸ Add eval "$(scmpuff init -s)" to ~/.zshrc or ~/.bashrc

Page 26: Get the most out of your Mac OS X

READLINEBACK TO BASICS

Page 27: Get the most out of your Mac OS X

BACK TO BASICS: READLINE

EVERYTHING IS READLINE, (AND READLINE IS EMACS)

▸ Almost universal shortcuts, should work on Mac and Linux

▸ For example:

▸ [Tab] to autocomplete

▸ [Ctrl + C] to kill current task

▸ [Ctrl + Z] to stop current task

▸ [Ctrl + R] to reverse search history

Page 28: Get the most out of your Mac OS X

BACK TO BASICS: READLINE

SOME MORE USEFUL SHORTCUTS

▸ [Ctrl + A] - move to beginning of line

▸ [Ctrl + E] - move to end of line

▸ [Ctrl + X X] - move between start of line and current position

Page 29: Get the most out of your Mac OS X

BACK TO BASICS: READLINE

SOME MORE USEFUL SHORTCUTS

▸ Cutting:

▸ [Ctrl + W] - cuts a word before cursor

▸ [Ctrl + U] - cuts the whole line (or before cursor)

▸ [Ctrl + K] - cuts the whole line after cursor

▸ [Ctrl + Y] - yank (paste)

▸ [Ctrl + L] - clear the screen

Page 30: Get the most out of your Mac OS X

BACK TO BASICS: READLINE

HOW?

▸ You already have it :)

▸ Read more:

▸ https://en.wikipedia.org/wiki/GNU_Readline

Page 31: Get the most out of your Mac OS X

ALFREDSPOTLIGHT ON STEROIDS

Page 32: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

LIKE SPOTLIGHT, LAUNCH / DO WHATEVER FROM A POP-UP

▸ For example [Alt + Space] to launch

▸ [Return] to paste right into the foremost window

▸ [Cmd + C] to copy (d’oh!)

▸ [Cmd + L] for large type

▸ [Shift] to preview

Page 33: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

BASIC SYSTEM COMMANDS

▸ shutdown

▸ restart

▸ sleep

▸ eject

▸ quit

▸ quitall

Page 34: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

OPEN AND FIND FILES AND CONTENT

▸ find

▸ open

▸ in

Page 35: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

WEB SEARCH

▸ You can customize whatever url you want, defaults include

▸ google

▸ maps

▸ wiki

▸ images

▸ youtube

Page 36: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

BUILT-IN CALCULATOR

▸ You never have to open calculator again

▸ Just type in and watch it crunch the numbers

▸ Advanced mode with =

▸ sin, cos, tan, log, log2, ln, exp, abs, sqrt, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, ceil, floor, round, trunc, rint, near, dtor, rtod

Page 37: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

MISCELLANUOUS

▸ > to run any shell command (needs tweaking for iTerm)

▸ spell

▸ define

Page 38: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

CLIPBOARD

▸ Alfred saves all clipboard activity (max 3 months)

▸ View history

▸ [Alt + Cmd + C]

▸ clipboard

▸ clear

▸ You can save snippets from the Alfred UI

▸ snip

Page 39: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

POWERPACK / WORKFLOWS

▸ This is where the real power lies

▸ You can do anything you want with Alfred (AppleScript)

▸ packal.org has 663 workflows

▸ There’s also Alfred Remote which is cool but.. dunno how useful

Page 40: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

MY FAVORITE WORKFLOWS

▸ “Audio Device” by mikegrb: input / output

▸ “Colors” by Tyler Eich: #123123

▸ “Dash” by Kapeli: dash or ruby or …

▸ “EggTimer” by Carl Smith: timer

▸ “Emoji” by Carlos Galdino: emoji

▸ “Faker” by Gunther Groenewege: faker

Page 41: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

MY FAVORITE WORKFLOWS

▸ “Gemesis” by Edward Loveall: gem

▸ “Github commands” by Gregor Harlan: gh

▸ “Hash” by Luca Bigon: md5, base64, sha*

▸ “Install apps” by Maciej Skrzypczak: install

▸ “IP Address” by David Ferguson: ip

▸ “Kill process” by Nathan Greenstein: kill

▸ “Password Generator” by Dean Jackson: pwgen

Page 42: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

… AND THERE IS A LOT OF THEM

▸ TimeZones, Web Service Header, Resolve, Continuity Support, Compress Image, Wolfram Alpha, Packal Updater, Google Translate, OS X Toolbox, Stackoverflow

Page 43: Get the most out of your Mac OS X

SPOTLIGHT ON STEROIDS: ALFRED

HOW?

▸ The basic app is free but Powerpack costs 17 pounds

▸ www.alfredapp.com

▸ License is for two Macs (that you own! :P)

▸ Syncing of settings (and workflows) easily via Dropbox or any such service

Page 44: Get the most out of your Mac OS X

MOSHKEEP YOUR CONNECTIONS OPEN

Page 45: Get the most out of your Mac OS X

KEEP YOUR CONNECTIONS OPEN: MOSH

WHAT?

▸ Mosh is a replacement for SSH

▸ Just use it like ssh, eg. mosh [email protected]

▸ Keeps the connection open even when you’re offline

Page 46: Get the most out of your Mac OS X

KEEP YOUR CONNECTIONS OPEN: MOSH

HOW?

▸ Free of charge

▸ Should be installed both on server and on client

▸ Serverside on Debian / Ubuntu: apt-get install mosh

▸ Clientside on OS X: brew install mosh

Page 47: Get the most out of your Mac OS X

KEEP YOUR CONNECTIONS OPEN: MOSH

.. AND IF YOU EVER FORGET TO USE MOSH

▸ You will time out from the SSH session, and it will just be “frozen” for a while

▸ Type ~. to disconnect immediately so you can be back to work

Page 48: Get the most out of your Mac OS X

HOTKEY EVELEARN YOUR KEYBOARD SHORTCUTS

Page 49: Get the most out of your Mac OS X

LEARN YOUR KEYBOARD SHORTCUTS: HOTKEY EVE

REMINDERS ABOUT KEYBOARD SHORTCUTS

▸ It reminds you of keyboard shortcuts you missed, so you’ll learn as you go

▸ Just launch the app and keep it running

▸ Use you computer like you would

▸ If you missed a keyboard shortcut, you’ll get a notification

Page 50: Get the most out of your Mac OS X

LEARN YOUR KEYBOARD SHORTCUTS: HOTKEY EVE

HOW?

▸ Download and evaluate for free

▸ http://www.hotkey-eve.com/

▸ Registering costs 3,10€

Page 51: Get the most out of your Mac OS X

TMUXLIKE SCREEN, ONLY BETTER

Page 52: Get the most out of your Mac OS X

TMUX: LIKE SCREEN, ONLY BETTER

MAIN FEATURES

▸ Manage multiple terminal sessions and keep them open

▸ Windows

▸ Panes

▸ Needs quite a lot of getting used to and setting up

▸ Hotkey to Caps Lock

▸ Caps Lock + Space for multi-input

▸ Recent version for Caps Lock + Z

Page 53: Get the most out of your Mac OS X

TMUX: LIKE SCREEN, ONLY BETTER

ESSENTIAL SETUP TO MAKE IT USABLE

▸ Assign Caps lock as your tmux hotkey - who needs Caps lock anyway??

▸ Change Caps lock key to keycode 109 (F10 key) with Seil

▸ Set F10 as your hotkey in .tmux.conf

▸ set-option -g prefix F10

Page 54: Get the most out of your Mac OS X

TMUX: LIKE SCREEN, ONLY BETTER

KEYBOARD COMMANDS

▸ Divide vertically (create new pane): [Caps lock + %]

▸ Divide horizontally (create new pane): [Caps lock + “]

▸ Move between panes: [Caps lock + ⇧/ /⇧/ ]

▸ Zoom in (make a pane fullscreen): [Caps lock + Z]

▸ Input to all panes at once: Caps Lock + Space

▸ .tmux.conf

▸ unbind-key space

▸ unbind space

▸ bind-key space setw synchronize-panes

Page 55: Get the most out of your Mac OS X

TMUX: LIKE SCREEN, ONLY BETTER

LEARN MORE MORE

▸ https://robots.thoughtbot.com/a-tmux-crash-course

Page 56: Get the most out of your Mac OS X

ALL OUT OF TIME - BETTER LUCK NEXT TIME

TOPICS NOT COVERED

▸ Software I can recommend

▸ Little Snitch

▸ iStat Menus

▸ Beyond Compare

▸ Atom Editor

▸ Other topics that would be good

▸ Automator

▸ Basic bash / Linux inline stuff with combining: grep, tr, awk, cut, xargs

▸ tmux in all detail

Page 57: Get the most out of your Mac OS X

QUESTIONS???

Page 58: Get the most out of your Mac OS X