Skip to content

Instantly share code, notes, and snippets.

@maxackerman
Last active July 23, 2023 15:21
Show Gist options
  • Save maxackerman/930146246c6a023f4ac0e7c09cf05a68 to your computer and use it in GitHub Desktop.
Save maxackerman/930146246c6a023f4ac0e7c09cf05a68 to your computer and use it in GitHub Desktop.
bash srcipt to setup a new mac with homebrew and dev environment
export PATH=/usr/local/bin:$PATH
export PATH="$PATH:$HOME/.composer/vendor/bin"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
webmp4() {
local maxwidth=1000
local maxheight=1000
for f; do
ffmpeg -i "$f" -an -vcodec libx264 -vb 8000k -vf "scale=iw*min($maxwidth/iw\,$maxheight/ih):ih*min($maxwidth/iw\,$maxheight/ih)" -f mp4 "${f%.*}.mp4"
done
}
#!/bin/sh
# BACKUP BEFORE WIPE:
# SSH keys
# Fonts
# Keychain passwords
# files outside dropbox: downloads, documents, photos
# bash/zsh profile
# transmit favs
# reference:
# https://github.com/thoughtbot/laptop
# https://github.com/tylucaskelley/setup
# http://sourabhbajaj.com/mac-setup/
echo "Starting configuration..."
if ! brew help &> /dev/null; then
echo "installing homebrew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "homebrew already installed"
fi
echo "Updating Homebrew formulae ..."
brew update
echo "Begin Homebrew bundle install..."
brew bundle --file=- <<EOF
tap "homebrew/cask"
tap "homebrew/cask-drivers"
# brew
brew "dockutil"
brew "git"
brew "ffmpeg"
brew "youtube-dl"
brew "node"
brew "imagemagick"
brew "php"
brew "composer"
brew "rbenv"
brew "ruby-build"
brew "rsync"
# osx apps
cask "adobe-creative-cloud"
cask "alfred"
cask "arq"
cask "authy"
cask "dropbox"
cask "firefox"
cask "figma"
cask "google-chrome"
cask "hazel"
cask "microsoft-office"
cask "rectangle"
cask "rightfont"
cask "sketch"
cask "slack"
cask "sublime-text"
cask "sublime-merge"
cask "transmit"
cask "vlc"
cask "zoom"
# drivers
cask "wacom-tablet"
EOF
echo "brew cleanup..."
brew cleanup
# youtube-dl config
mkdir ~/.config/youtube-dl && touch ~/.config/youtube-dl/config
echo '-f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' >> ~/.config/youtube-dl/config
# RUBY
# https://gorails.com/setup/osx/10.15-catalina
# https://sourabhbajaj.com/mac-setup/Ruby/
echo "Begin Ruby config..."
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
source ~/.zshrc
rbenv install 2.7.1
rbenv global 2.7.1
ruby -v
echo "Begin OSX Settings..."
# OSX Settings
# reference: https://github.com/keith/dotfiles/blob/master/osx/defaults.sh
# Disable "shake to find mouse"
defaults write NSGlobalDomain CGDisableCursorLocationMagnification -bool true
# Enable two button mouse
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse.plist MouseButtonMode -string "TwoButton"
# set key repeat speed
defaults write -g InitialKeyRepeat -int 15
defaults write -g KeyRepeat -int 2
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string SCcf
# Dont reopen apps after shutdown
defaults write -g ApplePersistence -bool no
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Change the auto-hiding Dock delay adn speed
defaults write com.apple.dock autohide-delay -float 0.0
defaults write com.apple.dock autohide-time-modifier -float 0.5
# set DNS servers
networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001
# Dock setup
if command -v dockutil; then
dockutil --remove all
else
echo "dockutil not installed, re-run after installing"
fi
echo "Setup process complete!"
# MANUAL SETUP
# install valet: https://laravel.com/docs/7.x/valet (this could be automated)
# adobe-creative-cloud run the installer '/usr/local/Caskroom/adobe-creative-cloud/latest/Creative Cloud Installer.app'
# xcode clit tools run: "xcode-select --install"
# git config
# setup Dropbox
# Alfred: link settings in dropbox
# Sublime: link settings in dropbox with symlink
# RightFont: link dropbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment