Git Product home page Git Product logo

mac-setup's Introduction

MacBook Setup

Introduction

First thing you need to do, on any OS actually, is update the system! For that: Apple menu () > About This Mac > Software Update.

System Preferences

Run the defaults script to configure most defaults for the OS and native applications.

$ ./set-defaults.sh

Security & Privacy

  • Enable FileVault
  • Enable Firewall
    • Uncheck everything except for Enable Stealth Mode

Users & Groups

  • Set up Password, Apple ID, Picture, etc.

Internet Accounts

  • Add iCloud account for iCloud Drive, Photos, Reminders, Safari, Notes, Keychain, Find My Mac
  • Add Google account for Contacts, Mail and Calendar
  • Add Facebook account for Notifications and Share Menu

Finder

  • Toolbar
    • Add "New Folder" icon
  • Sidebar
    • Add Home and Projects directories
    • Remove tags

Time Machine

  • Select Orion server as backup destination
  • Backup automatically

Screensaver

Install the Aerial screensaver for Mac here. Enable it in System Preferences.

Xcode

Install Xcode from the App store or the Apple developer website.

For installing Xcode command line tools run the command

$ xcode-select --install

It'll prompt you to install the command line tools. Follow the instructions and now you have Xcode and Xcode command line tools both installed and running.

Homebrew

In the terminal paste the following line (without the $), hit Enter, and follow the steps on the screen:

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install brew casks:

$ brew tap caskroom/cask

One thing we need to do is tell the system to use programs installed by Hombrew (in /usr/local/bin) rather than the OS default if it exists. We do this by adding /usr/local/bin to your $PATH environment variable:

$ echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile

Open an new terminal tab with Cmd+T (you should also close the old one), then run the following command to make sure everything works:

$ brew doctor

Quicklook Plugins

Some plugins to enable different files to work with Mac Quicklook. Includes features like syntax highlighting, markdown rendering, preview of jsons, patch files, csv, zip files etc.

QUICK_LOOK_PLUGINS=(
	qlcolorcode
	qlstephen
	qlmarkdown
	quicklook-json
	quicklook-csv
	betterzipql
	webpquicklook
)

echo "Installing Quick Look plugins..."
brew cask install ${QUICK_LOOK_PLUGINS[@]}

Applications

Most applications can be installed with brew:

CASKS=(
	arq
	atom
	docker-toolbox
	dropbox
	flux
	google-chrome
	google-drive
	google-hangouts
	grammarly
	iterm2
	keyfinder
	macdown
	postico
	pycharm
	remote-play
	skype
	slack
	sublime-text
	transmission
	virtualbox
	vlc
	whatsapp
)
echo "Installing cask apps..."
brew cask install ${CASKS[@]}

Tools

iTerm2

Colors and Font Settings

  • Download the Solarized Dark iTerm2 color scheme from here. And then set these to your default profile colors.
  • Download the patched Menlo Powerline font from here. And set to 14pt for regular text, 15pt for non-ASCII text.

Enable word jumps

By default, word jumps (option + → or ←) do not work. To enable these, go to "iTerm -> Preferences -> Profiles -> Keys". Press the + sign under the list of key mappings and add the following sequences:

Option + right

⌥→
Send Escape Sequence
f

Option + left

⌥←
Send Escape Sequence
b

ZSH

Install zsh, zsh completions and zsh-syntax-highlighting using homebrew:

$ brew install zsh zsh-completions zsh-syntax-highlighting
$ chsh -s /usr/local/bin/zsh

Install oh-my-zsh on top of zsh to get additional functionality

$ curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh

Set up ~/.zshrc:

ZSH_THEME="agnoster"
plugins=(brew colored-man-pages docker git git-flow-avh pip pyenv extract urltools)
DEFAULT_USER=`whoami`

# Add env.sh
source ~/env.sh

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Create ~/env.sh:

#!/bin/zsh

# PATH
export PATH="/usr/local/bin:$$PATH"  # FIX: the double "$$"
export EDITOR='subl -w'

# mkdir and cd
function mkcd() { mkdir -p "$@" && cd "$_"; }

# Aliases
alias ll="ls -lh"
	
	
# Use sublimetext for editing config files
alias zshconfig="subl ~/.zshrc"
alias envconfig="subl ~/env.sh"

Git

To install, simply run:

$ brew install git

Next, define the git user:

$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
$ git config --global credential.helper osxkeychain

SSH

First, we need to check for existing SSH keys on your computer. Open up your Terminal and type:

$ cd ~/.ssh
$ ls -al

Use a strong passphrase for keys.

$ ssh-keygen -t rsa -b 4096 -C "Your Name (MacBook) <[email protected]>"

Add the public key to GitHub and BitBucket.

Python

Install pyenv using homebrew:

$ brew install pyenv

After installing, add pyenv init to your shell to enable shims and autocompletion.

$ echo 'eval "$(pyenv init -)"' >> ~/env.sh

Open a new terminal and enter these commands:

$ pyenv install 3.6.1
$ pyenv global 3.6.1

Open another new terminal, install Jupyter and iPython:

pip3 install --upgrade pip
pip3 install jupyter ipython

To install pipenv, enter this command:

$ pip install pipenv

Node.js

To install or update nvm, you can use the install script using cURL:

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

Open a new terminal window and enter this command:

$ nvm install --lts

To upgrade the copy of npm that is provided with Node.js, run this command in a new terminal:

$ npm -g upgrade npm

AWS CLI

Install the CLI:

$ brew install awscli

Configure profiles:

$ aws configure --profile personal
AWS Access Key ID [None]: **REDACTED**
AWS Secret Access Key [None]: **REDACTED**
Default region name [None]: ap-southeast-2
Default output format [None]: text

$ aws configure --profile porter
AWS Access Key ID [None]: **REDACTED**
AWS Secret Access Key [None]: **REDACTED**
Default region name [None]: ap-southeast-2
Default output format [None]: text

Folder Structure

Create some basic folder structure:

echo "Creating Projects folder..."
cd ~
[[ ! -d Projects ]] && mkdir Projects

echo "Creating Downloads folder structure..."
cd ~/Downloads
[[ ! -d Applications ]] && mkdir Applications
[[ ! -d Misc ]] && mkdir Misc
[[ ! -d Movies ]] && mkdir Movies
[[ ! -d Music ]] && mkdir Music
[[ ! -d "TV Shows" ]] && mkdir "TV Shows"

echo "Creating Pictures folder structure..."
cd ~/Pictures
[[ ! -d Wallpapers ]] && mkdir Wallpapers

cd ~
echo "Done!"

Format and Reinstall MacOS on other device

https://support.apple.com/en-au/HT201065

References

  1. http://sourabhbajaj.com/mac-setup/index.html
  2. http://www.stuartellis.name/articles/mac-setup/
  3. https://github.com/michaelzoidl/setup-new-macbook/
  4. https://github.com/danguita/osx-for-developers/

mac-setup's People

Contributors

hscgavin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.