Skip to content

Instantly share code, notes, and snippets.

View benjaminws's full-sized avatar

Benjamin W. Smith benjaminws

View GitHub Profile
@benjaminws
benjaminws / common.bzl
Last active October 13, 2019 19:52
argo workflow in starlark
metav1 = proto.package("k8s.io.apimachinery.pkg.apis.meta.v1")
wfv1 = proto.package("github.com.argoproj.argo.pkg.apis.workflow.v1alpha1")
def workflow(name = None):
""" Common workflow metadata to be used in many workflows """
if not name:
name = "workflow"
return wfv1.Workflow(
metadata = metav1.ObjectMeta(
@benjaminws
benjaminws / green_hill_zone.rb
Created December 31, 2018 23:49
someone discovered sonic-pi
use_debug true
use_bpm 140
use_synth :piano
define :song_structure do |i|
1.times { i.call }
end
# Piano Trebel
in_thread do
@benjaminws
benjaminws / Makefile
Last active June 26, 2018 18:23
spin-login
STAMP_DEPS := .deps
PHONY: clean run install
clean:
@rm -rf $(STAMP_DEPS)
$(STAMP_DEPS):
@pip3 install -r requirements.txt > /dev/null 2>&1
@touch $@
@benjaminws
benjaminws / ls-node-taints.md
Created April 16, 2018 22:22
list node taints
→ cat nodes-taint.tmpl
{{printf "%-50s %-12s\n" "Node" "Taint"}}
{{- range .items}}
    {{- if $taint := (index .spec "taints") }}
        {{- .metadata.name }}{{ "\t" }}
        {{- range $taint }}
            {{- .key }}={{ .value }}:{{ .effect }}{{ "\t" }}
        {{- end }}
 {{- "\n" }}

Keybase proof

I hereby claim:

  • I am benjaminws on github.
  • I am benjaminws (https://keybase.io/benjaminws) on keybase.
  • I have a public key whose fingerprint is F5AD 9A35 C7ED DF93 FD1B 1BAB 8EA1 0315 498C 1579

To claim this, I am signing this object:

@benjaminws
benjaminws / welcome.txt
Created January 21, 2015 19:54
Hello There
Hopefully you can read this.
14:30.09 Tue May 27 2014! ~
bsmith@crackbook-pro!
-> telnet mail.python.org 25
Trying 2001:888:2000:d::a6...
telnet: connect to address 2001:888:2000:d::a6: Connection refused
Trying 82.94.164.166...
telnet: connect to address 82.94.164.166: Operation timed out
telnet: Unable to connect to remote host
@benjaminws
benjaminws / test-kitchen-berks.log
Created November 6, 2013 17:48
Every now and I then I see this from Berkshelf. This example was running in a test kitchen.
D ------Exception-------
D Class: Kitchen::ActionFailed
D Message: Failed to complete #converge action: [bad response #<Faraday::Response:0x007f31560f7df8 @env={:method=>:get, :body=>"503", :url=>#<URI::HTTPS:0x007f3156099050 URL:https://api.berkshelf.com/universe>, :request_headers=>{"User-Agent"=>"Faraday v0.8.8"}, :parallel_manager=>nil, :request=>{:proxy=>nil}, :ssl=>{}, :status=>503, :response_headers=>{"content-type"=>"application/json", "retry-after"=>"600", "content-length"=>"3", "connection"=>"Close"}, :response=>#<Faraday::Response:0x007f31560f7df8 ...>}, @on_complete_callbacks=[]>]
D ---Nested Exception---
D Class: RuntimeError
D Message: bad response #<Faraday::Response:0x007f31560f7df8 @env={:method=>:get, :body=>"503", :url=>#<URI::HTTPS:0x007f3156099050 URL:https://api.berkshelf.com/universe>, :request_headers=>{"User-Agent"=>"Faraday v0.8.8"}, :parallel_manager=>nil, :request=>{:proxy=>nil}, :ssl=>{}, :status=>503, :response_headers=>{"content-type"=>"application/
@benjaminws
benjaminws / what_the_crap.rb
Created July 17, 2013 19:18
found in some rubby
%w{ crazy method names all over the place }.each do |method|
class_eval "def #{method}; self[:'#{method}']; end"
class_eval "def #{method}=(value); self[:'#{method}'] = value; end"
end
@benjaminws
benjaminws / ssh_service.pp
Created March 2, 2013 21:55
nagios service example
@@nagios_service { "check_ssh_${::hostname}":
ensure => present,
use => 'local-service',
check_command => 'check_ssh',
service_description => 'SSH',
host_name => $::fqdn,
notifications_enabled => 1,
target => "/etc/nagios/servers/${::fqdn}_host.cfg",
}