Skip to content

Instantly share code, notes, and snippets.

@saruba
Last active September 29, 2016 13:38
Show Gist options
  • Save saruba/41841917f74a35a36c1fb21da9fa448e to your computer and use it in GitHub Desktop.
Save saruba/41841917f74a35a36c1fb21da9fa448e to your computer and use it in GitHub Desktop.

Install environment

Xcode command line

You can install command line without install XCode

$ xcode-select --install

Install oh-my-zsh

https://github.com/robbyrussell/oh-my-zsh

$ curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

Edit ~/.zshrc

plugins=(git osx node npm nvm bower python pep8 django fabric virtualenvwrapper pip brew)
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

Install brew

http://brew.sh/

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

Updat path in ~/.zshrc.

export PATH='/usr/local/sbin:$PATH'

Install useful libraries:

$ brew install libtiff libjpeg webp little-cms2 libmagic wget

Install Node

We can install node or the version manager

$ brew install node

Install nvm (In the future we will use n) Last version in https://github.com/creationix/nvm

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

Add to ~/.zshrc

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

Install last version node

$ nvm install node

Python

$ brew install python python3

Reload terminal. Pip and setuptools have been installed. To update them

$ pip install --upgrade pip setuptools
$ pip install virtualenvwrapper
$ pip install ipython

MySQL

$ brew install mysql

To connect: mysql -uroot mysql -uroot -p To reload mysql after an upgrade: launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist Or, if you don't want/need launchctl, you can just run: mysql.server start

Change root password

$ mysqladmin -u root password 'yourpasswordhere'

PostgreSQL

$ brew install postgresql

# When installing the postgres gem, including ARCHFLAGS is recommended:
$ ARCHFLAGS="-arch x86_64" gem install pg
# To have launchd start postgresql at login:
$ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
# Then to load postgresql now:
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

GeoDjango

$ brew install postgis
$ brew install gdal
$ brew install libgeoip

$ createdb <db name>
$ psql <db name>
> CREATE EXTENSION postgis;
> CREATE EXTENSION postgis_topology;

Install GEOIP

$ brew install geoip
$ mkdir /usr/local/share/GeoIP/

$ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
$ gunzip GeoIP.dat.gz
$ mv GeoIP.dat /usr/local/share/GeoIP/

$ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
$ gunzip GeoLiteCity.dat.gz
$ mv GeoLiteCity.dat /usr/local/share/GeoIP/

Install GEOS

Geometry Engine, Open Source

$ brew install geos
$ brew install gdal
$ brew install spatialite-tools

Install Node libraries

$ sudo npm install -g less bower yuglify less-plugin-clean-css

Install rabbitmq

$ brew install rabbitmq

# Management Plugin enabled by default at http://localhost:15672 # To have launchd start rabbitmq at login: $ ln -sfv /usr/local/opt/rabbitmq/*.plist ~/Library/LaunchAgents # Then to load rabbitmq now: $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist # Or, if you don't want/need launchctl, you can just run: $ rabbitmq-server # in background $ rabbitmq-server -detached

Install memcached

$ brew install memcached

..

To have launchd start memcached at login:

ln -sfv /usr/local/opt/memcached/*.plist ~/Library/LaunchAgents

Then to load memcached now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist

Or, if you don't want/need launchctl, you can just run:

/usr/local/opt/memcached/bin/memcached

Install redis

$ 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

Brew services

Install brew services by tapping homebrew/services

$ brew tap homebrew/services

Launch services

$ brew services start mysql
$ brew services start rabbitmq
$ brew services start redis
$ brew services start memcached

Install gettext

$ brew install gettext

Add gettext to path:

export PATH=$PATH":/usr/local/opt/gettext/bin"

or you can (show warning in brew doctor):

$ brew link gettext --force

Install Docker

download from: https://www.docker.com/products/docker#/mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment