Skip to content

Instantly share code, notes, and snippets.

@bloodf
Last active December 18, 2019 21:35
Show Gist options
  • Save bloodf/780986f84eb57727ef203711d6161de1 to your computer and use it in GitHub Desktop.
Save bloodf/780986f84eb57727ef203711d6161de1 to your computer and use it in GitHub Desktop.
MacOs Bootstrap Installation Script
#!/usr/bin/env bash
NINITE_SCRIPT=curl -s 'https://api.macapps.link/pt/firefox-firefoxdev-chrome-dropbox-drive-github-sequelpro-vscode-docker-postman-insomnia-keka-1password-filezilla-appcleaner-ccleaner-caffeine-istatmenus-duet-spotify-calibre-handbrake-mpegstreamclip-skype-telegram-slack-whatsapp-discord' | sh
NPM_PACKS="@quasar/cli @vue/cli @vue/cli-service-global @vue/devtools capacitor cordova electron eslint global ios-deploy ios-sim jscs jshint jslint ncu ndb netlify-cli nodemon now npm npm-check-updates prettier start-android-emulator ts-node tslint typescript vue-language-server"
#Help
COMMANDS="Node -> nodeglobalinstall\nPackage Managers Update -> updaterepo\nApp Install -> ninite\niOS Sim Rec Video -> recsim nomeVideo.mp4\nFlush DNS -> flushdns\nClearbluetooth -> bluetoothRestart"
HELP_ALIAS="alias helpAlias=\"printf \"$COMMANDS\""
#NODE
UPDATE_REPO="alias updaterepo=\"npm update -g && brew update && brew upgrade\""
NODE_GLOBAL="alias nodeglobalinstall=\"npm install -g $NPM_PACKS\""
NINITE="alias ninite=\"$NINTE_SCRIPT\""
#Mac
RECSIM="alias recsim=\"xcrun simctl io booted recordVideo — type=mp4\""
FLUSH_DNS="alias flushdns=\"sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset\""
BLUETOOTH="alias bluetoothRestart=\"sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport && sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport\""
#Docker
# alias dockerprune="docker rm -f $(docker ps -a -q) && docker rmi -f $(docker images -q) && docker system prune -a"
FINAL_FILE="$NINITE_SCRIPT\n$NPM_PACKS\n#Help\n$COMMANDS\n$HELP_ALIAS\n#NODE\n$UPDATE_REPO\n$NODE_GLOBAL\n$NINITE\n#Mac\n$RECSIM\n$FLUSH_DNS\n$BLUETOOTH"
echo "Saving Initial User Variables..."
echo $FINAL_FILE >> ~/.bash_profile
echo "Starting bootstrapping"
# Check for Homebrew, install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
brew update
# Install GNU core utilities (those that come with OS X are outdated)
brew tap homebrew/dupes
brew tap flschweiger/flutter
brew install coreutils
brew install gnu-sed --with-default-names
brew install gnu-tar --with-default-names
brew install gnu-indent --with-default-names
brew install gnu-which --with-default-names
brew install gnu-grep --with-default-names
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
brew install findutils
# Install Bash 4
brew install bash
PACKAGES=(
awscli
aws-keychain
aws-elasticbeanstalk
ack
autoconf
automake
cairo
boot2docker
ffmpeg
gettext
gifsicle
git
git-flow
git-lfs
gradle
gdbm
graphite2
graphviz
hub
imagemagick
ideviceinstaller
jq
libjpeg
libmemcached
markdown
memcached
pkg-config
python
python3
rename
ssh-copy-id
terminal-notifier
the_silver_searcher
tmux
tree
vim
wget
sqlite
usbmuxd
openssl
zsh
)
#https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
echo "Installing packages..."
brew install ${PACKAGES[@]}
echo "Cleaning up..."
brew cleanup
echo "Installing cask..."
brew install caskroom/cask/brew-cask
CASKS=(
flutter
)
echo "Installing cask apps..."
brew cask install ${CASKS[@]}
echo "Installing fonts..."
brew tap caskroom/fonts
FONTS=(
font-inconsolidata
font-roboto
font-clear-sans
)
brew cask install ${FONTS[@]}
echo "Installing Python packages..."
PYTHON_PACKAGES=(
ipython
virtualenv
virtualenvwrapper
)
sudo pip install ${PYTHON_PACKAGES[@]}
echo "Installing Ruby gems"
RUBY_GEMS=(
bundler
filewatcher
cocoapods
)
sudo gem install ${RUBY_GEMS[@]}
#https://github.com/nvm-sh/nvm
echo "Installing NVM..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
nvm install-latest-npm
echo "Installing global npm packages..."
npm install -g $NPM_PACKS
echo "Installing Yarn..."
curl -o- -L https://yarnpkg.com/install.sh | bash
echo "Installing Apps..."
$NINITE_SCRIPT
echo "Configuring OSX..."
# Set fast key repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0
# Show filename extensions by default
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
echo "Downloading ZSH Theme..."
# https://github.com/romkatv/powerlevel10k#oh-my-zsh
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
echo "Creating folder structure..."
[[ ! -d Wiki ]] && mkdir Wiki
[[ ! -d Workspace ]] && mkdir Workspace
echo "Disabling Gatekeeper..."
sudo spctl --master-disable
echo "Bootstrapping complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment