Skip to content

Instantly share code, notes, and snippets.

View gchaix's full-sized avatar
😺

Greg Chaix gchaix

😺
View GitHub Profile
@gchaix
gchaix / gist:80bf2310f46cdb6d3a4d
Created December 24, 2015 01:55
Running a vagrant clone of a prod site
1. Clone your vagrant template (i.e. https://github.com/tag1consulting/puppet-centos or https://github.com/gchaix/webdev-vagrant)
2. Clone the site code to somewhere convenient
3. Link cloned site code to where the vagrant template is expecting to see code (set in Vagrantfile.local for puppet-centos, symlink to `htdocs` in the repo root for webdev-vagrant)
4. Get a database dump
a. if on Acquia cloud, install the drush alias file for the acquia account and do a `drush @sitename.testsql-dump > site.sql` in the repo root
5. `vagrant up`
6. `vagrant ssh` into the box and load the database from the sql dump: `drush sql-cli < site.sql`
7. PROFIT!
[vagrant@vagrant-multi1 default]$ drush sql-sanitize --debug --verbose
Using the Drush script found at /home/vagrant/.composer/vendor/drush/drush/drush.launcher using pcntl_exec
Drush preflight prepare loaded autoloader at [preflight]
/home/vagrant/.composer/vendor/autoload.php [0.01 sec, 2.88 MB]
Starting Drush preflight. [0.01 sec, 2.88 MB] [preflight]
Cache HIT cid: 8.1-dev-commandfiles-0-b4175ec541a5b0457a6af1fda10b4559 [debug]
[0.01 sec, 2.95 MB]
Scanning into /etc/drush for /.*aliases\.drush(8|)rc\.php$/ [0.03 sec, [debug]
5.61 MB]
Scanning into /etc/drush for /self\.alias\.drush(8|)rc\.php$/ [0.03 sec, [debug]
@gchaix
gchaix / default.vcl
Last active October 3, 2018 01:16
Example Varnish default.vcl for Drupal
#
# Customized VCL file for serving up a Drupal site with multiple back-ends.
#
# Based on this excellent Lullabot article:
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal
#
# Hooks for New Relic
C{
#include <sys/time.h>
@gchaix
gchaix / gist:9795176
Created March 26, 2014 22:34
CentOS 6.4 requirements
Installed:
perl-DBD-SQLite.x86_64 0:1.27-3.el6 perl-Digest-SHA1.x86_64 0:2.12-2.el6
perl-File-FnMatch.x86_64 0:0.02-6.el6 perl-JSON-XS.x86_64 1:2.27-2.el6
perl-Moose.x86_64 0:1.15-1.el6 perl-Parse-Yapp.noarch 0:1.05-41.el6
perl-ParseLex.noarch 0:2.15-14.el6 perl-Try-Tiny.noarch 0:0.11-4.el6
Dependency Installed:
perl-Class-C3.noarch 0:0.22-4.el6
perl-Class-MOP.x86_64 0:1.12-1.el6
perl-DBI.x86_64 0:1.609-4.el6
@gchaix
gchaix / packages.pp
Last active December 31, 2015 13:19
Conditional package naming in puppet
$updatecommand = $osfamily ? {
'Debian' => 'apt-get update && apt-get upgrade',
'RedHat' => 'yum update',
'Suse' => 'zypper update',
}
exec { "update_packages":
command => $updatecommand,
path => "/usr/local/bin/:/bin/",
}