Skip to content

Instantly share code, notes, and snippets.

View scarolan's full-sized avatar
🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar

Sean Carolan scarolan

🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar
View GitHub Profile
@scarolan
scarolan / gist:794132f8a5befe227b49
Created October 6, 2015 03:03 — forked from jimcroft/gist:3878113
Enable WinRM for Chef bootstrapping via EC2 user data
<powershell>
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow
use_inline_resources
action :create do
# Set the document root
document_root = "/srv/apache/#{new_resource.site_name}"
# Add a template for Apache virtual host configuration
template "/etc/httpd/conf.d/#{new_resource.site_name}.conf" do
source "custom.erb"
mode "0644"
##########################
chef-sa-group AWS EC2 Instance Report
##########################
If you have instances listed below and would like to remove them from this
report, add an AWS tag named Persist to your instances and set it to true.
Any instances flagged with Persist=true tags will be ignored by this report.
cdsge-provisioner|i-0054ffc4|us-west-2a|infra-node-praesidio-httpdbaas-acceptance-1|4 days 2 hours 48 minutes and 55 seconds
cdsge-provisioner|i-092ff6cd|us-west-2a|infra-node-ae-sge-sitedbaas-rehearsal-1|10 days 5 hours 58 minutes and 41 seconds
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1431095274000",
"Effect": "Allow",
"Action": [
"ec2:AllocateAddress",
"ec2:AssignPrivateIpAddresses",
"ec2:AssociateAddress",
@scarolan
scarolan / gist:f93a8f9b362c4d3a4436
Last active November 20, 2015 19:27
Set the tab name in iTerm to contain the current directory and git branch
function set_iterm_title {
echo -ne "\e]1;$1\a"
}
function git_branch {
BRANCH_REFS=$(git symbolic-ref HEAD 2>/dev/null) || return
GIT_BRANCH="${BRANCH_REFS#refs/heads/}"
[ -n "$GIT_BRANCH" ] && echo "$GIT_BRANCH "
}
@scarolan
scarolan / default.rb
Last active December 21, 2015 22:32
AWS Chef Workshop Files
default['web']['width'] = '1280'
default['web']['height'] = '768'
default['web']['base'] = 'http://external.kongregate-games.com/gamez/0021/4044/live/'
default['web']['src'] = 'http://external.kongregate-games.com/gamez/0021/4044/live/embeddable_214044.swf'
@scarolan
scarolan / rake_setup_error.log
Created December 23, 2015 15:55
Rake setup errors with Chef Delivery
Recipe: delivery-cluster::_settings
* link[C:/Users/Administrator/delivery-cluster/.chef/../.chef/delivery-cluster-data] action create
================================================================================
Error executing action `create` on resource 'link[C:/Users/Administrator/delivery-cluster/.chef/../.chef/delivery-cluster-data]'
================================================================================
Chef::Exceptions::Win32APIError
-------------------------------
The filename, directory name, or volume label syntax is incorrect.
variable "region" { }
provider "aws" {
region = "${var.region}"
}
resource "aws_instance" "example" {
ami = "ami-d05e75b8"
instance_type = "t2.micro"
}
exports.pins = {
blinkm: { type: "I2C", address: 0x09, sda: 53, clock: 54 }
};
exports.configure = function () {
this.blinkm.init();
}
exports.close = function () {
this.blinkm.close();
exports.pins = {
blinkm: {type: "I2C", address: 0x00, sda: 53, clock: 54}
};
exports.configure = function() {
this.blinkm.init();
}
exports.close = function() {
this.blinkm.init();