Skip to content

Instantly share code, notes, and snippets.

@pburkholder
pburkholder / README.md
Created January 29, 2015 21:07
Supermarket notes
@pburkholder
pburkholder / aws_cli_example.sh
Last active August 29, 2015 14:15
How to use tag filter with aws ecs
aws ec2 describe-subnets --filter "Name=tag:Name,Values=isa-w2a"
aws ec2 describe-vpcs --filter "Name=tag:Name,Values=chef_ha_vpc"
aws ec2 describe-internet-gateways --filter "Name=tag:Name,Values=chef_ha_vpc"
aws ec2 detach-internet-gateway --internet-gateway-id igw-bb7daade --vpc-id vpc-4dea4228
aws ec2 delete-internet-gateway --internet-gateway-id igw-bb7daade
@pburkholder
pburkholder / customer_patch_policyfile.md
Created April 29, 2015 15:58
policyfile and workflow

Follow Up Questions/Discussion for whomever (re: Policyfiles)

What's the Current Security Update Worflow Like?

The web side of the company is doing something like the environment cookbook pattern, where each rev of an application has its own environment, and there ~150 apps. If I'm understanding this correctly, that means there are maybe ~500-1000 environments. So how does a heartbleed-type fix get rolled out? Just overwrite the existing cookbook? Iterate over the environments and update them with the new

@pburkholder
pburkholder / attributes.md
Created May 13, 2015 15:54
Attributes thinking...

Here's some of my thinking attributes:

  • use default levels, except when you can't

  • think of attributes in two ways

    • as the interface to the cookbook
    • as attributes of the node (not as variable in the cookbook)
      • e.g. node.network.ip - is a fact about the node
      • node.users.sudoers - is an attribute you are setting because you want it to be a fact
  • avoid ruby logic in attributes/default.rb

@pburkholder
pburkholder / snippet.sh
Created May 13, 2015 16:05
Manage chef server self-signed cert
openssl s_client -connect chefserver.com:443 -showcerts 2>/dev/null </dev/null | openssl x509 -outform PEM > /etc/chef/chef_server.pem
chmod 444 /etc/chef_server.pem
cat <<END>>/etc/chef/client.rb
ssl_ca_file '/etc/chef/cheef_server.pem'
END
@pburkholder
pburkholder / notes.md
Last active August 29, 2015 14:25
opscode manage install fail

chef-server-ctl install opscode-manage fails with undefined method uri' for LWRP resource apt_repository from cookbook apt`

chef-server 12.0.7 updated to 12.1.1 ubuntu 14.04

@pburkholder
pburkholder / gist:dfa4b47e625e8f0784fe
Last active September 15, 2015 10:41 — forked from ncerny/gist:8d4aa3696e460668518f
Windows Development Kit for Chef
launch powershell with admin privileges
run:
Install-Package -name git -provider chocolatey
Install-Package -name chefdk -minimumVersion 0.6.0.1 -provider chocolatey
Install-Package -name atom -provider chocolatey
Open powershell window as user
apm install linter
@pburkholder
pburkholder / devWrkstnConfig.ps1
Last active September 16, 2015 17:07 — forked from gryte/devWrkstnConfig.ps1
Windows Workstation Config for Dev Environment for Chef Cookbooks
# launch powershell with admin privileges
# run:
# install chocolately
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
# update to WMF 5 & powershell version 5
choco upgrade powershell -pre
# reboot machine
# launch powershell with admin privileges
@pburkholder
pburkholder / mycpu.rb
Last active September 24, 2015 19:58
Adding a plugin to add additional attributes to the Mash is almost too easy:
# save as /some/path/to/plugin/mycpu.rb
# ohai -d /some/path/to/plugin cpu
Ohai.plugin(:Cpu) do
provides "cpu"
collect_data do
cpu[:cores] = cpu[:total] * cpu["0"]["cores"].to_i
end
end
@pburkholder
pburkholder / GoingAway.scpt
Created July 26, 2012 19:20
AppleScript for Away From Keyboard: Mark as away in HipChat and enable screensaver (Lock screen)
# Credit to Sean: http://ertw.com/blog/2012/05/02/controlling-hipchat-status-through-applescript/
# I link this to a Quicksilver trigger so I can press 'Shift-Option-L' when I Leave
tell application "System Events" to tell UI element "HipChat" of list 1 of process "Dock"
perform action "AXShowMenu"
delay 0.5
click menu item "Status" of menu 1
click menu item "Away" of menu 1 of menu item "Status" of menu 1
end tell
activate application "ScreenSaverEngine"