ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew update| #!/bin/bash | |
| OLD=`md5 -q composer.lock.old` | |
| NEW=`md5 -q composer.lock` | |
| if [ "$NEW" != "$OLD" ] | |
| then | |
| rm -rf vendor | |
| php composer.phar install | |
| fi | |
| cat composer.lock > composer.lock.old |
| #!/bin/bash | |
| if [ 1 -ne $# ] | |
| then | |
| echo "Usage `basename $0` {tar.gz database file}" | |
| exit 65; | |
| fi | |
| if [ -f "$1" ] | |
| then |
| #! /bin/bash | |
| MYSQL="/opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper" | |
| NGINX="/opt/local/sbin/nginx" | |
| PHPFPM="/opt/local/sbin/php-fpm" | |
| PIDPATH="/opt/local/var/run" | |
| MEMCACHED="/opt/local/bin/memcached -m 24 -P /opt/local/var/run/memcached.pid -u root" | |
| if [ $1 = "start" ]; then | |
| sudo $MYSQL start | |
| echo "Starting php-fpm ..." |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| #!/bin/bash | |
| # Tar shit up: | |
| today=$(date '+%d_%m_%y') | |
| echo "* Performing domain backup..." | |
| tar czf /var/backups/constantshift.com_"$today".tar.gz -C / var/www/constantshift.com | |
| echo "* Backed up..." | |
| # Remove shit older than 7 days: | |
| MaxFileAge=7 | |
| find /var/backups/ -name '*.gz' -type f -mtime +$MaxFileAge -exec rm -f {} \; | |
| # Rsync shit to the grid: |
| upstream php-fpm { | |
| server unix:/var/run/php5-fpm.sock; | |
| } | |
| server { | |
| listen 80; | |
| server_name www.example.com; | |
| rewrite ^ http://example.com$request_uri?; | |
| } |
| #!/usr/bin/env bash | |
| size=1024 # MB | |
| mount_point=$HOME/tmp | |
| name=$(basename "$mount_point") | |
| usage() { | |
| echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \ | |
| "(default: mount)" >&2 | |
| } |
If you're interested in how MacPorts works, consider reading the documentation for it here: http://guide.macports.org/.
| server { | |
| listen 80; | |
| # Server name being used (exact name, wildcards or regular expression) | |
| server_name mysite.com; | |
| client_max_body_size 20M; | |
| # Document root, make sure this points to your Symfony2 /web directory | |
| root /home/user/sites/mysite.com/web; |