Skip to content

Instantly share code, notes, and snippets.

@molawson
Last active September 26, 2017 20:15
Show Gist options
  • Save molawson/8f6b40f5e96218c0a0880616c81bf41d to your computer and use it in GitHub Desktop.
Save molawson/8f6b40f5e96218c0a0880616c81bf41d to your computer and use it in GitHub Desktop.
New computer setup

Download and run on a fresh install of macOS

curl -fsS https://gist.githubusercontent.com/molawson/8f6b40f5e96218c0a0880616c81bf41d/raw/setup.sh
sh setup.sh
echo "🚦 Start installing XCode
echo " press any key to continue"
read installing_xcode
echo "πŸ› οΈ Installing homebrew..."
curl -fsS 'https://raw.githubusercontent.com/Homebrew/install/master/install' | ruby
echo "πŸ› οΈ Installing initial apps for setup..."
brew tap "homebrew/bundle"
brew bundle --file=- <<EOF
tap "caskroom/cask"
cask "1password"
cask "alfred"
cask "dropbox"
cask "google-chrome"
EOF
echo "🚦 Start Dropbox selective sync (Apps, Documents/Fonts, Photos/Screenshots)"
echo " press any key to continue"
read syncing_dropbox
echo "πŸ“₯ Cloning and installing dotfiles..."
git clone https://github.com/molawson/dotfiles.git "$HOME/.dotfiles"
(cd "$HOME/.dotfiles"; rake install)
echo "πŸ€– Running thoughtbot laptop script..."
curl -fsS 'https://raw.githubusercontent.com/thoughtbot/laptop/master/mac' | sh
echo "πŸ› οΈ Installing vim plugins..."
vim +PlugInstall +qall
echo "πŸ› οΈ Compiling ctrlp-cmatcher..."
(cd "$HOME/.vim/plugged/ctrlp-cmatcher"; CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments ./install.sh)
echo "πŸ› οΈ Installing the rest of the apps..."
brew bundle --file=- <<EOF
cask "backblaze"
cask "bartender"
cask "basecamp"
cask "carbon-copy-cloner"
cask "cloudapp"
cask "evernote"
cask "rowanj-gitx"
cask "iterm2"
cask "keybase"
cask "kindle"
cask "licecap"
cask "paw"
cask "propresenter"
cask "psequel"
cask "rocket"
cask "screenflow"
cask "screenhero"
cask "sequel-pro"
cask "slack"
cask "spotify"
cask "trailer"
cask "viscosity"
cask "zoomus"
EOF
echo "βš™οΈ Setting up user defaults..."
defaults write com.apple.screencapture location "$HOME/Dropbox/Photos/Screenshots"
killall SystemUIServer
echo "πŸ”‘ Generating new SSH key..."
printf "What email do you want to use for your ssh key? "
read ssh_email
ssh-keygen -t rsa -b 4096 -C "$ssh_email"
echo "🚦 Make sure that the following is in your ~/.ssh/config file"
cat <<EOF
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
EOF
echo " press any key to continue"
read editing_ssh_config
eval "$(ssh-agent -s)"
ssh-add -K "$HOME/.ssh/id_rsa"
echo "πŸ“‹ Copying new key to clipboard..."
pbcopy < "$HOME/.ssh/id_rsa.pub"
echo "🚦 Add new key to GitHub"
open https://github.com/settings/keys
echo " press any key to continue"
read added_key_to_github
echo "🚦 Add new key to Keybase"
echo " press any key to continue"
read added_key_to_keybase
echo "πŸ”‘ Generating new GPG key..."
gpg --gen-key
echo "GPG keys:"
gpg --list-secret-keys --keyid-format LONG
printf "🚦 What is the ID of the key you'd like to add to GitHub? "
read gpg_key_id
gpg --armor --export $gpg_key_id
echo "🚦 Add new GPG key to GitHub"
open https://github.com/settings/keys
echo " press any key to continue"
read added_gpg_to_github
echo "βš™οΈ Telling git about the new GPG key..."
git config --global user.signingkey $gpg_key_id
echo "βš™οΈ Updating dotfiles with ssh remote..."
(cd "$HOME/.dotfiles"; git remote set-url origin git@github.com:molawson/dotfiles.git)
echo "πŸŽ‰ Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment