Skip to content

Instantly share code, notes, and snippets.

View viccherubini's full-sized avatar
🚀
Zooming

Vic Cherubini viccherubini

🚀
Zooming
View GitHub Profile
@viccherubini
viccherubini / build.xml
Last active December 27, 2015 08:09
Expert PHP Deployments Phing build.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<project name="Your Application" default="build">
<resolvepath propertyName="root_path" file="./" />
<resolvepath propertyName="config_path" file="./app/config/" />
<php function="date" returnProperty="build_date">
<param value="c" />
</php>
<php function="time" returnProperty="build_timestamp" />
@viccherubini
viccherubini / parameters.yml.template
Created November 3, 2013 12:52
Expert PHP Deployments parameters.yml.template file.
parameters:
database_driver: "pdo_pgsql"
database_host: "@@DB_SETTINGS_HOST@@"
database_port: ~
database_name: "@@DB_SETTINGS_DATABASE@@"
database_user: "@@DB_SETTINGS_USERNAME@@"
database_password: "@@DB_SETTINGS_PASSWORD@@"
test_database_driver: "pdo_pgsql"
test_database_host: "@@DB_SETTINGS_TEST_HOST@@"
@viccherubini
viccherubini / build.settings.template
Created November 3, 2013 12:47
Expert PHP Deployments build.settings.template file.
db_settings.host=localhost
db_settings.database=application
db_settings.username=application
db_settings.password=
db_settings_test.host=localhost
db_settings_test.database=application_test
db_settings_test.username=application_test
db_settings_test.password=
@viccherubini
viccherubini / build-dev
Created November 3, 2013 12:31
Expert PHP Deployments build-dev script.
#!/bin/bash
PHPMINVERSION='5.5.0'
PHPVERSION=`php -r "echo phpversion();"`
PHPCORRECTVERSION=`php -r "echo version_compare(phpversion(), '$PHPMINVERSION');"`
GREEN="\033[1;32m"
RED="\033[1;31m"
BLUE="\033[1;34m"
YELLOW="\033[1;33m"
@viccherubini
viccherubini / vagrant-bootstrap.sh
Last active December 27, 2015 06:59
Expert PHP Deployments Vagrant bootstrap file.
#!/usr/bin/env bash
# If Vagrant has already been provisioned, do not do anything.
# This saves us from accidentally running `vagrant up` without the --no-provision
# flag and messing up the box.
VAGRANT_PROVISIONED=/etc/vagrant-provisioned
if [ -e $VAGRANT_PROVISIONED ]
then
exit 0
@viccherubini
viccherubini / Vagrantfile
Last active December 27, 2015 06:59
Expert PHP Deployments Vagrantfile
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
config.vm.provision :shell, :path => "config/vagrant-bootstrap.sh"
# Create a forwarded port mapping.
config.vm.network :forwarded_port, guest: 8000, host: 8000, auto_correct: true
@viccherubini
viccherubini / deploy.rb
Last active December 26, 2015 23:59
Advanced Web Applications Using Symfony Capistrano deploy.rb configuration script.
# Deployment remotes
set :stages, %w(production staging)
set :default_stage, 'staging'
require 'capistrano/ext/multistage'
# Repo options
set :application, 'MajorAuth'
set :repository, 'git@github.com:brightmarch/major-auth.git'
set :scm, :git
@viccherubini
viccherubini / Capfile
Created October 30, 2013 11:07
Advanced Web Applications Using Symfony Capfile
load 'deploy'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
namespace :deploy do
task :install_composer, :roles => :web do
run "curl -s https://getcomposer.org/installer | php -- --install-dir=#{latest_release}"
end
@viccherubini
viccherubini / iptables.up.rules
Created October 30, 2013 01:52
Advanced Web Applications Using Symfony iptables configuration rules.
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
@viccherubini
viccherubini / vhost-majorauth.conf
Last active December 26, 2015 20:28
Advanced Web Applications Using Symfony Nginx virtual host configuration file.
server {
listen 80;
server_name majorauth.com www.majorauth.com;
return 301 https://majorauth.com$request_uri;
}
server {
listen 443;
server_name majorauth.com;