Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
will-gant authored Aug 8, 2022
1 parent 00cef49 commit fd04fa9
Showing 1 changed file with 36 additions and 51 deletions.
87 changes: 36 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,40 @@
# Mac setup

Run the following to download the latest release of this repo and then run the setup script:

```bash
setup_repo="$(mktemp -d)"
zipball_url="$(curl -s https://api.github.com/repos/will-gant/mac-setup/releases/latest | grep zipball_url | cut -d '"' -f 4)"
zip_file="${setup_repo}/repo.zip"
curl --location "$zipball_url" --output "${setup_repo}/repo.zip"
unzip "$zip_file" -d "$setup_repo"
bash "$setup_repo/*mac-setup*/setup.sh"
```

## Manual steps:

These should be run _after_ the setup script completes.

### SSH key

1. Retrieve SSH private key from password manager
1. Copy it into ~/.ssh/id_rsa
1. Install commandline developer tools:
```
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
xcode_version="$(softwareupdate --list | grep -E --only-matching "Command Line Tools for Xcode-[0-9]+\.[0-9]+" | tail -n 1)"
softwareupdate --install "$xcode_version" --verbose
rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
```
1. [Install brew](https://brew.sh/) (requires sudo)
1. Run the following to download the latest release of this repo and then run the setup script:
```bash
setup_repo="$(mktemp -d)"
zipball_url="$(curl -s https://api.github.com/repos/will-gant/mac-setup/releases/latest | grep zipball_url | cut -d '"' -f 4)"
zip_file="${setup_repo}/repo.zip"
curl --location "$zipball_url" --output "${setup_repo}/repo.zip"
unzip "$zip_file" -d "$setup_repo"
bash "$setup_repo/*mac-setup*/setup.sh"
```
1. Retrieve SSH private key from password manager and copy it into ~/.ssh/id_rsa
1. Run `eval "$(ssh-agent -s)"`
1. Run `ssh-add --apple-use-keychain ~/.ssh/id_rsa`

### iterm

Import `iterm2.json` as a profile via the iterm GUI

### VScode

Switch on 'sync' and login with GitHub

### System settings

NB. These take effect after a restart

```bash

# updates
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true

# enable firewall
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 2

# enable FileVault encryption (interactive)
sudo fdesetup enable

# show bluetooth in menu bar
sudo defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18
```
1. Start iterm2 and import `iterm2.json` as a profile via the iterm GUI
1. Start Visual Studio Code and sync settings by logging in with GitHub Auth
1. Run the following to update system settings:
```bash
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true
# enable firewall
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 2
# enable FileVault encryption (interactive)
sudo fdesetup enable
# show bluetooth in menu bar
sudo defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18
```

0 comments on commit fd04fa9

Please sign in to comment.