Skip to content

Instantly share code, notes, and snippets.

@peasead
Forked from seven62/macos-setup.sh
Last active October 26, 2021 18:01
Show Gist options
  • Save peasead/fe6d6d9a7dd7d0e6fdbc8e53e3b1c66a to your computer and use it in GitHub Desktop.
Save peasead/fe6d6d9a7dd7d0e6fdbc8e53e3b1c66a to your computer and use it in GitHub Desktop.
Script and readme to configure a new mac
#!/bin/bash
#set -eux
# Create Profile Directories
mkdir ~/{bin,code,dev}
# Installing Homebrew if necessary
if system_profiler SPApplicationsDataType | grep brew >/dev/null 2>&1; then echo "Homebrew already installed. Moving on."; else /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; fi
# Install CLI Tools
clear
echo "############################"
echo "### Installing CLI Tools ###"
echo "############################"
sleep 2
brew install \
ansible \
ansible-lint \
bash \
bash-completion \
bat \
broot \
git \
hashdeep \
haste-client \
htop \
jq \
jsonlint \
make \
nmap \
pyenv \
powershell \
ruby \
shellcheck \
tldr \
vagrant-completion \
whois \
wireguard-tools \
yamllint \
yara \
zerotier-one
# Clean up files/dependencies
sudo gem pristine json --version 2.3.0
echo 'export PATH="/usr/local/opt/whois/bin:$PATH"' >> /Users/$USER/.bash_profile
## Bash Completion (completion)
# Finishing this up by appending to bash profile
cat << EOF >> ~/.bash_profile
# bash completion
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
EOF
clear
echo "############################"
echo "### Installing GUI Tools ###"
echo "### password is required ###"
echo "############################"
sleep 2
# Install GUI Tools
brew install \
appcleaner \
authy \
balenaetcher \
github \
iterm2 \
itsycal \
lulu \
mark-text \
rectangle \
skitch \
slack \
vagrant \
vagrant-manager \
vlc \
zoom
# Elastic Stack
echo "### Installing the Elastic Stack ###"
brew tap elastic/tap
brew install \
elasticsearch-full \
kibana-full \
logstash-full \
filebeat-full \
auditbeat-full
# Browser
echo "### Installing Browser(s) ###"
brew install \
google-chrome \
firefox
# Docker - Container Development
# Untested with Bir Sur NOV2020
brew install \
docker \
docker-compose
# Password Manager
echo "### Installing Password Manager ###"
brew install \
bitwarden \
bitwarden-cli
# Text Editor
echo "### Installing Text Editor ###"
brew install \
atom \
visual-code-studio
# # Hypervisor (free) -
echo "### Installing Virtualbox ###"
# # Untested with Big Sur NOV2020
brew install virtualbox
# Fonts
echo "### Installing Font(s) ###"
brew tap homebrew/cask-fonts
brew install font-fira-code
# SSH Setup
# echo "Setting up SSH ###"
# mkdir ~/.ssh && touch ~/.ssh/config
# cat << EOF >> ~/.ssh/config
# Host <SHORTNAME>
# HostName x.x.x.x
# User <USER>
# #Port XXXX
# AddKeysToAgent yes
# UseKeychain yes
# IdentityFile ~/.ssh/<YOUR_KEY>
# EOF
# macOS Interface Tweaks
echo "Performing macOS Interface Tweaks ###"
# Show Library folder
chflags nohidden ~/Library
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles YES
# Show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Save screenshots to a folder on the desktop
mkdir ~/Desktop/screenshots
defaults write com.apple.screencapture location ~/Desktop/screenshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment