Skip to content

Instantly share code, notes, and snippets.

@welly
welly / gist:30687db6695733e9eb56
Created March 12, 2015 01:26
drush alias entry for vagrant
$aliases['site.vm'] = array(
'env' => 'dev',
'site' => 'site',
'uri' => 'site.vm',
'root' => '/vagrant/www',
'remote-host' => 'site.vm',
'remote-user' => 'vagrant',
'ssh-options' => '-i ~/Clients/site/puphpet/files/dot/ssh/id_rsa',
'command-specific' => array(
'sql-dump' => array(
@welly
welly / loop.sh
Created March 10, 2015 06:35
Loops through a bunch of sites, git init, git add, git commit, git push to remote repo
#!/bin/bash
while read p; do
if [ -d "/home/$p" ]; then
echo $p
if [ -d "/home/$p/public_html" ]; then
cd /home/$p/public_html
git init
git add .
git commit -am "first commit"
server {
server_name [host];
root /var/www/[document_root]; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
@welly
welly / settings.php
Created July 30, 2014 09:10
New Drupal 7 settings file
<?php
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'uat_iapo_drupal',
'username' => 'uat_dba',
'password' => '3W5LcJQv26DpxGMm',
@welly
welly / gist:83b3325022b9eb1a249d
Created June 18, 2014 16:16
Jenkins deploy script
#!/bin/bash
if [[$BRANCH == '']]; then
GIT_BRANCH = "master"
else
GIT_BRANCH = $BRANCH
if
if [ -d "/tmp/clone/"]; then
rm -rf "/tmp/clone"
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
@welly
welly / settings.php
Last active August 29, 2015 14:01
Standard, semi-minimised settings file for Drupal 6
<?php
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'uat_iapo_drupal',
'username' => 'uat_dba',
'password' => '3W5LcJQv26DpxGMm',
@welly
welly / .gitignore
Created May 2, 2014 11:22
Drupal gitignore
# Ignore system files etc.
.DS_Store
.htaccess
.idea
whitefusestub.make
# Ignore paths that contain user-generated content.
sites/*/files
sites/*/private
@welly
welly / civicrm.settings.php
Last active August 29, 2015 14:00
Standard minimised Civicrm settings file
<?php
define( 'CIVICRM_UF', 'Drupal' );
define( 'CIVICRM_UF_DSN', 'mysql://' . $_SERVER['DB_USER'] . ':' . $_SERVER['DB_PASS'] . '@' . $_SERVER['DB_HOST'] . '/' . $_SERVER['DB_NAME'] . '?new_link=true');
define( 'CIVICRM_DSN', 'mysql://' . $_SERVER['DB_CIVIUSER'] . ':' . $_SERVER['DB_CIVIPASS'] . '@' . $_SERVER['DB_CIVIHOST'] . '/' . $_SERVER['DB_CIVINAME'] . '?new_link=true' );
define('CIVICRM_LOGGING_DSN', CIVICRM_DSN);
global $civicrm_root;
$site_root = '/Users/alastair/dev/clients/chagos/httdocs';
@welly
welly / settings.php
Last active August 29, 2015 14:00
Standard, semi-minimised Drupal settings.php file for Drupal 7
<?php
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => getenv('DB_NAME'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASS'),