Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am stensonb on github.
  • I am stensonb (https://keybase.io/stensonb) on keybase.
  • I have a public key ASAHMwW9cD4OpgtOI0CjEjBi6rbjTAuoi_AJZZ6Yb8kSKgo

To claim this, I am signing this object:

{
"apiVersion": "v1",
"kind": "Secret",
"metadata": {
"name": "my-secret"
},
"data": {
"password": "awpkCmEgcwp0aGluZ3NhcmVoZXJlZm9yYXJlYXNvbmJ1dG5vYm9keXJlYWxsdW5kZXJzdGFuZHN3aHl3ZXRoaW5na3RoYXdheS5pbW5vdHN1cmVob3dpZmVlbGFib3V0YmVpbmdzaW1wbHlzZWxmaXNoLmltaGF2aW5nYWhhcmR0aW1ld29uZGVyaW5nd2h5dGhhdCdzd3JvbmcuaWZjZXJ0YWlubHlzZWVtc21vcmVpbnRlcmVzdGluZ2lmeW91ZG9pdHRoYXR3YXl0aG91Z2hpJ3ZlbmV2ZXJ0cmllZGRlc3BpdGV3YW50aW5ndG8KawpkCmEgcwp0aGluZ3NhcmVoZXJlZm9yYXJlYXNvbmJ1dG5vYm9keXJlYWxsdW5kZXJzdGFuZHN3aHl3ZXRoaW5na3RoYXdheS5pbW5vdHN1cmVob3dpZmVlbGFib3V0YmVpbmdzaW1wbHlzZWxmaXNoLmltaGF2aW5nYWhhcmR0aW1ld29uZGVyaW5nd2h5dGhhdCdzd3JvbmcuaWZjZXJ0YWlubHlzZWVtc21vcmVpbnRlcmVzdGluZ2lmeW91ZG9pdHRoYXR3YXl0aG91Z2hpJ3ZlbmV2ZXJ0cmllZGRlc3BpdGV3YW50aW5ndG8KawpkCmEgcwp0aGluZ3NhcmVoZXJlZm9yYXJlYXNvbmJ1dG5vYm9keXJlYWxsdW5kZXJzdGFuZHN3aHl3ZXRoaW5na3RoYXdheS5pbW5vdHN1cmVob3dpZmVlbGFib3V0YmVpbmdzaW1wbHlzZWxmaXNoLmltaGF2aW5nYWhhcmR0aW1ld29uZGVyaW5nd2h5dGhhdCdzd3JvbmcuaWZjZXJ0YWlubHlzZWVtc21vcmVpbnRlcmVzdGluZ2lm
@stensonb
stensonb / gist:a7e9a2109ed280c83ae0
Last active December 10, 2015 23:03
kubectl get secrets --namespace=tectonic-system
15:01 $ kubectl get secrets
NAME TYPE DATA
default-token-ozqdo kubernetes.io/service-account-token 2
tectonic-ca-cert Opaque 1
tectonic-console-cert Opaque 2
tectonic-console-client-creds Opaque 1
tectonic-deployer-config Opaque 9
tectonic-identity-cert Opaque 2
tectonic-identity-config Opaque 4
tectonic-identity-connectors Opaque 1
@stensonb
stensonb / journalctl -f
Created November 24, 2015 20:19
why can't I create docker container?
Nov 24 20:16:49 coreos-0002.ded.net dockerd[6431]: time="2015-11-24T20:16:49.779400253Z" level=debug msg="Calling POST /containers/create"
Nov 24 20:16:49 coreos-0002.ded.net dockerd[6431]: time="2015-11-24T20:16:49.779459717Z" level=info msg="POST /v1.19/containers/create"
Nov 24 20:16:49 coreos-0002.ded.net dockerd[6431]: time="2015-11-24T20:16:49.810132220Z" level=debug msg="Calling POST /containers/{name:.*}/attach"
Nov 24 20:16:49 coreos-0002.ded.net dockerd[6431]: time="2015-11-24T20:16:49.810154909Z" level=info msg="POST /v1.19/containers/6a2d0c472269cd0a62545c9493b8bfcea731d52b5baaee1dab9a87ee5ba9c941/attach?stderr=1&stdout=1&stream=1"
Nov 24 20:16:49 coreos-0002.ded.net dockerd[6431]: time="2015-11-24T20:16:49.810273273Z" level=debug msg="attach: stdout: begin"
Nov 24 20:16:49 coreos-0002.ded.net dockerd[6431]: time="2015-11-24T20:16:49.810318471Z" level=debug msg="attach: stderr: begin"
Nov 24 20:16:49 coreos-0002.ded.net dockerd[6431]: time="2015-11-24T20:16:49.810682133Z" level=debug msg="Calling
Last login: Thu Jul 9 11:37:30 on ttys006
Bryans-MacBook-Pro:~ bryan$ whois 221.235.189.176
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#
# If you see inaccuracies in the results, please report at
# http://www.arin.net/public/whoisinaccuracy/index.xhtml
#
1100 /usr/bin
1150 /usr/src/linux-headers-3.2.0-61/include/linux
1150 /usr/src/linux-headers-3.2.0-70/include/linux
1151 /usr/src/linux-headers-3.2.0-61-virtual/include/linux
1151 /usr/src/linux-headers-3.2.0-70-virtual/include/linux
1190 /usr/src/linux-headers-3.2.0-61-virtual/include/config
1190 /usr/src/linux-headers-3.2.0-70-virtual/include/config
1288 /usr/share/man/man1
2737 /usr/share/man/man3
2853 /var/lib/dpkg/info
@stensonb
stensonb / gist:23fea108ecc045706d27
Created October 10, 2014 21:26
with input validation
class Greed
def score(dice)
score = 0
histogram = {}
# input sanity
raise RuntimeError, "Uh...huh? I don't get it..." unless dice.is_a? Array
raise RuntimeError, "No cheating! The rules say you can only roll up to 5 dice!" unless dice.size <= 5
# model the array into a histogram
@stensonb
stensonb / gist:de77d84a38cb63bd9bac
Created October 10, 2014 21:11
the greed game score() method
class Greed
def score(dice)
score = 0
histogram = {}
# model the array into a histogram
dice.each do |die|
histogram[die] += 1 unless histogram[die].nil? # +1 if the value existed
histogram[die] = 1 if histogram[die].nil? # add the value if it was nil
end
require 'spec_helper'
describe 'some stuff' do
it 'does things' do
ChefSpec::Runner.new.converge('ppa::default')
end
it 'does other things' do
ChefSpec::Runner.new.converge('ppa::default')
end
require 'chefspec'
#require File.join(File.dirname(__FILE__), '*.rb')
PROJECT_ROOT = File.expand_path('../..', __FILE__)
$cookbook_paths = [
File.expand_path('../../..', __FILE__),
File.expand_path('../cookbooks', __FILE__)
]