Transcript
Page 1: macos installation automation

i got a new laptop

Recently, I got a new laptop. This time, instead of going and installing all the software I needed willy nilly, I decided to document how I went about setting it up.

Page 2: macos installation automation

I documented it with BASH

I decided to document my set up as an executable.

I scripted the whole thing in a shell script, and it’s available here: https://github.com/jonfuller/laptop/

Page 3: macos installation automation

thoughtbot

The cool guys over at thoughtbot (https://thoughtbot.com/) have done this before too. I was inspired by their work here: https://github.com/thoughtbot/laptop

Page 4: macos installation automation

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

If you’re a macos user, homebrew is a must.

Coined as “The missing package manager for macOS” (https://brew.sh/, also https://github.com/Homebrew/brew/)

A developer’s best friend. It uses the “system ruby” to install itself.

Page 5: macos installation automation

$ brew tap caskroom/cask

Homebrew Cask (https://caskroom.github.io/) is a plugin on top of Homebrew. It’s for installing things that are DMG’s and pkg’s.

Install things like slack and chrome.

Page 6: macos installation automation

$ brew cask install google-chrome$ brew cask install slack$ brew cask install microsoft-office

Installing chrome, slack and office with homebrew cask.

Page 7: macos installation automation

$ brew cask install p4merge$ brew cask install sourcetree$ brew cask install macvim$ brew cask install virtualbox

Installing developer tools with homebrew cask.

Page 8: macos installation automation

$ brew install git$ brew install openssl$ brew install wget # ← WAT!?$ brew install redis$ brew install node

Installing developer tools with homebrew.

Sidenote: what kind of OS doesn’t ship with wget?

Page 9: macos installation automation

$ brew install mas$ mas install `mas search "Kindle" | head -1 | cut -d ' ' -f 1`

mas (stands for Mac App Store) is a command line interface for interacting with the Mac App Store.

This is a great way to keep system apps and updates as well as other 3rd party apps (e.g. Twitter, Kindle, etc.) installed and up to date.

Page 10: macos installation automation

$ mas install `mas search "XCode" | head -1 | cut -d ' ' -f 1`

On macos, setting up a dev environment, starts with XCode.That gets you GCC tools, clang, everything you’ll need for node, ruby, xamarin, ios, etc.

Page 11: macos installation automation

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys \ 409B6B1796C275462A1703113804BB82D39DC0E3$ \curl -sSL https://get.rvm.io | bash -s stable$ source ~/.rvm/scripts/rvm$ rvm install 2.4$ rvm install 2.3$ rvm all do gem update --system$ rvm all do gem install bundler

ruby is a must for most web developers; and rvm is a must for ruby developers.

Bootstrap your ruby install like this.

Page 12: macos installation automation

$ brew cask install postgres$ mas install `mas search "PG Commander" | head -1 | cut -d ' ' -f 1`$ bundle config build.pg --with-pg-config=/Applications/<...>/bin/pg_config$ echo "export PATH=$PATH:/Applications/<...>/latest/bin" >> ~/.zshrc

If you’re using a database in development, you’ll probably want to try out Postgres.

Install postgres, some nice tooling, and configure bundler to point at your postgres install.

Page 13: macos installation automation

$ brew install heroku-toolbelt

$ heroku update

$ heroku login

I love deploying apps to heroku, this’ll get you ready to go with heroku on your new machine.

Page 14: macos installation automation

$ wget https://dl.xamarin.com/installer/XamarinInstaller.dmg$ hdiutil attach -noautoopen XamarinInstaller.dmg$ open /Volumes/Xamarin\ Installer/Install\ Xamarin.app

I make mobile apps in my day job with Xamarin.

There is a cask for this, but it didn’t work quite correctly. This will download and launch the latest Xamarin installer.

Page 15: macos installation automation

$ softwareupdate -ir --verbvose

Macos is no stranger to OS updates. Thankfully softwareupdate is here to help us invoke these from the command line as well.

Page 16: macos installation automation

$ git config --global user.name “Jon Fuller”

$ git config --global user.email “[email protected]

Don’t forget to configure git.

Page 17: macos installation automation

$ git config --global merge.tool p4mergetool

$ git config --global mergetool.p4mergetool.cmd <...>

Then connect p4merge to git. (BeyondCompare is cool tool, but :heart: p4merge).

Page 18: macos installation automation

no dice

We use AnyConnect for VPN stuffs. The nature of Cisco AnyConnect is that they don’t distribute it freely; so, I didn’t find a great way to automate the installation of it.

Page 19: macos installation automation
Page 20: macos installation automation

github.com/jonfuller/laptop

I’m constantly updating this with new things I install. Follow along here: https://github.com/jonfuller/laptop/


Recommended