Kumar Gaurav About

Development Environment on OSX

In this post I document the steps required to install various tools and environment to start development on OSX 10.10 (Yosemite). This is an evolving document.

Last updated: 25 Nov 2023


iTerm

Download iTerm

Homebrew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

How to stop brew from upgrading certain formulas

When

$ brew upgrade

is issued, brew will update all the formulas. To stop certain formulas from upgrading, do this

$ brew pin certainformula

GNU Stow

$ brew install stow

I use it for dotfiles sync as explained here

Emacs

$ brew update
$ brew install emacs --with-cocoa

# Symlink to Applications

$ ln -s /usr/local/Cellar/emacs/24.x/Emacs.app /Applications

Git

$ brew update
$ brew install git 

Generate SSH Keys

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

# Ensure ssh-agent is enabled

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa


# Copy

$ pbcopy < ~/.ssh/id_rsa.pub
# Paste in your github account if required

RVM and Ruby

$ \curl -sSL https://get.rvm.io | bash

Optional

# Install ruby 2.2

$ rvm install 2.2

# Install bundle as a global gem

$ rvm @global do gem install bundler

Java

Download from Oracle’s website

# To set JAVA_HOME

$ export JAVA_HOME=`/usr/libexec/java_home`

Autojump

# Pretty nifty directory navigation tool

$ brew install autojump
# Add the following to your .bash_profile(or equivalent)

[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

ZSH

$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Browser Plugins

  1. Adblock
  2. Privacy Badger
  3. HTTPS Everywhere

Mysql

# Install using brew

$ brew install mysql
# To run the server

$ mysql.server start
# To connect:

$ mysql -uroot
# To have launchd start mysql at login:

$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
# Then to load mysql now:

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Maven

$ brew install maven
$ mvn -version

Composer

# Install composer in your pwd. Requires PHP. 

$ curl -sS https://getcomposer.org/installer | php
# To use

$ php composer.phar
# Move it to a directory under PATH if you need it globally

$ mv composer.phar /usr/local/bin/composer
# Use it

$ composer

mcrypt

$ brew tap homebrew/php
$ brew install php55-mcrypt

Memcache

$ brew install libmemcached
$ brew install php55-memcached
# Run the server

$ memcached -d

Node and NPM

$ brew install node
# check

$ node -v
$ npm -v

# Upgrade node

$ brew update
$ brew upgrade node

Redis

$ brew update
$ brew install redis
# To have launchd start redis at login:

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
# Then to load redis now:

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
# Or, if you don't want/need launchctl, you can just run:

$ redis-server /usr/local/etc/redis.conf

Mule ESB

You can use mule in conjunction with AnyPoint IDE(Eclipse based) or as standalone runtime, which I prefer. Download the community edition standalone from https://developer.mulesoft.com/download-mule-esb-runtime Extract the zip and probably place it to a dir where you normally put software. For me it is ~/installs

$ cd <where_you_unzipped_mule>
# To start mule 

$ ./bin/mule
# To start mule as daemeon

$ ./bin/mule start
# To stop|restart

$ ./bin/mule stop|restart

To deploy applications to the standalone mule runtime, drop your project’s zip file to $MULE_HOME/apps and start mule

Groovy

$ brew update
$ brew install groovy
# Set GROOVY_HOME

$ export GROOVY_HOME=/usr/local/opt/groovy/libexec

Grails

$ brew update
$ brew install grails
# Set GRAILS_HOME

$ export GRAILS_HOME=/usr/local/opt/grails/libexec

Tree

Tree is a command line utility to view content of a dir in a tree like structure

$ brew update
$ brew install tree

Mongo DB

$ brew update
$ brew install mongodb

Golang

# Recommended: $HOME/go. I use $HOME/code/go

$ export GOPATH=$HOME/code/go
$ export PATH=$PATH:$GOPATH/bin

# Put the above in ~/.zshrc or ~/.bashrc or whatever suits you


$ mkdir -p $GOPATH $GOPATH/src $GOPATH/pkg $GOPATH/bin
$ brew update
$ brew install go

# Alternatively, download from go website and install


$ go version

Hat Tip

Upgrade when not using brew

Go to https://go.dev/doc/install, download the appropriate package and run the installer. This will take care of deleting the old install and upgrading

Gradle

$ brew install gradle

Pip

$ sudo easy_install pip

AWSCLI

$ pip install awscli
# If there is an error "Uninstalling a distutils installed project (six)..." on El Kapitan then use the following command

$ sudo pip install awscli --ignore-installed six

RethinkDB

$ brew update && brew install rethinkdb

ssh-copy-id

$ brew update && brew install ssh-copy-id

python3

$ brew update && brew install python3

fswatch

$ brew update && brew install fswatch

Yarn

$ brew update && brew install yarn

NVM

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

Ansible

$ sudo easy_install pip
$ sudo pip install ansible

Wercker

$ brew tap wercker/wercker
$ brew install wercker-cli