Skip to content

Instantly share code, notes, and snippets.

@snnwolf
snnwolf / README
Created October 29, 2015 10:59 — forked from diemuzi/README
Apache 2.2.x / 2.4.x FPM Configuration
This configuration is a working copy which I have tested on Apache 2.2.x and 2.4.x
I highly recommend you use this version of mod_fastcgi as it works with Apache 2.4.x, fastcgi.com version does not!
https://github.com/ByteInternet/libapache-mod-fastcgi
The fastcgi.com version is 2.4.6, the version I am recommending registers as 2.4.7
To patch mod_fastcgi for use with Apache 2.4.x look at the debian/patches folder. It's not specific to Debian OS so don't let that fool you. I personally use Archlinux.
Of course to compile mod_fastcgi:
@snnwolf
snnwolf / nginx.conf
Created October 29, 2015 11:14 — forked from denys281/nginx.conf
Symfony2 nginx virtual host (php-fpm)
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;
@snnwolf
snnwolf / gist:d22501563210e42f720f
Created November 3, 2015 21:21
MacPorts (PHP, MySQL, SQLite, Postgres)

Install Apache 2, MySQL 5 and PHP 5 on Mac OS X using MacPorts:

Preparation

  • Install Xcode: Grab it from App Store
  • Install Command line tools in xcode (open xcode -> Preferences -> Downloads -> Command Line tools)
  • Install MacPorts: http://macports.org/install.php.
  • Check MacPorts is installed. This will be a good test to see if MacPorts was installed properly:sudo port -v selfupdate.

If you're interested in how MacPorts works, consider reading the documentation for it here: http://guide.macports.org/.

@snnwolf
snnwolf / README.md
Created November 11, 2015 21:33 — forked from lopezjurip/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install Homebrew:

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

Update Homebrew formulae:

brew update
#!/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
}
@snnwolf
snnwolf / nginx-vhost.conf
Created November 19, 2015 20:06 — forked from tjstein/nginx-vhost.conf
nginx vhost config for WordPress + PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
@snnwolf
snnwolf / gs-backup.sh
Created November 19, 2015 20:21 — forked from tjstein/gs-backup.sh
gs-backup.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:
@snnwolf
snnwolf / hack.sh
Created November 20, 2015 09:34 — forked from tjstein/hack.sh
OSX For Hackers
#!/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
#
@snnwolf
snnwolf / new_gist_file.sh
Created November 25, 2015 09:04 — forked from un1ko85/new_gist_file.sh
Starting and stopping NginX / MySQL / PHP-FPM on Mac OS X
#! /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 ..."
@snnwolf
snnwolf / post-checkout-composer.sh
Created March 27, 2016 08:24 — forked from yehosef/post-checkout
git hook to update composer dependencies only if changed
#!/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