Skip to content

Instantly share code, notes, and snippets.

before do
Chef::Recipe.any_instance.stub(:data_bag).with('s9y_sites').and_return([])
Chef::Recipe.any_instance.stub(:data_bag_item).with('s9y_sites', 'test_kitchen_ci') { JSON.parse(File.read('../fixtures/data_bags/s9y_sites/test_kitchen_ci.json')) }
end
@fishnix
fishnix / gist:93505557b27631d086b6
Created June 3, 2014 01:29
docker 'changelog' scratch
brew update
brew install boot2docker
boot2docker init
boot2docker up
export DOCKER_HOST=tcp://localhost:4243
git clone [email protected]:prezi/changelog.git
cd changelog
@fishnix
fishnix / gist:071571cecf159a7a71dd
Last active August 29, 2015 14:02
vagrant chef-zero
vagrant plugin install vagrant-chef-zero

Vagrantfile

# config.chef_zero.chef_repo_path = "../foobar/my_repo/"
config.chef_zero.nodes = "../chef-zero/nodes"
config.chef_zero.environments = "../chef-repo-yu/environments/*.json"
config.chef_zero.data_bags = "../chef-repo-yu/data_bags"
config.chef_zero.roles = "../chef-repo-yu/roles/*.json"

config.chef_zero.cookbooks = "chef-repo-yu/cookbooks"

@fishnix
fishnix / gist:09a78683bf5f2b6231d0
Created June 1, 2014 14:28
fix xcode tooling after upgrade
$ sudo xcode-select --switch /Library/Developer/CommandLineTools/
ltm rule select_pool_by_host_and_uri {
when HTTP_REQUEST {
set url [substr [string tolower [HTTP::host]] 0 ":" ][string tolower [HTTP::uri]]
#log local0. "Saved url as $url"
# If we match exactly, get there fast
if { [class match $url equals yale_pool_selector] } {
pool [class match -value -- $url equals yale_pool_selector]
} else { # else loop through the data-group
set cn yale_pool_selector
# yale_cas_authz iRule
#
# iRule to do authorization when paired with the yale_cas_auth iRule
#
# This rule expects a header (which it looks up in a static variable)
# that contains the netid. The netid will be cross referenced with a
# data group/class of the name "sso_authz_<virtual_server_name>".
#
# Failure to find a netid or failure to find the netid in the data group
# will result in a 403 error.
@fishnix
fishnix / yale_cas_auth.irule
Created August 9, 2013 18:54
CAS Client F5 iRule
# yale_cas_auth iRule
#
# iRule to act as a CAS client for apps that can't do CAS natively
#
# Since the sideband itself can't do SSL, it requires an
# unencrypted vserver to proxy sideband connections to
# an encrypted validation service.
#
# CAS flow looks like this:
# 1. Browser GET http://foo.yale.edu/someapp
[root@vm-d7prdapp-01 ~]# diff /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_1371473484_Mon_Jun_17_08_52_04_2013_.cf-before-edit
80c80
< KeepAlive Off
---
> KeepAlive $(httpd.keepalive_KeepAlive)
87c87
< MaxKeepAliveRequests 100
---
> MaxKeepAliveRequests $(httpd.keepalive_MaxKeepAliveRequests)
93c93
@fishnix
fishnix / default system VM login
Last active December 16, 2015 01:39
Cloudplatform scratch
user name: root,
password: 6m1ll10n
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
PS1="$RED\$(date +%H:%M) \w$YELLOW \$(parse_git_branch)$GREEN\$ "