Skip to content

Instantly share code, notes, and snippets.

@nicholas-kebbas
Forked from somebox/osx-setup.sh
Created August 15, 2016 00:20
Show Gist options
  • Select an option

  • Save nicholas-kebbas/4725bfb8932ae171a10f59fcbc9f24f5 to your computer and use it in GitHub Desktop.

Select an option

Save nicholas-kebbas/4725bfb8932ae171a10f59fcbc9f24f5 to your computer and use it in GitHub Desktop.

Revisions

  1. @somebox somebox renamed this gist Jun 14, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @somebox somebox revised this gist Jun 14, 2015. 1 changed file with 153 additions and 2 deletions.
    155 changes: 153 additions & 2 deletions osx-setup.sh.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,154 @@
    ## This gist has moved: please visit [https://gist.github.com/somebox/6b00f47451956c1af6b4](https://gist.github.com/somebox/6b00f47451956c1af6b4)
    #!/bin/bash

    Thanks, [@foz](https://twitter.com/foz)
    # A script to set up a new mac. Uses bash, homebrew, etc.

    # Focused for ruby/rails development. Includes many utilities and apps:
    # - homebrew, rvm, node
    # - quicklook plugins, terminal fonts
    # - browsers: chrome, firefox
    # - dev: iterm2, sublime text, postgres, chrome devtools, etc.
    # - team: slack, dropbox, google drive, skype, etc
    # - utils: unarchiver, o-day, caffine, skitch, etc
    # - productivity: evernote, viscosity, omnigraffle, karabiner, etc.


    # Settings
    node_version="0.12.2"
    ruby_versions="1.9 2.1 2.2"
    ruby_default="2.1"

    # helpers
    function echo_ok { echo -e '\033[1;32m'"$1"'\033[0m'; }
    function echo_warn { echo -e '\033[1;33m'"$1"'\033[0m'; }
    function echo_error { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; }

    echo_ok "Install starting. You may be asked for your password (for sudo)."

    # requires xcode and tools!
    xcode-select -p || exit "XCode must be installed! (use the app store)"

    # requirements
    cd ~
    mkdir -p tmp
    echo_warn "setting permissions..."
    for dir in "/usr/local /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share"; do
    sudo chgrp admin $dir
    sudo chmod g+w $dir
    done

    # homebrew
    export HOMEBREW_CASK_OPTS="--appdir=/Applications"
    if hash brew &> /dev/null; then
    echo_ok "Homebrew already installed"
    else
    echo_warn "Installing homebrew..."
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    fi

    # RVM
    if hash rvm &> /dev/null; then
    echo_ok "RVM already installed"
    else
    echo "Installing RVM..."
    curl -sSL https://get.rvm.io | bash -s stable --ruby
    fi

    # add default gems to rvm
    global_gems_config="$HOME/.rvm/gemsets/global.gems"
    default_gems="bundler awesome-print lunchy rak"
    for gem in $default_gems; do
    echo $gem >> $global_gems_config
    done
    awk '!a[$0]++' $global_gems_config > /tmp/global.tmp
    mv /tmp/global.tmp $global_gems_config

    # RVM ruby versions
    for version in $ruby_versions; do
    rvm install $version
    done

    # moar homebrew...
    brew install caskroom/cask/brew-cask
    brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

    # brew taps
    brew tap caskroom/versions
    brew tap caskroom/fonts
    brew tap homebrew/games

    # Homebrew base
    brew install \
    autoconf automake bash-completion cowsay cmatrix \
    ffmpeg figlet gettext go gpg freetype htop-osx jq libxml2 mongodb node \
    phantomjs postgres qt readline sqlite unrar v8 wget youtube-dl

    # brew cask fonts
    echo_warn "Installing fonts..."
    brew cask install \
    font-anonymous-pro \
    font-dejavu-sans-mono-for-powerline \
    font-droid-sans \
    font-droid-sans-mono font-droid-sans-mono-for-powerline \
    font-meslo-lg font-input \
    font-inconsolata font-inconsolata-for-powerline \
    font-liberation-mono font-liberation-mono-for-powerline \
    font-liberation-sans \
    font-meslo-lg \
    font-nixie-one \
    font-office-code-pro \
    font-pt-mono \
    font-roboto \
    font-source-code-pro font-source-code-pro-for-powerline \
    font-source-sans-pro \
    font-ubuntu font-ubuntu-mono-powerline


    # brew cask quicklook
    echo_warn "Installing QuickLook Plugins..."
    brew cask install \
    qlcolorcode qlmarkdown qlprettypatch qlstephen \
    qlimagesize \
    quicklook-csv quicklook-json epubquicklook \
    animated-gif-quicklook

    # Apps
    echo_warn "Installing applications..."

    # google
    brew cask install google-chrome google-hangouts google-drive
    # other favorites
    brew cask install \
    bettertouchtool caffeine day-o karabiner the-unarchiver flux\
    1password dropbox evernote skitch picturelife \
    minecraft spotify transmission vlc \
    adafruit-arduino iterm2 mongohub chrome-devtools firefox sublime-text3 \
    slack skype telephone \
    citrix-receiver omnigraffle viscosity

    # xquartz
    echo_warn "Installing xquartz (this big download can be slow)"
    n=0
    until [ $n -ge 20 ]; do
    brew cask install xquartz && break
    n=$[$n+1]
    echo_error "... install failed, retry $n"
    done

    # brew imagemagick
    brew cask install inkscape
    brew install librsvg
    brew install imagemagick --with-librsvg

    echo
    echo_ok "Done."
    echo
    echo "After Dropbox has finished installing, link Sublime Text settings:"
    echo_warn " cd ~/Library/Application\ Support/Sublime\ Text\ 3/"
    echo_warn " rm -rf Packages"
    echo_warn " ln -s ~/Dropbox/Sublime/Packages ."
    echo
    echo "Then go to https://packagecontrol.io/installation for Package Control"
    echo
    echo "You may want to add the following settings to your .bashrc:"
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo
  3. @somebox somebox revised this gist Jun 14, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion osx-setup.sh.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    ## This gist has moved: please visit [https://gist.github.com/somebox/6b00f47451956c1af6b4](https://gist.github.com/somebox/6b00f47451956c1af6b4)

    - foz
    Thanks, [@foz](https://twitter.com/foz)
  4. @somebox somebox renamed this gist Jun 14, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @somebox somebox revised this gist Jun 14, 2015. 1 changed file with 2 additions and 153 deletions.
    155 changes: 2 additions & 153 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,154 +1,3 @@
    #!/bin/bash
    ## This gist has moved: please visit [https://gist.github.com/somebox/6b00f47451956c1af6b4](https://gist.github.com/somebox/6b00f47451956c1af6b4)

    # A script to set up a new mac. Uses bash, homebrew, etc.

    # Focused for ruby/rails development. Includes many utilities and apps:
    # - homebrew, rvm, node
    # - quicklook plugins, terminal fonts
    # - browsers: chrome, firefox
    # - dev: iterm2, sublime text, postgres, chrome devtools, etc.
    # - team: slack, dropbox, google drive, skype, etc
    # - utils: unarchiver, o-day, caffine, skitch, etc
    # - productivity: evernote, viscosity, omnigraffle, karabiner, etc.


    # Settings
    node_version="0.12.2"
    ruby_versions="1.9 2.1 2.2"
    ruby_default="2.1"

    # helpers
    function echo_ok { echo -e '\033[1;32m'"$1"'\033[0m'; }
    function echo_warn { echo -e '\033[1;33m'"$1"'\033[0m'; }
    function echo_error { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; }

    echo_ok "Install starting. You may be asked for your password (for sudo)."

    # requires xcode and tools!
    xcode-select -p || exit "XCode must be installed! (use the app store)"

    # requirements
    cd ~
    mkdir -p tmp
    echo_warn "setting permissions..."
    for dir in "/usr/local /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share"; do
    sudo chgrp admin $dir
    sudo chmod g+w $dir
    done

    # homebrew
    export HOMEBREW_CASK_OPTS="--appdir=/Applications"
    if hash brew &> /dev/null; then
    echo_ok "Homebrew already installed"
    else
    echo_warn "Installing homebrew..."
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    fi

    # RVM
    if hash rvm &> /dev/null; then
    echo_ok "RVM already installed"
    else
    echo "Installing RVM..."
    curl -sSL https://get.rvm.io | bash -s stable --ruby
    fi

    # add default gems to rvm
    global_gems_config="$HOME/.rvm/gemsets/global.gems"
    default_gems="bundler awesome-print lunchy rak"
    for gem in $default_gems; do
    echo $gem >> $global_gems_config
    done
    awk '!a[$0]++' $global_gems_config > /tmp/global.tmp
    mv /tmp/global.tmp $global_gems_config

    # RVM ruby versions
    for version in $ruby_versions; do
    rvm install $version
    done

    # moar homebrew...
    brew install caskroom/cask/brew-cask
    brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

    # brew taps
    brew tap caskroom/versions
    brew tap caskroom/fonts
    brew tap homebrew/games

    # Homebrew base
    brew install \
    autoconf automake bash-completion cowsay cmatrix \
    ffmpeg figlet gettext go gpg freetype htop-osx jq libxml2 mongodb node \
    phantomjs postgres qt readline sqlite unrar v8 wget youtube-dl

    # brew cask fonts
    echo_warn "Installing fonts..."
    brew cask install \
    font-anonymous-pro \
    font-dejavu-sans-mono-for-powerline \
    font-droid-sans \
    font-droid-sans-mono font-droid-sans-mono-for-powerline \
    font-meslo-lg font-input \
    font-inconsolata font-inconsolata-for-powerline \
    font-liberation-mono font-liberation-mono-for-powerline \
    font-liberation-sans \
    font-meslo-lg \
    font-nixie-one \
    font-office-code-pro \
    font-pt-mono \
    font-roboto \
    font-source-code-pro font-source-code-pro-for-powerline \
    font-source-sans-pro \
    font-ubuntu font-ubuntu-mono-powerline


    # brew cask quicklook
    echo_warn "Installing QuickLook Plugins..."
    brew cask install \
    qlcolorcode qlmarkdown qlprettypatch qlstephen \
    qlimagesize \
    quicklook-csv quicklook-json epubquicklook \
    animated-gif-quicklook

    # Apps
    echo_warn "Installing applications..."

    # google
    brew cask install google-chrome google-hangouts google-drive
    # other favorites
    brew cask install \
    bettertouchtool caffeine day-o karabiner the-unarchiver flux\
    1password dropbox evernote skitch picturelife \
    minecraft spotify transmission vlc \
    adafruit-arduino iterm2 mongohub chrome-devtools firefox sublime-text3 \
    slack skype telephone \
    citrix-receiver omnigraffle viscosity

    # xquartz
    echo_warn "Installing xquartz (this big download can be slow)"
    n=0
    until [ $n -ge 20 ]; do
    brew cask install xquartz && break
    n=$[$n+1]
    echo_error "... install failed, retry $n"
    done

    # brew imagemagick
    brew cask install inkscape
    brew install librsvg
    brew install imagemagick --with-librsvg

    echo
    echo_ok "Done."
    echo
    echo "After Dropbox has finished installing, link Sublime Text settings:"
    echo_warn " cd ~/Library/Application\ Support/Sublime\ Text\ 3/"
    echo_warn " rm -rf Packages"
    echo_warn " ln -s ~/Dropbox/Sublime/Packages ."
    echo
    echo "Then go to https://packagecontrol.io/installation for Package Control"
    echo
    echo "You may want to add the following settings to your .bashrc:"
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo
    - foz
  6. @somebox somebox revised this gist Jun 14, 2015. 1 changed file with 41 additions and 17 deletions.
    58 changes: 41 additions & 17 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -22,16 +22,18 @@ function echo_ok { echo -e '\033[1;32m'"$1"'\033[0m'; }
    function echo_warn { echo -e '\033[1;33m'"$1"'\033[0m'; }
    function echo_error { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; }

    echo_ok "Install starting. You may be asked for your password (for sudo)."

    # requires xcode and tools!
    xcode-select -p || exit "XCode must be installed! (use the app store)"
    xcode-select -p || exit "XCode must be installed! (use the app store)"

    # requirements
    cd ~
    mkdir -p tmp
    echo_warn "setting permissions..."
    for dir in "/usr/local /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share"; do
    sudo chgrp -R admin $dir
    sudo chmod -R g+w $dir
    sudo chgrp admin $dir
    sudo chmod g+w $dir
    done

    # homebrew
    @@ -69,45 +71,61 @@ done
    brew install caskroom/cask/brew-cask
    brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

    # brew taps
    brew tap caskroom/versions
    brew tap caskroom/fonts
    brew tap homebrew/games

    # Homebrew base
    brew install \
    autoconf automake bash-completion cowsay cmatrix \
    ffmpeg figlet gettext go freetype htop-osx mongodb node \
    phantomjs postgres qt readline sqlite unrar wget youtube-dl
    ffmpeg figlet gettext go gpg freetype htop-osx jq libxml2 mongodb node \
    phantomjs postgres qt readline sqlite unrar v8 wget youtube-dl

    # brew cask fonts
    echo_warn "Installing fonts..."
    brew tap caskroom/fonts
    brew cask install \
    font-anonymous-pro \
    font-dejavu-sans-mono-for-powerline \
    font-droid-sans \
    font-droid-sans-mono font-droid-sans-mono-for-powerline \
    font-meslo-lg font-input \
    font-inconsolata font-inconsolata-for-powerline \
    font-liberation-mono font-liberation-mono-for-powerline \
    font-liberation-sans \
    font-meslo-lg \
    font-nixie-one \
    font-office-code-pro \
    font-pt-mono \
    font-roboto \
    font-source-code-pro font-source-code-pro-for-powerline font-source-sans-pro
    font-source-code-pro font-source-code-pro-for-powerline \
    font-source-sans-pro \
    font-ubuntu font-ubuntu-mono-powerline


    # brew cask quicklook
    echo_warn "Installing QuickLook Plugins..."
    brew cask install qlcolorcode qlmarkdown qlprettypatch qlstephen \
    quicklook-csv quicklook-json epubquicklook animated-gif-quicklook
    brew cask install \
    qlcolorcode qlmarkdown qlprettypatch qlstephen \
    qlimagesize \
    quicklook-csv quicklook-json epubquicklook \
    animated-gif-quicklook

    # Apps
    echo_warn "Installing applications..."

    # google
    brew cask install google-chrome google-hangouts google-drive
    # other favorites
    brew cask install \
    bettertouchtool day-o karabiner the-unarchiver flux\
    1password dropbox evernote skitch \
    spotify transmission vlc \
    adafruit-arduino iterm mongohub chrome-devtools firefox sublime-text \
    bettertouchtool caffeine day-o karabiner the-unarchiver flux\
    1password dropbox evernote skitch picturelife \
    minecraft spotify transmission vlc \
    adafruit-arduino iterm2 mongohub chrome-devtools firefox sublime-text3 \
    slack skype telephone \
    citrix-receiver omnigraffle viscosity

    # xquartz
    # xquartz
    echo_warn "Installing xquartz (this big download can be slow)"
    n=0
    until [ $n -ge 20 ]; do
    @@ -124,7 +142,13 @@ brew install imagemagick --with-librsvg
    echo
    echo_ok "Done."
    echo
    echo_warn "You may want to add the following settings to your .bashrc:"
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo "After Dropbox has finished installing, link Sublime Text settings:"
    echo_warn " cd ~/Library/Application\ Support/Sublime\ Text\ 3/"
    echo_warn " rm -rf Packages"
    echo_warn " ln -s ~/Dropbox/Sublime/Packages ."
    echo

    echo "Then go to https://packagecontrol.io/installation for Package Control"
    echo
    echo "You may want to add the following settings to your .bashrc:"
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo
  7. @somebox somebox revised this gist May 3, 2015. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -126,6 +126,5 @@ echo_ok "Done."
    echo
    echo_warn "You may want to add the following settings to your .bashrc:"
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo_warn ' export CONFIGURE_ARGS="with-pg-config=/users/foz/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config"'
    echo

  8. @somebox somebox revised this gist May 3, 2015. 1 changed file with 0 additions and 9 deletions.
    9 changes: 0 additions & 9 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -75,15 +75,6 @@ brew install \
    ffmpeg figlet gettext go freetype htop-osx mongodb node \
    phantomjs postgres qt readline sqlite unrar wget youtube-dl

    # nodejs installer
    if hash node &> /dev/null; then
    echo_ok "NodeJS aldready installed"
    else
    echo_warb "Installing nodejs..."
    curl -o tmp/node-v${node_version}.pkg http://nodejs.org/dist/v${node_version}/node-v${node_version}.pkg
    open tmp/node-v${node_version}.pkg
    fi

    # brew cask fonts
    echo_warn "Installing fonts..."
    brew tap caskroom/fonts
  9. @somebox somebox revised this gist May 3, 2015. 1 changed file with 11 additions and 9 deletions.
    20 changes: 11 additions & 9 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -33,9 +33,9 @@ for dir in "/usr/local /usr/local/bin /usr/local/include /usr/local/lib /usr/loc
    sudo chgrp -R admin $dir
    sudo chmod -R g+w $dir
    done
    export HOMEBREW_CASK_OPTS="--appdir=/Applications"

    # homebrew
    export HOMEBREW_CASK_OPTS="--appdir=/Applications"
    if hash brew &> /dev/null; then
    echo_ok "Homebrew already installed"
    else
    @@ -69,10 +69,11 @@ done
    brew install caskroom/cask/brew-cask
    brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

    # Homebrew
    brew install autoconf automake bash-completion cowsay cmatrix ffmpeg figlet gettext go
    brew install freetype htop-osx mongodb node phantomjs postgres qt
    brew install readline sqlite unrar wget youtube-dl
    # Homebrew base
    brew install \
    autoconf automake bash-completion cowsay cmatrix \
    ffmpeg figlet gettext go freetype htop-osx mongodb node \
    phantomjs postgres qt readline sqlite unrar wget youtube-dl

    # nodejs installer
    if hash node &> /dev/null; then
    @@ -99,17 +100,18 @@ brew cask install \

    # brew cask quicklook
    echo_warn "Installing QuickLook Plugins..."
    brew cask install qlcolorcode qlmarkdown qlprettypatch qlstephen quicklook-csv quicklook-json epubquicklook animated-gif-quicklook
    brew cask install qlcolorcode qlmarkdown qlprettypatch qlstephen \
    quicklook-csv quicklook-json epubquicklook animated-gif-quicklook

    # Apps
    echo_warn "Installing applications..."
    # google
    brew cask install google-chrome google-hangouts google-drive
    # other favorites
    brew cask install \
    bettertouchtool day-o karabiner the-unarchiver vlc \
    1password dropbox evernote \
    skitch spotify transmission \
    bettertouchtool day-o karabiner the-unarchiver flux\
    1password dropbox evernote skitch \
    spotify transmission vlc \
    adafruit-arduino iterm mongohub chrome-devtools firefox sublime-text \
    slack skype telephone \
    citrix-receiver omnigraffle viscosity
  10. @somebox somebox revised this gist May 3, 2015. 1 changed file with 28 additions and 13 deletions.
    41 changes: 28 additions & 13 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -70,8 +70,9 @@ brew install caskroom/cask/brew-cask
    brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

    # Homebrew
    brew install autoconf automake bash-completion cowsay cmatrix ffmpeg figlet gettext go freetype htop-osx mongodb phantomjs qt readline sqlite unrar wget youtube-dl
    brew link go scons
    brew install autoconf automake bash-completion cowsay cmatrix ffmpeg figlet gettext go
    brew install freetype htop-osx mongodb node phantomjs postgres qt
    brew install readline sqlite unrar wget youtube-dl

    # nodejs installer
    if hash node &> /dev/null; then
    @@ -82,24 +83,37 @@ else
    open tmp/node-v${node_version}.pkg
    fi


    # brew cask fonts
    echo_warn "Installing fonts..."
    brew tap caskroom/fonts
    brew cask install font-anonymous-pro font-inconsolata font-liberation-sans font-roboto font-source-code-pro font-source-sans-pro
    brew cask install \
    font-anonymous-pro \
    font-droid-sans \
    font-droid-sans-mono font-droid-sans-mono-for-powerline \
    font-meslo-lg font-input \
    font-inconsolata font-inconsolata-for-powerline \
    font-liberation-mono font-liberation-mono-for-powerline \
    font-liberation-sans \
    font-roboto \
    font-source-code-pro font-source-code-pro-for-powerline font-source-sans-pro

    # brew cask quicklook
    echo_warn "Installing QuickLook Plugins..."
    brew cask install qlcolorcode qlmarkdown qlprettypatch qlstephen quicklook-csv quicklook-json
    brew cask install qlcolorcode qlmarkdown qlprettypatch qlstephen quicklook-csv quicklook-json epubquicklook animated-gif-quicklook

    # Apps
    echo_warn "Installing applications..."
    # brew cask google
    # google
    brew cask install google-chrome google-hangouts google-drive
    # brew cask other favorites
    brew cask install bettertouchtool day-o karabiner the-unarchiver vlc
    brew cask install 1password dropbox evernote
    brew cask install skitch spotify transmission
    brew cask install adafruit-arduino iterm mongohub chrome-devtools firefox postgres sublime-text
    brew cask install slack skype telephone
    brew cask install citrix-receiver omnigraffle viscosity
    # other favorites
    brew cask install \
    bettertouchtool day-o karabiner the-unarchiver vlc \
    1password dropbox evernote \
    skitch spotify transmission \
    adafruit-arduino iterm mongohub chrome-devtools firefox sublime-text \
    slack skype telephone \
    citrix-receiver omnigraffle viscosity

    # xquartz
    echo_warn "Installing xquartz (this big download can be slow)"
    n=0
    @@ -108,6 +122,7 @@ until [ $n -ge 20 ]; do
    n=$[$n+1]
    echo_error "... install failed, retry $n"
    done

    # brew imagemagick
    brew cask install inkscape
    brew install librsvg
  11. @foz foz revised this gist Apr 28, 2015. 1 changed file with 10 additions and 12 deletions.
    22 changes: 10 additions & 12 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo_warn ' export CONFIGURE_ARGS="with-pg-config=/users/foz/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config"'
    #!/bin/bash

    # A script to set up a new mac. Uses bash, homebrew, etc.

    # Focused for ruby/rails development. Includes many utilities and apps:
    @@ -101,21 +101,19 @@ brew cask install adafruit-arduino iterm mongohub chrome-devtools firefox postgr
    brew cask install slack skype telephone
    brew cask install citrix-receiver omnigraffle viscosity
    # xquartz
    if [[ -z `brew ls --versions xquartz` ]]; then
    echo_warn "Installing xquartz (this big download can be slow)"
    n=0
    until [ $n -ge 20 ]; do
    brew cask install xquartz && break
    n=$[$n+1]
    echo_error "... install failed, retry $n"
    done
    brew cask install xquartz --verbose
    fi
    echo_warn "Installing xquartz (this big download can be slow)"
    n=0
    until [ $n -ge 20 ]; do
    brew cask install xquartz && break
    n=$[$n+1]
    echo_error "... install failed, retry $n"
    done
    # brew imagemagick
    brew cask install inkscape
    brew install librsvg
    brew install imagemagick --with-librsvg

    echo
    echo_ok "Done."
    echo
    echo_warn "You may want to add the following settings to your .bashrc:"
  12. @foz foz revised this gist Apr 28, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash

    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo_warn ' export CONFIGURE_ARGS="with-pg-config=/users/foz/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config"'
    # A script to set up a new mac. Uses bash, homebrew, etc.

    # Focused for ruby/rails development. Includes many utilities and apps:
    @@ -119,7 +119,7 @@ brew install imagemagick --with-librsvg
    echo_ok "Done."
    echo
    echo_warn "You may want to add the following settings to your .bashrc:"
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications '
    echo_warn ' export CONFIGURE_ARGS="with-pg-config=/users/foz/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config'
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
    echo_warn ' export CONFIGURE_ARGS="with-pg-config=/users/foz/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config"'
    echo

  13. @foz foz revised this gist Apr 28, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,12 @@

    # Focused for ruby/rails development. Includes many utilities and apps:
    # - homebrew, rvm, node
    # -
    # - quicklook plugins, terminal fonts
    # - browsers: chrome, firefox
    # - dev: iterm2, sublime text, postgres, chrome devtools, etc.
    # - team: slack, dropbox, google drive, skype, etc
    # - utils: unarchiver, o-day, caffine, skitch, etc
    # - productivity: evernote, viscosity, omnigraffle, karabiner, etc.


    # Settings
  14. @foz foz created this gist Apr 28, 2015.
    120 changes: 120 additions & 0 deletions osx-setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,120 @@
    #!/bin/bash

    # A script to set up a new mac. Uses bash, homebrew, etc.

    # Focused for ruby/rails development. Includes many utilities and apps:
    # - homebrew, rvm, node
    # -


    # Settings
    node_version="0.12.2"
    ruby_versions="1.9 2.1 2.2"
    ruby_default="2.1"

    # helpers
    function echo_ok { echo -e '\033[1;32m'"$1"'\033[0m'; }
    function echo_warn { echo -e '\033[1;33m'"$1"'\033[0m'; }
    function echo_error { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; }

    # requires xcode and tools!
    xcode-select -p || exit "XCode must be installed! (use the app store)"

    # requirements
    cd ~
    mkdir -p tmp
    echo_warn "setting permissions..."
    for dir in "/usr/local /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share"; do
    sudo chgrp -R admin $dir
    sudo chmod -R g+w $dir
    done
    export HOMEBREW_CASK_OPTS="--appdir=/Applications"

    # homebrew
    if hash brew &> /dev/null; then
    echo_ok "Homebrew already installed"
    else
    echo_warn "Installing homebrew..."
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    fi

    # RVM
    if hash rvm &> /dev/null; then
    echo_ok "RVM already installed"
    else
    echo "Installing RVM..."
    curl -sSL https://get.rvm.io | bash -s stable --ruby
    fi

    # add default gems to rvm
    global_gems_config="$HOME/.rvm/gemsets/global.gems"
    default_gems="bundler awesome-print lunchy rak"
    for gem in $default_gems; do
    echo $gem >> $global_gems_config
    done
    awk '!a[$0]++' $global_gems_config > /tmp/global.tmp
    mv /tmp/global.tmp $global_gems_config

    # RVM ruby versions
    for version in $ruby_versions; do
    rvm install $version
    done

    # moar homebrew...
    brew install caskroom/cask/brew-cask
    brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

    # Homebrew
    brew install autoconf automake bash-completion cowsay cmatrix ffmpeg figlet gettext go freetype htop-osx mongodb phantomjs qt readline sqlite unrar wget youtube-dl
    brew link go scons

    # nodejs installer
    if hash node &> /dev/null; then
    echo_ok "NodeJS aldready installed"
    else
    echo_warb "Installing nodejs..."
    curl -o tmp/node-v${node_version}.pkg http://nodejs.org/dist/v${node_version}/node-v${node_version}.pkg
    open tmp/node-v${node_version}.pkg
    fi


    # brew cask fonts
    echo_warn "Installing fonts..."
    brew tap caskroom/fonts
    brew cask install font-anonymous-pro font-inconsolata font-liberation-sans font-roboto font-source-code-pro font-source-sans-pro
    # brew cask quicklook
    echo_warn "Installing QuickLook Plugins..."
    brew cask install qlcolorcode qlmarkdown qlprettypatch qlstephen quicklook-csv quicklook-json
    echo_warn "Installing applications..."
    # brew cask google
    brew cask install google-chrome google-hangouts google-drive
    # brew cask other favorites
    brew cask install bettertouchtool day-o karabiner the-unarchiver vlc
    brew cask install 1password dropbox evernote
    brew cask install skitch spotify transmission
    brew cask install adafruit-arduino iterm mongohub chrome-devtools firefox postgres sublime-text
    brew cask install slack skype telephone
    brew cask install citrix-receiver omnigraffle viscosity
    # xquartz
    if [[ -z `brew ls --versions xquartz` ]]; then
    echo_warn "Installing xquartz (this big download can be slow)"
    n=0
    until [ $n -ge 20 ]; do
    brew cask install xquartz && break
    n=$[$n+1]
    echo_error "... install failed, retry $n"
    done
    brew cask install xquartz --verbose
    fi
    # brew imagemagick
    brew cask install inkscape
    brew install librsvg
    brew install imagemagick --with-librsvg

    echo_ok "Done."
    echo
    echo_warn "You may want to add the following settings to your .bashrc:"
    echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications '
    echo_warn ' export CONFIGURE_ARGS="with-pg-config=/users/foz/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config'
    echo