The document outlines the steps taken to set up a new laptop for development purposes. It details installing various tools like Homebrew, Ruby, Git, Heroku CLI and others. It also covers configuring programs and services like Postgres, Xcode, VPN and version control with Git. All commands are provided to fully automate replicating the documented development environment setup.
1. 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.
2. 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/
3. 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
4. $ /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.
5. $ 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.
8. $ 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?
9. $ 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.
10. $ 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.
11. $ 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.
12. $ 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.
13. $ 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.
14. $ 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.
15. $ 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.
17. $ git config --global merge.tool p4mergetool
$ git config --global mergetool.p4mergetool.cmd <...>
Then connect p4merge to git. (BeyondCompare is cool tool, but :heart: p4merge).
18. 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.