Skip to content

Instantly share code, notes, and snippets.

@guillaumepotier
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guillaumepotier/6c424a944d655d013bbe to your computer and use it in GitHub Desktop.
Save guillaumepotier/6c424a944d655d013bbe to your computer and use it in GitHub Desktop.
Env config
# User configuration
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/php5/bin:$PATH
export PATH=$PATH:/usr/local/sbin
## May be automatically added by NVM installation
export NVM_DIR="/Users/USERNAME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm use 0.10.36
alias listNp='npm list -g --depth=0'

Install php

  1. install php5.5 with liip. All modifications on php.ini must be made in
/usr/local/php5/php.d/99-liip-developer.ini
  1. In ~/.bash_profile define wich php the system will use :
PATH=/usr/local/php5/bin:$PATH

Configure apache

Create vhosts

In /etc/apache2/extra/httpd-vhosts.conf use this structure:

<VirtualHost *:80>
    DocumentRoot "/Users/USERNAME/Sites"
    ServerName localhost
    <Directory "/Users/USERNAME/Sites">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Add the new virtual host in /etc/hosts:

127.0.0.1 localhost

Enable the vhosts in /etc/apache2/httpd.conf:

  1. User USERNAME

  2. Group staff

  3. Uncomment Include /etc/apache2/extra/httpd-vhosts.conf

  4. Restart apache sudo apachectl restart

  5. Uncomment these following lines:

    • LoadModule authz_core_module libexec/apache2/mod_authz_core.so
    • LoadModule authz_host_module libexec/apache2/mod_authz_host.so
    • LoadModule userdir_module libexec/apache2/mod_userdir.so
    • Include /private/etc/apache2/extra/httpd-userdir.conf

Create user configuration

  1. Create a file in /etc/apache2/users/USERNAME.conf
  2. Uncomment: Include /private/etc/apache2/users/*.conf
  3. Enter this structure:
<Directory "/Users/USERNAME/Sites/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
  1. Restart apache sudo apachectl restart

Install Brew

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

Install mysql

And install mysql via brew : (pay attention to which version of MySQL you're downloading)

brew install mysql
cp /usr/local/Cellar/mysql/5.6.24/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysqladmin -u root password 'root'
mysql.server start

Install Git

brew install git

install and configure git

Use SSH

Install composer

https://getcomposer.org/doc/00-intro.md#globally

Install Node via Nvm

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

Install Redis and RabbitMQ

global (recommended):

brew install redis
brew install rabbitmq

http://naleid.com/blog/2011/03/05/running-redis-as-a-user-daemon-on-osx-with-launchd

Install less

npm install -g less

Sublime Text 3

If you want to open a file with Sublime from Terminal sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

[color]
branch = auto
diff = auto
status = auto
interactive = auto
status = auto
[alias]
st = status
ci = commit
co = checkout
br = branch
logg = log --decorate --graph
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset%s %Cgreen(%an %cr)%Creset' --abbrev-commit --date=relative
lga = "!sh -c 'git log --author=\"$1\" -p $2' -"
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lint = "!sh -c 'git status | awk \"/modified/ {print \\$3}\" | xargs -L 1 php -l'"
logfull = log --pretty=fuller --graph --stat -p
cat = cat-file -p
unstage = reset HEAD
uncommit = update-ref HEAD HEAD^
uncommithard = reset --hard HEAD^
undomerge = reset --hard ORIG_HEAD
oups = commit -a --amend -C HEAD
[branch "master"]
remote = origin
merge = refs/heads/master
rebase = true
[core]
autocrlf = input
excludesfile = ~/.gitignore
eol = lf
[mergetool]
keepBackup = true
<VirtualHost *:80>
DocumentRoot "/Users/USERNAME/Sites"
ServerName localhost
<Directory "/Users/USERNAME/Sites">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment