Skip to content

Instantly share code, notes, and snippets.

View sanguis's full-sized avatar
👁️‍🗨️
DevOpsing all the things

Josh Beauregard sanguis

👁️‍🗨️
DevOpsing all the things
View GitHub Profile
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: 'localhost'
port: 25
server {
server_name foo.com;
#root /home/sites/foo/public;
root /home/sites/foo/cs-bs;
index index.html index.htm index.php;
#htpasswd
auth_basic "Restricted";
auth_basic_user_file /home/sites/foo/passwd;
location = / {
@sanguis
sanguis / josh.conf
Last active December 19, 2015 18:48
nginx microcaching drupal
fastcgi_cache_path /dev/shm/microcache levels=1:2 keys_zone=microcache:5M max_size=1G inactive=2h;
map $http_cookie $cache_uid {
default nil; # hommage to Lisp :)
~SESS[[:alnum:]]+=(?<session_id>[[:alnum:]]+) $session_id;
}
map $request_method $no_cache {
default 1;
HEAD 0;
GET 0;
@sanguis
sanguis / efqbase.php
Created June 18, 2013 15:13
EntiryFieldQuery basic page that outputs "team" type nodea teaser views
<?php
/**
* Implements hook_menu().
*/
function team_menu() {
$items['team'] = array(
'title' => t('Team'),
'page callback' => 'team_page',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
@sanguis
sanguis / ss.conf
Created April 30, 2013 14:11
nginx redirect ssl or domain to domain
server {
listen 80;
server_name support.knectar.com;
rewrite ^/(.*) https://rwww.example.com/$1 permanent;
}
server {
listen 443;
ssl on;
ssl_certificate /home/sites/certs/ssl-bundle.crt;
@sanguis
sanguis / apc.ini
Last active December 16, 2015 09:39
apc settings for a shared nginx server
extension=apc.so
shm_segments=2
apc.shm_size = 150M
apc.user_ttl=7200
apc.gc_ttl=3600
apc.ttl=7200
apc.enable_cli=1
apc.stat=0
apc.stat_ctime=1
apc.file_update_protection=2
"exception": "Chef::Exceptions::Package: package[php5-cgi] (php::package line 22) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for php5-cgi",
"backtrace": [
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/why_run.rb:241:in `run'",
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/why_run.rb:322:in `block in run'",
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/why_run.rb:321:in `each'",
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/why_run.rb:321:in `run'",
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/provider.rb:128:in `process_resource_requirements'",
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/provider.rb:104:in `run_action'",
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource.rb:603:in `run_action'",
"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/l
@sanguis
sanguis / gist:5041331
Last active December 14, 2015 06:19
entityfieldquery for returnining distinct links to a taxonomy category for a term
<?php
$query = new SysbioEntityFieldQuery();
$query
->entityCondition('bundle', 'event')
->fieldCondition('field_event_type', 'tid', 'NULL', '!=')
->addTag('distinct')
;
$result = $query->execute();
$nids = $result['node'];
$fields = field_info_instances('node', 'event');
@sanguis
sanguis / .zshrc
Last active December 13, 2015 20:48
zshrc with oh my zsh settings and alaias's
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="gallois"
# Example aliases
#auth_basic "Restricted";
#auth_basic_user_file /www/ht-live.password;