Skip to content

Instantly share code, notes, and snippets.

View swalberg's full-sized avatar

Sean Walberg swalberg

View GitHub Profile

Chef is an amazing tool but to really unlock its potential you need to look at how it integrates with the rest of your technology. This presentation is the story of how the NFL used Chef to transform its siloed infrastructure and practices into something more agile, automated, and reliable.

This presentation will talk about the last 2 years of Chef at the NFL including how we integrated it into our virtualization infrastructure, load balancers, storage, and application performance monitoring. We'll talk about some things that Chef taught us about infrastructure-as-code that we were able to apply to other areas, and things we learned to make our cookbooks easier to manage across groups.

result = if something
something_else # properly indented
else # lined up with the if
something_else_entirely
end # note we're still lined up
def add_nic(name)
network = find_network(options["net"])
puts network.class
case network
when RbVmomi::VIM::DistributedVirtualPortgroup
switch, pg_key = network.collect 'config.distributedVirtualSwitch', 'key'
port = RbVmomi::VIM.DistributedVirtualSwitchPortConnection(
switchUuid: switch.uuid,
portgroupKey: pg_key)
public class Test {
public static void main(String[] args) {
VisTest v1 = new VisTest("v1");
VisTest v2 = new VisTest("v2");
v1.doIt(v2);
}
}
package 'Install Apache' do
package_name case node[:platform]
when 'redhat', 'centos'
'httpd'
when 'ubuntu', 'debian'
'apache2'
end
end
datastores = if get_config(:vlan)
hosts_on_network = find_network(get_config(:vlan)).host
hosts_on_network.map
else
dc.datastore
end
sean@www:~ $ dig mx hillaryclinton.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.2 <<>> mx hillaryclinton.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52801
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 4, ADDITIONAL: 0
;; QUESTION SECTION:
;hillaryclinton.com. IN MX
@swalberg
swalberg / index.js
Last active August 29, 2015 14:11
Is it `this` or callbacks tripping me up?
asked to geolocate 570 Renfrew St, Winnipeg, MB 0 index.js:12
asked to geolocate 600 Renfrew St, Winnipeg, MB 1 index.js:16
in callback Address {textAddress: "600 Renfrew St, Winnipeg, MB", foo: 1, latlon: null, mapObj: null, geolocate: function}
geocode complete [Object]
placing a marker at 600 Renfrew St, Winnipeg, MB hf {k: 49.8609077, D: -97.19679180000003, toString: function, j: function, equals: function…}
in callback Address {textAddress: "600 Renfrew St, Winnipeg, MB", foo: "seen", latlon: hf, mapObj: Mj, geolocate: function}
geocode complete [Object]
placing a marker at 600 Renfrew St, Winnipeg, MB hf {k: 49.8602556, D: -97.19661889999998, toString: function, j: function, equals: function…}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Sip>
sip:PHONENUMBER@IPADDRESS
</Sip>
</Dial>
</Response>
# This gets you the __git_ps1 function
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
# show some extra metadata in the prompt such as if you have unchecked/tracked files
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1