Skip to content

Instantly share code, notes, and snippets.

View juliandunn's full-sized avatar

Julian C. Dunn juliandunn

View GitHub Profile
@juliandunn
juliandunn / test-kitchen-generated-freebsd92-vagrantfile.txt
Created March 11, 2014 19:36
test-kitchen-generated Vagrantfile for FreeBSD
Vagrant.configure("2") do |c|
c.vm.box = "opscode-freebsd-9.2"
c.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_freebsd-9.2_chef-provisionerless.box"
c.vm.hostname = "portsnap-freebsd-92.vagrantup.com"
c.vm.synced_folder ".", "/vagrant", disabled: true
c.vm.provider :virtualbox do |p|
p.customize ["modifyvm", :id, "--memory", "256"]
end
end
@juliandunn
juliandunn / default.rb
Created April 29, 2014 00:22
Illustration of stubbing other things, like guard expressions, in ChefSpec
service 'true_guard' do
action :start
only_if { File.exist?('/tmp/trueguard') }
end
service 'false_guard' do
action :start
not_if { File.exist?('/tmp/falseguard') }
end
@juliandunn
juliandunn / devopsdays-pgh-bad-wifi.txt
Created May 29, 2014 15:07
Much sadness - pinging default gateway on pitt wifi
fq-guest-wireless-pittnet-150-212-95-96 ~$ ping 150.212.94.1
PING 150.212.94.1 (150.212.94.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
64 bytes from 150.212.94.1: icmp_seq=0 ttl=255 time=2079.387 ms
Request timeout for icmp_seq 3
64 bytes from 150.212.94.1: icmp_seq=1 ttl=255 time=3054.474 ms
64 bytes from 150.212.94.1: icmp_seq=2 ttl=255 time=2520.698 ms
64 bytes from 150.212.94.1: icmp_seq=3 ttl=255 time=1846.184 ms
64 bytes from 150.212.94.1: icmp_seq=4 ttl=255 time=949.714 ms
node.default['demo'] = true
node.default['demoagain'] = false
ruby_block 'whee' do
block do
puts 'Ohai, world'
end
not_if { node['demo'] }
end
@juliandunn
juliandunn / cli-uis-need-ux-too.txt
Created June 12, 2014 14:01
C'mon man, command-line UIs are UIs too
borkbork ~$ s3cmd mb jdunn-getchef-foo
ERROR: Parameter problem: Expecting S3 URI with just the bucket name set instead of 'jdunn-getchef-foo'
borkbork ~$ s3cmd mb s3://jdunn-getchef-foo
Bucket 's3://jdunn-getchef-foo/' created
irb(main):001:0> Class.class
=> Class
irb(main):002:0> Class.superclass
=> Module
irb(main):003:0> Module.superclass
=> Object
irb(main):004:0> Object.superclass
=> BasicObject
irb(main):005:0> BasicObject.superclass
=> nil
@juliandunn
juliandunn / default.rb
Created July 12, 2014 03:20
example of using Chefspec to make assertions about guards
# Recipe code
service 'true_guard' do
action :start
only_if { File.exist?('/tmp/trueguard') }
end
service 'false_guard' do
action :start
not_if { File.exist?('/tmp/falseguard') }
Start: Mon Jul 21 20:22:01 2014
HOST: borkbork.nyc.urbandecoder.n Loss% Snt Last Avg Best Wrst StDev
1.|-- nectar.nyc.urbandecoder.n 0.0% 25 0.9 2.1 0.8 12.7 2.9
2.|-- l100.nycmny-vfttp-59.veri 0.0% 25 5.3 8.5 4.8 32.2 7.2
3.|-- g0-1-3-3.nycmny-lcr-21.ve 4.0% 25 16.6 11.9 8.5 16.6 2.2
4.|-- ae3-0.ny325-bb-rtr2.veriz 0.0% 25 19.9 17.7 7.2 59.9 14.9
5.|-- ??? 100.0 25 0.0 0.0 0.0 0.0 0.0
6.|-- 0.ae2.br3.nyc4.alter.net 0.0% 25 7.9 9.3 7.4 16.4 2.0
7.|-- 204.255.168.66 0.0% 25 9.9 10.7 7.8 26.5 4.0
8.|-- ??? 100.0 25 0.0 0.0 0.0 0.0 0.0
@juliandunn
juliandunn / get-ruby-compile-options.sh
Created July 24, 2014 12:35
how to get compile type options and compiler, etc. from Ruby
ruby -r rbconfig -r pp -e 'pp RbConfig::CONFIG'
@juliandunn
juliandunn / makeomnibus.sh
Created August 5, 2014 01:45
Initial revision of shell script to get thee an Omnibus on AIX
#!/bin/sh
# Nuke and pave all the freeware RPMs
rpm -qa | sed -e 's/\-[AIX Servers^\-]*\-[AIX Servers^\-]*$//' | egrep -v '(AIX-rpm|zlib|gettext)' | xargs rpm -e
# Get all deps for wget
perl -e 'use LWP::Simple; getprint($ARGV[0]);' ftp://www.oss4aix.org/rpmdb/deplists/aix61/wget-1.15-1.aix5.1.ppc.deps > /tmp/wget-1.15-1.aix5.1.ppc.deps
while read i; do
perl -e 'use LWP::Simple; getprint($ARGV[0]);' ftp://www.oss4aix.org/everything/RPMS/${i} > /tmp/${i}