Laptop is a script to set up an OS X laptop for web development.
It can be run multiple times on the same machine safely. It installs, upgrades, or skips packages based on what is already installed on the machine.
It is based on thoughtbot/laptop.
We support:
Older versions may work but aren't regularly tested. Bug reports for older versions are welcome.
- [Xcode]:(https://itunes.apple.com/us/app/xcode/id497799835) must be installed.
Download, review, then execute the script:
curl --remote-name https://raw.githubusercontent.com/PepperTeasdale/laptop/master/mac.sh
less mac.sh
sh mac.sh 2>&1 | tee ~/laptop.log
In order to ensure consistent Docker environment, it should be downloaded manually from the Docker website.
For OS X Sierra + (10.12+) and XCode 8:
With Xcode 8.0, when trying to compile the gem you may get the error Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild. — even after confirming the license agreement. This is an upstream Qt bug that can be worked around by following these instructions:
-
Find the Qt install folder
-
Open [Qt_install_folder]/[Qt_version](/clang_64 || )/mkspecs/features/mac/default_pre.prf in a text editor
If you can't find the file, look for it by searching all files for the following line by running grep -rn /usr/bin/xcrun . in the [Qt_install_folder] or [Qt_version] director
For this laptop script and Qt 5.5.1, you edit the file directly in VIM via the command line:
vim /usr/local/Cellar/[email protected]/5.5.1/mkspecs/features/mac/default_pre.prf
-
Find the line with this text (for me it was line 15):
isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
-
Replace line with:
isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
-
Save & re-install the gem
For further reading: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#macos-sierra-1012
pushd /usr/local/bin
curl --remote-name https://raw.githubusercontent.com/policygenius/laptop/master/kutil.rb
mv kutil{.rb,}
chmod +x kutil
popd
Your last Laptop run will be saved to ~/laptop.log
. Read through it to see if
you can debug the issue yourself. If not, copy the lines where the script
failed into a new GitHub
Issue for us. Or, attach the
whole log file as an attachment.
- Log into GCP with the
gcloud
commandgcloud auth login
- Configure
gcloud
to use the sandbox projectgcloud config set project pg-sandbox-165613
- Configure
kubectl
to use the sandbox Kubernetes clustergcloud container clusters get-credentials sandbox-v3 --zone us-central1-f --project pg-sandbox-165613
- Bundler for managing Ruby libraries
- Exuberant Ctags for indexing files for vim tab completion
- Foreman for managing web processes
- gh for interacting with the GitHub API
- aptible for HIPAA-compliant deploys
- Homebrew and Homebrew Cask for managing operating system libraries
- ImageMagick for cropping and resizing images
- Node.js and NPM, for running apps and installing JavaScript packages
- Postgres for storing relational data
- Qt for headless JavaScript testing via Capybara Webkit
- Rbenv for managing versions of Ruby
- Redis for storing key-value data
- Ruby Build for installing Rubies
- Ruby stable for writing general-purpose code
- The Silver Searcher for finding things in files
- Tmux for saving project state and switching between projects
- Zsh as your shell and Oh My ZSH! as a base config
- Includes a ZSH Syntax Highlighting
- Includes Z, a script that makes navigating in the terminal much faster.
- Docker for prod-like development environments
- MacVim for writing code and pivotalcommon/vim-config as a base config
- iTerm2 for your terminal
- Slack for team communication
- Screenhero for remote pairing
- Sourcetree because sometime you just want a GUI
- ShiftIt for window management
- Google Chrome and Firefox browsers
Your ~/.laptop.local
is run at the end of the Laptop script.
Put your customizations there.
For example:
#!/bin/sh
brew_tap 'caskroom/cask'
brew_install_or_upgrade 'brew-cask'
brew cask install dropbox
brew cask install google-chrome
brew cask install rdio
gem_install_or_update 'parity'
brew_install_or_upgrade 'tree'
brew_install_or_upgrade 'watch'
Write your customizations such that they can be run safely more than once.
See the mac.sh
script for examples.
Laptop functions such as fancy_echo
,
brew_install_or_upgrade
,
cask_install_or_upgrade
,
gem_install_or_update
, and
append_to_zshrc
can be used in your ~/.laptop.local
.