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
### Password Protect /administrator area
location ~ /administrator/.* {
auth_basic "Restricted";
auth_basic_user_file /var/www/prod.pac.cr/passwd;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
@sanguis
sanguis / vhost.conf
Last active August 29, 2015 13:58 — forked from anonymous/nginx.conf
nginx redirecting all non ssl/www traffic to https://www...
server {
listen 443 spdy;
listen 80;
server_name foo.org www.foo.org;
root /home/site/public;
#if ($request_method !~ "^(GET|HEAD|POST)$" ) { return 444; }
if ($https != 'on') { return 301 https://www.foo.org$request_uri; }
if ($host = "foo.org") { return 301 https://www.foo.org$request_uri; }
@sanguis
sanguis / gist:eb5648b3fcf44b7e09d3
Last active August 29, 2015 13:59
sanguis/Josh beaureards pub key, let me onto your system
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjJAhl1l23ty9oLDhBbYDWBCaWivycC2vEueriluFwD9JrglN4I1W0LJ9HLIp1z07dhCwT1eaeZEp7Xq5gMyN0q//wo4vguBDFggwA1MLA9H/kKUg2sFkZRpIsbUaz4VKQ6tZ5KHrQEbrIYdZ3kxdEAjncMj1HVChOfz2Gy6p1qhGF9jtsBj41Yb2FXG+HV+Sw3kyfaKytHsrgBqY3qhUM0uixqPn2/a6ozW0Uxt+jMrq1wqsOU3OyZHF+MiNAQcfOQvcS2N9Tu3UM+5t1wpiIri/1qEmIjgnkB3F2rOUIw3iNji/aHT90srodwo9b0sZFg87HJkt6GYqCbiw9Mk1h josh.beauregard@knectar.com
location = /Content/images/ESG_Logo_280x50.png {
log_not_found off;
access_log off;
error_page 404 =200 /sites/all/themes/foo/logo.png;
}
location / {
error_page 404 index.php
}
@sanguis
sanguis / find.rb
Last active August 29, 2015 14:19
find example
servers = [
{"release_server"=>
{
"name"=>"foo",
}
},
{"release_server"=>
{
"name"=>"bar",
@sanguis
sanguis / split_by_line.bash
Created September 2, 2015 14:36
a quck and dirty script splits a file by line numbers: use input order $file $prefix $linenumbers
#!/bin/bash
mkdir $1
cd $1
split -l $2 ../$0 $1
find . -type f -exec mv '{}' '{}'.csv \;
cd ..
@sanguis
sanguis / .vimrc
Last active September 25, 2015 09:58
my vimrc file optimized fro drupal development
"general vim rc settings
set term=xterm-color
set smartcase " match 'word' case-insensitive and 'Word' case-sensitive
set showmatch " shows matching parenthesis, bracket, or brace
set showcmd " show commands while they're being typed
set incsearch " searches as you type
syntax on " syntax highlighing
set background=dark " adapt colors for background
:colorscheme desert
set vb t_vb=
alias.df !git diff --no-prefix && git diff --staged --no-prefix
alias.clear reset --hard
alias.st status
alias.lg log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
alias.co checkout
alias.con checkout -b
alias.ci commit
alias.br branch
alias.ls branch -a
@sanguis
sanguis / settings.php
Last active September 27, 2015 11:47
Common Drupal Developer environment settings.php vars
//if (module_exists("stage_file_proxy")) $conf['stage_file_proxy_origin'] = "http://www.url.com";
// Disable (page) caching
$conf['cache'] = 0;
// Output errors to screen (and log)
$conf['error_level'] = 1;
// Disable aggregation of js and css
$conf['preprocess_js'] = FALSE;
@sanguis
sanguis / gist:1621647
Created January 16, 2012 16:30
drupal 7 menu link with unquid #id funnction
<?php
function theme_menu_link($variables) {
$element = $variables['element'];
//changes
$element['#attributes']['id'] = 'mlink-' . $element['#original_link']['mlid'];
// standard output;
$sub_menu = '';
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);