Skip to content

Instantly share code, notes, and snippets.

@farkmarnum
Created May 4, 2021 18:35
Show Gist options
  • Save farkmarnum/6e176db1c4441a91af94f5d57f752b0c to your computer and use it in GitHub Desktop.
Save farkmarnum/6e176db1c4441a91af94f5d57f752b0c to your computer and use it in GitHub Desktop.
MacbookPro setup script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
# PREFS
# Show Library Folder in Finder
chflags nohidden ~/Library
# Show Hidden Files in Finder
defaults write com.apple.finder AppleShowAllFiles YES
# Show Path Bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
# Show Status Bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
#"Disable smart quotes and smart dashes as they are annoying when typing code"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
#"Showing all filename extensions in Finder by default"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
#"Disabling the warning when changing a file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
#"Use column view in all Finder windows by default"
defaults write com.apple.finder FXPreferredViewStyle Clmv
#"Avoiding the creation of .DS_Store files on network volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
#"Enabling snap-to-grid for icons on the desktop and in other icon views"
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
#"Enabling UTF-8 ONLY in Terminal.app and setting the Pro theme by default"
defaults write com.apple.terminal StringEncodings -array 4
defaults write com.apple.Terminal "Default Window Settings" -string "Pro"
defaults write com.apple.Terminal "Startup Window Settings" -string "Pro"
#"Preventing Time Machine from prompting to use new hard drives as backup volume"
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
#"Disable annoying backswipe in Chrome"
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
#"Setting screenshots location to ~/Desktop"
mkdir -p "$HOME/Screenshots"
defaults write com.apple.screencapture location -string "$HOME/Screenshots"
#"Setting screenshot format to PNG"
defaults write com.apple.screencapture type -string "png"
#"Enabling the Develop menu and the Web Inspector in Safari"
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
#"Adding a context menu item for showing the Web Inspector in web views"
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Check for Homebrew, and then install it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Homebrew installed successfully"
else
echo "Homebrew already installed!"
fi
brew install caskroom/cask/brew-cask
# Install XCode Command Line Tools
echo 'Checking to see if XCode Command Line Tools are installed...'
brew config
# Updating Homebrew.
echo "Updating Homebrew..."
brew update
# Upgrade any already-installed formulae.
echo "Upgrading Homebrew..."
brew upgrade
# Install Git
echo "Installing Git..."
brew install git
# Install ruby
if test ! $(which ruby); then
echo "Installing Ruby..."
brew install ruby
echo "Adding the brew ruby path to shell config..."
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >>~/.bash_profile
else
echo "Ruby already installed!"
fi
# TOOLS
brew install openssl
brew install wget
brew install node
brew install ffmpeg
brew install imagemagick
brew install awscli
brew install elixir
brew install gh
brew install go
brew install jq
brew install bash-completion
brew install dive
brew install nvm
brew install parallel
brew install sl
brew install rename
brew install telnet
brew install yarn
brew install zlib
brew install redis
# DEV CASKS
brew install --cask hyper
brew install --cask visual-studio-code
brew install --cask docker
# OTHER CASKS
brew install --cask firefox
brew install --cask google-chrome
brew install --cask spotify
brew install --cask slack
brew install --cask caffeine
echo "Running brew cleanup..."
brew cleanup
echo "restarting finder"
killall Finder
echo "All done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment