- Return on Security
- Posts
- Setup Your New Mac Easily with This Setup Script
Setup Your New Mac Easily with This Setup Script
Set up your new Mac quickly with Yet Another New Mac Setup Script (YANMSS), adjusting default settings and installing essential tools in no time.

Or what I like to call:
Yet Another New Mac Setup Script (YANMSS)
About
This setup script is for modifying some default settings on Mac OS X, installing some of my preferred Terminal tools, and a few applications.
Installation with Curl
To install this script from a brand new Mac (fresh out of the box!), run the following command in the terminal with no additional tools or permissions needed:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/mikeprivette/yanmss/master/setup.sh)Want to know what "curl -fsSL" stands for? Check out this link.
If you do not already have Xcode Command Line Tools installed, you will be prompted to install them after being prompted for sudo access.
Why ask for sudo access?
You'll need sudo access to do the initial Finder modifications, but it is not required to install Homebrew or associated packages.
If you're not comfortable allowing this script to prompt you for sudo access, feel free to copy/paste the commands you want out of this script into the Terminal as you see fit.
Mac OS X Modifications
The following commands can be entered directly into the Terminal or let the script run for you.
Modify Finder Preferences
Show Library Folder in Finder
chflags nohidden ~/Librarydefaults write com.apple.finder AppleShowAllFiles YESShow Path Bar in Finder
defaults write com.apple.finder ShowPathbar -bool trueShow Status Bar in Finder
defaults write com.apple.finder ShowStatusBar -bool trueTerminal Tools
The following commands can be entered directly into the Terminal or let the script run for you.
Install the following terminal tools:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)Update Brew
brew config
brew update
brew upgradebrew cask install iterm2sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)Git
brew install gitgit clone https://github.com/powerline/fonts.git
cd fonts
sh -c ./install.shRuby
brew install ruby
echo "Adding the brew ruby path to shell config..."
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >>~/.bash_profilebrew install nmapbrew install speedtest_cliAdditional Applications
The following commands can be entered directly into the Terminal or let the script run for you.
Install the following applications:
brew cask install --appdir="/Applications" alfredbrew cask install --appdir="/Applications" visual-studio-codebrew cask install --appdir="/Applications" firefoxbrew cask install --appdir="/Applications" slackbrew cask install --appdir="/Applications" 1passwordCaffeine (Keeps your screen on)
brew cask install --appdir="/Applications" caffeineClean Up
Run the brew cleanup script and remove old or unneeded casks
brew cleanupPost-Script Actions
I have yet to figure out how to automate the post-script actions for some of these installations, so there are a few more steps to complete manually.
Enable Any Oh My Zsh Plugins
“Oh My Zsh” comes with many plugins. Here is the wiki page.
Open your ~/.zshrc file via Terminal
open ~/.zshrcFind and edit the plugins section to add the ones you want
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git brew ruby osx)Set the Oh My Zsh Theme
Open your ~/.zshrc file via Terminal
open ~/.zshrcZSH_THEME="agnoster"After editing, make sure to save and close the file. You may need to quit and reopen iTerm2 for the theme to take effect.
To make the Agnoster theme look the way it does on the wiki page you have to go to:
Open iTerm2
Select Preferences
Click Profile
Click Colors
Change "Color Presets" to "Solarized Dark"
While still in the same window as above, click "Text"
Click on the dropdown under Font and select any font with "Powerline" in it. I chose "Meslo LG DZ for Powerline"
Github
Here's the link to the Github repo if you want to fork it or make PRs:
The End
That's all I have, folks. I appreciate any feedback and suggestions on how to improve this!
Reply