Skip to content

Instantly share code, notes, and snippets.

@fribibb
Last active August 23, 2018 11:50
Show Gist options
  • Save fribibb/74f8b9fa5835738fb1eb123c0d6ed93d to your computer and use it in GitHub Desktop.
Save fribibb/74f8b9fa5835738fb1eb123c0d6ed93d to your computer and use it in GitHub Desktop.
# simply run:
# curl https://gist.githubusercontent.com/fribibb/74f8b9fa5835738fb1eb123c0d6ed93d/raw/Basic-Mac-Setup--Work.sh > ~/Desktop/Basic-Mac-Setup--Work.sh && bash ~/Desktop/Basic-Mac-Setup--Work.sh
# Starting
clear
echo "This will kick off a LOT of downloads."
echo "...distract everyone with [tea/coffee/cake/lunch/fire alarms], so you can use all the bandwidths!"
echo ""
read -p "Press enter to start."
echo "✳️ Starting..."
echo ""
# All the GUI apps
# TODO: curl/wget the direct downloads and open automattically
# and only 'open' the ones that need to be.
echo "Opening apps to download..."
echo ""
echo "⬇️ iTerm 2"
open https://iterm2.com/downloads/stable/latest
sleep 8
echo "⬇️ Chrome"
open https://www.google.com.au/chrome/browser/desktop/
sleep 8
echo "⬇️ Firefox"
open "https://www.mozilla.org/firefox/new/?scene=2"
sleep 5
echo "⬇️ Dropbox"
open "https://www.dropbox.com/download?os=mac"
open ~/Downloads
sleep 20
echo "⬇️ Opera"
open "https://www.opera.com/computer/thanks?os=mac&ni=stable"
sleep 8
echo "⬇️ MAMP"
open https://www.mamp.info/en/downloads/
sleep 8
echo "⬇️ Atom"
open https://atom.io/download/mac
sleep 20
open ~/Downloads
echo "⬇️ GitHub Desktop"
open https://central.github.com/mac/latest
sleep 8
echo "⬇️ Transmit"
open https://www.panic.com/transmit/
sleep 20
echo "⬇️ VMware Fusion"
open https://www.vmware.com/go/downloadfusion
sleep 8
echo "⬇️ VLC"
open https://www.videolan.org/vlc/download-macosx.html
sleep 8
echo "⬇️ ImageOptim"
open https://imageoptim.com/ImageOptim.tbz2
sleep 20
echo "⬇️ Sequel Pro"
open https://sequelpro.com/download
sleep 8
echo "⬇️ Citrix Receiver"
open "https://www.citrix.com/downloads/citrix-receiver/mac/receiver-for-mac-latest.html#ctx-dl-eula"
sleep 8
echo "⬇️ FortiClient"
open https://fortinetweb.s3.amazonaws.com/forticlient/downloads/FortiClientOnlineInstaller.dmg
sleep 20
echo "⬇️ 1Password"
open https://app-updates.agilebits.com/download/OPM4
sleep 8
echo "⬇️ Adobe CC"
open https://creative.adobe.com/products/download/creative-cloud
sleep 8
echo "⬇️ Codekit"
open https://codekitapp.com/binaries/codekit.zip
sleep 8
echo "⬇️ Duet"
open "https://www.duetdisplay.com/#download"
sleep 8
echo "⬇️ CCleaner"
open "http://www.piriform.com/ccleaner/download?mac"
sleep 8
echo "⬇️ Sketch"
open https://www.sketchapp.com/download/sketch.zip
sleep 8
echo "⬇️ Dash"
open https://sydney.kapeli.com/downloads/v4/Dash.zip
sleep 35 # Waits 35 seconds
echo ""
# macOS tweaks
echo "🔧 Tweaking macOS settings"
defaults write com.apple.Safari WebKitDeveloperExtras -bool true
defaults write com.apple.finder ShowPathbar -bool false
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
sudo pmset displaysleep 15
defaults write com.apple.PowerChime ChimeOnAllHardware -bool true && open /System/Library/CoreServices/PowerChime.app
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
sudo write /Library/Preferences/com.apple.loginwindow LoginwindowText "Department of Finance"
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1
# defaults write com.apple.finder AppleShowAllFiles TRUE
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
killall Finder
echo ""
clear
echo "⚠️ Make sure you've installed all that just opened before continuing!"
echo "- particularly iTerm and have MAMP."
read -p "Press enter to continue, once these are installed."
echo ""
cd ~
# Install Brew
echo "⏳ Installing Homebrew, NPM and Gulp"
brew update && brew upgrade -y
brew install wget zsh zsh-completions htop-osx git node jq nmap mas casperjs mosh
npm install -g npm-check gulp
echo "✅ Homebrew and packages installed"
echo ""
# Login to the App Store
open /Applications/App\ Store.app
echo "⚠️ Please log in to the App Store."
read -p "Press enter to continue, once logged in to the app store."
# Install App Store apps
mas install 497799835 # Xcode
mas install 425424353 # The Unarchiver
mas install 803453959 # Slack
mas install 409201541 # Pages
mas install 409183694 # Keynote
mas install 715768417 # Microsoft Remote Desktop
mas install 409203825 # Numbers
mas install 507257563 # Sip
echo "✅ App Store apps installed."
echo ""
# Oh My ZSH
echo "⏳ Installing oh-my-zsh..."
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
cd ~/.oh-my-zsh/custom/plugins
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git
echo "✅ oh-my-zsh installed."
echo ""
# Install Composer globally
echo "⏳ Installing Composer"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
#php -r "if (hash_file('SHA384', 'composer-setup.php') === '070854512ef404f16bac87071a6db9fd9721da1684cd4589b1196c3faf71b9a2682e2311b36a5079825e155ac7ce150d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
echo "✅ Composer apps installed."
composer --version
echo ""
# Install Drush
echo "⏳ Installing Drush"
composer global require drush/drush
echo "✅ Drush installed."
echo ""
echo "🔧 Other tweaks..."
# Pipe out to end of .zshrc
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.zshrc
echo 'alias update-mac="apm upgrade -c false && brew update && brew upgrade -y && upgrade_oh_my_zsh && softwareupdate -i -a && npm-check
&& date"' >> ~/.zshrc
# Replace the theme with the one we want...
sed -i.bak 's/ZSH_THEME="robbyrussell"/ZSH_THEME="ys" # was "robbyrussell"/g' ~/.zshrc
# Enable all the good things..
sed -i.bak 's/plugins=(git)/plugins=(zsh-syntax-highlighting brew osx history-substring-search/g' ~/.zshrc
echo ""
# Stop using macOS's PHP version
#echo '# Stop using the macOS PHP version' >> ~/.zshrc
#echo 'PHP_VERSION="5.6.10"' >> ~/.zshrc
#echo 'PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
#echo 'MAMP_PHP=/Applications/MAMP/bin/php/php$PHP_VERSION/bin' >> ~/.zshrc
#echo 'MAMP_BINS=/Applications/MAMP/Library/bin' >> ~/.zshrc
#echo 'PATH="$MAMP_PHP:$MAMP_BINS:~/.composer/vendor/bin:$PATH"' >> ~/.zshrc
#echo 'export PATH=$PATH' >> ~/.zshrc
#echo ""
# Configure PHP and MySQL settings to be a bit more generous
sudo sed -i.bak 's/128M/1024M/g' /Library/Application Support/appsolute/MAMP PRO/conf/php.ini
sudo sed -i.bak 's/128M/1024M/g' /Applications/MAMP/bin/php/php5.6.31/conf/php.ini # TODO: this needs to be done better so no hard coded version
#sudo sed -i.bak 's/16\M/100\M/g' /Applications/MAMP/tmp/mysql/my.cnf
#echo '[mysqld]' >> /Applications/MAMP/conf/my.cnf
#echo 'max_allowed_packet = 100M' >> /Applications/MAMP/conf/my.cnf
echo ""
# Create SSH key for GitHub, etc.
clear
cd ~/.ssh
mkdir key_backup
mv id_rsa* key_backup 2>/dev/null
ssh-keygen -b 4096 -f ~/.ssh/id_rsa -N '' # Acquia Cloud requires that your SSH public key must be at least 4096 bits.
echo "Your SSH Public Key is:"
echo "---------------------"
cat ~/.ssh/id_rsa.pub
echo "---------------------"
pbcopy < ~/.ssh/id_rsa.pub && echo "(this has been copied to the clipboard)"
echo "- go add it to Acquia, GitHub, etc... I'll wait."
read -p "Press enter to continue, once these have been added."
echo ""
# Pull down govCMS alias and site sync scripts to home dir
cd ~
curl https://gist.githubusercontent.com/fribibb/0662096e88800d01014bfc01c820f75a/raw/e44788d93ff8b3b2e16c1acd151378d541499ab2/ > govcms-alias-creator-4000.sh
curl https://gist.githubusercontent.com/fribibb/f9deb6ff53178ea36ccd/raw/7067c444e0af4590482a84a0f3922ed249393e23/ > govcms-site-sync.sh
echo ""
echo "govcms-alias-creator-4000.sh"
echo " and "
echo "govcms-site-sync.sh "
echo "are now in your home directory."
echo ""
# Check Drush works
echo ""
drush status
# MAMP might need this:
# ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
echo ""
echo "✅ Done."
echo ""
echo ""
echo "Reminders - you now need to:"
echo "* Activate licences for:"
echo " - MAMP Pro"
echo " - Transmit"
echo " - VMware"
echo "* Login to: "
echo " - Slack (both teams)"
echo " - Chrome"
echo " - Adobe CC"
echo " - Dropbox"
echo " - Boxy"
echo " - Linda.com app"
echo "* Grab required Dash documentation downloads via Preferences"
echo "* Run:"
echo " bash ~/govcms-alias-creator-4000.sh 'USERNAME' KEY"
echo "* Setup MAMP with whichever sites you need to"
echo "* Sync said sites with:"
echo " bash ~/govcms-site-sync.sh govcms.sprintgovcms.govcms.acsitefactory.com 2111 /YOUR/www/govcms-theme/docroot govcms-new"
echo "* Close this and go use iTerm!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment