guilhermeteodoro
3/18/2014 - 2:53 PM

CJ installation guide for mavericks

CJ installation guide for mavericks

OSX - Mavericks

HomeBrew

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

brew update
brew upgrade

RVM

#install
curl -L https://get.rvm.io | bash -s stable
  
# fix ssl
rvm osx-ssl-certs update all

Ruby

rvm install 2.1.1

Databases

brew install mariadb mongodb memcached redis

Others

brew install imagemagick nginx pidof optipng pngquant wget

Phantom, Node e NPM

#node
brew install phantomjs node

#npm ( require node )
curl https://npmjs.org/install.sh | sh

Initializers

mkdir ~/Library/LaunchAgents 

#MariaDB
cp /usr/local/Cellar/mariadb/5.5.36/homebrew.mxcl.mariadb.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

#mongoDB
cp /usr/local/Cellar/mongodb/2.4.9/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

Lib QT

brew install qt

Git

# Global configuration
git config --global user.name 'your_github_username'
git config --global user.email 'your_github_email'

# Shortcuts
vim ~/.gitconfig

#paste
[alias]
  st = status
  ci = commit
  co = checkout
  br = branch
[color]
  branch = auto
  diff = auto
  interactive = auto
  status = auto
  ui = true
[color "status"]
  added = yellow
  changed = cyan
  untracked = red

# Git Branch Config
vim ~/.bash_profile
  
# paste
function parse_git_dirty {
  [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*"
}

function parse_git_branch {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}

export PS1='\[\e[1;30m\]$(date +%H:%M:%S)\[\e[m\]\[\e[1;37m\] \[\e[1;37m\]\w\[\e[m\] $(parse_git_branch "(%s)" ) \[\e[1;32m\]\$ \[\e[m\]\[\e[1;37m\]'
  
source ~/.bash_profile

###CJ - Clonar todos os repositórios

curl -s "https://api.github.com/orgs/clickjogos/repos?per_page=100" -u "user" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["ssh_url"]} ]}'

###CJ - Pull

cd ~/clickjogos
 
rvm @global
gem install git-up term-ansicolor
 
wget https://gist.github.com/raw/02b8f09c58cbc6a09131/be3ab201716427b9320e5622a6974e53af3f745f/cjpull.rb

ruby cjpull.rb

###VIM

vim ~/.vimrc 

#paste
set number
syntax on

###Sublime terminal shortcut

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl

###DNS - Google

8.8.8.8
8.8.4.4

###Foreman

  • Isolando hosts
sudo vim /etc/hosts

#paste
127.0.0.1 account.dev
127.0.0.1 adm.dev
127.0.0.1 api.clickjogos.dev
127.0.0.1 clickjogos.dev
127.0.0.1 connect.clickjogos.dev
127.0.0.1 devcenter.dev
127.0.0.1 jdm.dev
127.0.0.1 m.clickjogos.dev
127.0.0.1 sso_example.clickjogos.dev
127.0.0.1 clicktracker.clickjogos.dev
127.0.0.1 joguinhos.dev

###Apps

###Chrome Extensions