├── 2015-all-things-open ├── README.md ├── guestbook │ ├── README.md │ ├── _src │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── guestbook │ │ │ └── Dockerfile │ │ ├── main.go │ │ ├── public │ │ │ ├── index.html │ │ │ ├── script.js │ │ │ └── style.css │ │ └── script │ │ │ ├── build.sh │ │ │ ├── clean.sh │ │ │ ├── push.sh │ │ │ └── release.sh │ ├── guestbook-controller.json │ ├── guestbook-page.png │ ├── guestbook-service.json │ ├── redis-master-controller.json │ ├── redis-master-service.json │ ├── redis-slave-controller.json │ └── redis-slave-service.json └── namespace.yaml ├── 2015-dex-golangsf └── README.md ├── 2015-kubecon ├── README.md └── tls-setup │ ├── Makefile │ ├── README.md │ ├── certs │ ├── ca-key.pem │ ├── ca.csr │ ├── ca.pem │ ├── etcd-key.pem │ ├── etcd.csr │ ├── etcd.pem │ ├── k8s-key.pem │ ├── k8s.csr │ └── k8s.pem │ └── config │ ├── ca-config.json │ ├── ca-csr.json │ └── req-csr.json ├── 2015-linuxcon-europe └── README.md ├── 2015-twilio ├── README.md ├── guestbook │ ├── README.md │ ├── _src │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── guestbook │ │ │ └── Dockerfile │ │ ├── main.go │ │ ├── public │ │ │ ├── index.html │ │ │ ├── script.js │ │ │ └── style.css │ │ └── script │ │ │ ├── build.sh │ │ │ ├── clean.sh │ │ │ ├── push.sh │ │ │ └── release.sh │ ├── guestbook-controller.json │ ├── guestbook-page.png │ ├── guestbook-service.json │ ├── redis-master-controller.json │ ├── redis-master-service.json │ ├── redis-slave-controller.json │ └── redis-slave-service.json └── namespace.yaml ├── 2016-great-wide-open ├── README.md ├── guestbook │ ├── README.md │ ├── _src │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── guestbook │ │ │ └── Dockerfile │ │ ├── main.go │ │ ├── public │ │ │ ├── index.html │ │ │ ├── script.js │ │ │ └── style.css │ │ └── script │ │ │ ├── build.sh │ │ │ ├── clean.sh │ │ │ ├── push.sh │ │ │ └── release.sh │ ├── guestbook-controller.json │ ├── guestbook-page.png │ ├── guestbook-service.json │ ├── redis-master-controller.json │ ├── redis-master-service.json │ ├── redis-slave-controller.json │ └── redis-slave-service.json └── namespace.yaml ├── 2016-philly-ete ├── README.md ├── tectonic-console-service.json ├── tectonic-console-v0.1.4.yaml └── tectonic-console-v0.1.5.yaml ├── 2017-keynote ├── app-version.yaml ├── catalog.yaml ├── deployment.yaml └── install-plan.yaml ├── etcd-acl-proxy ├── README.md └── main.go ├── etcd-backup ├── README.md ├── cache.json ├── gpg-batch ├── main.go └── manifest.json ├── etcd-demos ├── README.md ├── confd │ ├── conf.d │ │ └── myconfig.toml │ └── templates │ │ └── myconfig.conf.tmpl └── server.go ├── etcd-tls-2.0 ├── .etcd-ca │ ├── ca.crt │ ├── ca.crt.info │ ├── ca.key │ ├── infra1.host.crt │ ├── infra1.host.csr │ ├── infra1.host.key │ ├── infra2.host.crt │ ├── infra2.host.csr │ ├── infra2.host.key │ ├── infra3.host.crt │ ├── infra3.host.csr │ └── infra3.host.key ├── Procfile ├── README.md ├── ca.crt ├── ca.key ├── ca.tar ├── infra1.crt ├── infra1.key.insecure ├── infra1.tar ├── infra2.crt ├── infra2.key.insecure ├── infra2.tar ├── infra3.crt ├── infra3.key.insecure └── infra3.tar ├── etcd-tls ├── .etcd-ca │ ├── ca.crt │ ├── ca.crt.info │ ├── ca.key │ ├── infra1.host.crt │ ├── infra1.host.csr │ ├── infra1.host.key │ ├── infra2.host.crt │ ├── infra2.host.csr │ ├── infra2.host.key │ ├── infra3.host.crt │ ├── infra3.host.csr │ └── infra3.host.key ├── Procfile ├── ca.crt ├── ca.key ├── ca.tar ├── infra1.crt ├── infra1.key.insecure ├── infra1.tar ├── infra2.crt ├── infra2.key.insecure ├── infra2.tar ├── infra3.crt ├── infra3.key.insecure └── infra3.tar ├── golang-rpc-comparison ├── README.md ├── grpc │ ├── benchmark.go │ └── benchmark_test.go ├── pbpayload │ ├── new.go │ ├── test.pb.go │ └── test.proto ├── restish │ ├── benchmark.go │ └── benchmark_test.go └── run ├── grpc-play ├── README.md ├── certs │ ├── Makefile │ ├── server.key │ └── server.pem ├── grpc-play-client │ └── main.go ├── main.go ├── proto │ ├── Makefile │ ├── service.pb.go │ ├── service.pb.gw.go │ ├── service.proto │ └── service.swagger.json └── proxy │ └── main.go ├── gzip-size-test ├── fixtures │ ├── 1.json │ ├── 10.json │ ├── 100.json │ ├── 101.json │ ├── 102.json │ ├── 103.json │ ├── 104.json │ ├── 105.json │ ├── 106.json │ ├── 107.json │ ├── 108.json │ ├── 109.json │ ├── 11.json │ ├── 110.json │ ├── 111.json │ ├── 112.json │ ├── 113.json │ ├── 114.json │ ├── 115.json │ ├── 116.json │ ├── 117.json │ ├── 118.json │ ├── 119.json │ ├── 12.json │ ├── 120.json │ ├── 121.json │ ├── 122.json │ ├── 123.json │ ├── 124.json │ ├── 125.json │ ├── 126.json │ ├── 127.json │ ├── 128.json │ ├── 129.json │ ├── 13.json │ ├── 130.json │ ├── 131.json │ ├── 132.json │ ├── 133.json │ ├── 134.json │ ├── 135.json │ ├── 136.json │ ├── 137.json │ ├── 138.json │ ├── 139.json │ ├── 14.json │ ├── 140.json │ ├── 141.json │ ├── 142.json │ ├── 143.json │ ├── 144.json │ ├── 145.json │ ├── 146.json │ ├── 147.json │ ├── 148.json │ ├── 149.json │ ├── 15.json │ ├── 150.json │ ├── 151.json │ ├── 152.json │ ├── 153.json │ ├── 154.json │ ├── 155.json │ ├── 156.json │ ├── 157.json │ ├── 158.json │ ├── 159.json │ ├── 16.json │ ├── 160.json │ ├── 161.json │ ├── 162.json │ ├── 163.json │ ├── 164.json │ ├── 165.json │ ├── 166.json │ ├── 167.json │ ├── 168.json │ ├── 169.json │ ├── 17.json │ ├── 170.json │ ├── 171.json │ ├── 172.json │ ├── 173.json │ ├── 174.json │ ├── 175.json │ ├── 176.json │ ├── 177.json │ ├── 178.json │ ├── 179.json │ ├── 18.json │ ├── 180.json │ ├── 181.json │ ├── 182.json │ ├── 183.json │ ├── 184.json │ ├── 185.json │ ├── 186.json │ ├── 187.json │ ├── 188.json │ ├── 189.json │ ├── 19.json │ ├── 190.json │ ├── 191.json │ ├── 192.json │ ├── 193.json │ ├── 194.json │ ├── 195.json │ ├── 196.json │ ├── 197.json │ ├── 198.json │ ├── 199.json │ ├── 2.json │ ├── 20.json │ ├── 200.json │ ├── 201.json │ ├── 202.json │ ├── 203.json │ ├── 204.json │ ├── 205.json │ ├── 206.json │ ├── 207.json │ ├── 208.json │ ├── 209.json │ ├── 21.json │ ├── 210.json │ ├── 211.json │ ├── 212.json │ ├── 213.json │ ├── 214.json │ ├── 215.json │ ├── 216.json │ ├── 217.json │ ├── 218.json │ ├── 219.json │ ├── 22.json │ ├── 220.json │ ├── 221.json │ ├── 222.json │ ├── 223.json │ ├── 224.json │ ├── 225.json │ ├── 226.json │ ├── 227.json │ ├── 228.json │ ├── 229.json │ ├── 23.json │ ├── 230.json │ ├── 231.json │ ├── 232.json │ ├── 233.json │ ├── 234.json │ ├── 235.json │ ├── 236.json │ ├── 237.json │ ├── 238.json │ ├── 239.json │ ├── 24.json │ ├── 240.json │ ├── 241.json │ ├── 242.json │ ├── 243.json │ ├── 244.json │ ├── 245.json │ ├── 246.json │ ├── 247.json │ ├── 248.json │ ├── 249.json │ ├── 25.json │ ├── 250.json │ ├── 251.json │ ├── 252.json │ ├── 253.json │ ├── 254.json │ ├── 255.json │ ├── 26.json │ ├── 27.json │ ├── 28.json │ ├── 29.json │ ├── 3.json │ ├── 30.json │ ├── 31.json │ ├── 32.json │ ├── 33.json │ ├── 34.json │ ├── 35.json │ ├── 36.json │ ├── 37.json │ ├── 38.json │ ├── 39.json │ ├── 4.json │ ├── 40.json │ ├── 41.json │ ├── 42.json │ ├── 43.json │ ├── 44.json │ ├── 45.json │ ├── 46.json │ ├── 47.json │ ├── 48.json │ ├── 49.json │ ├── 5.json │ ├── 50.json │ ├── 51.json │ ├── 52.json │ ├── 53.json │ ├── 54.json │ ├── 55.json │ ├── 56.json │ ├── 57.json │ ├── 58.json │ ├── 59.json │ ├── 6.json │ ├── 60.json │ ├── 61.json │ ├── 62.json │ ├── 63.json │ ├── 64.json │ ├── 65.json │ ├── 66.json │ ├── 67.json │ ├── 68.json │ ├── 69.json │ ├── 7.json │ ├── 70.json │ ├── 71.json │ ├── 72.json │ ├── 73.json │ ├── 74.json │ ├── 75.json │ ├── 76.json │ ├── 77.json │ ├── 78.json │ ├── 79.json │ ├── 8.json │ ├── 80.json │ ├── 81.json │ ├── 82.json │ ├── 83.json │ ├── 84.json │ ├── 85.json │ ├── 86.json │ ├── 87.json │ ├── 88.json │ ├── 89.json │ ├── 9.json │ ├── 90.json │ ├── 91.json │ ├── 92.json │ ├── 93.json │ ├── 94.json │ ├── 95.json │ ├── 96.json │ ├── 97.json │ ├── 98.json │ └── 99.json └── gzip_comp.go ├── host-info ├── Dockerfile ├── README.md ├── coreos-host-info-hvm.template ├── deploy.yaml ├── glide.lock ├── glide.yaml ├── main.go ├── screenshot.png └── vendor │ └── github.com │ ├── beorn7 │ └── perks │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── histogram │ │ ├── bench_test.go │ │ ├── histogram.go │ │ └── histogram_test.go │ │ ├── quantile │ │ ├── bench_test.go │ │ ├── example_test.go │ │ ├── exampledata.txt │ │ ├── stream.go │ │ └── stream_test.go │ │ └── topk │ │ ├── topk.go │ │ └── topk_test.go │ ├── dchest │ └── siphash │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── hash.go │ │ ├── hash128.go │ │ ├── hash128_amd64.s │ │ ├── hash_amd64.s │ │ ├── hash_asm.go │ │ ├── siphash.go │ │ └── siphash_test.go │ ├── dgryski │ └── go-identicon │ │ ├── README.md │ │ ├── bench_test.go │ │ ├── demo │ │ └── main.go │ │ └── identicon.go │ ├── golang │ └── protobuf │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── Make.protobuf │ │ ├── Makefile │ │ ├── README.md │ │ ├── jsonpb │ │ ├── jsonpb.go │ │ ├── jsonpb_test.go │ │ └── jsonpb_test_proto │ │ │ ├── Makefile │ │ │ ├── more_test_objects.pb.go │ │ │ ├── more_test_objects.proto │ │ │ ├── test_objects.pb.go │ │ │ └── test_objects.proto │ │ ├── proto │ │ ├── Makefile │ │ ├── all_test.go │ │ ├── any_test.go │ │ ├── clone.go │ │ ├── clone_test.go │ │ ├── decode.go │ │ ├── encode.go │ │ ├── equal.go │ │ ├── equal_test.go │ │ ├── extensions.go │ │ ├── extensions_test.go │ │ ├── lib.go │ │ ├── message_set.go │ │ ├── message_set_test.go │ │ ├── pointer_reflect.go │ │ ├── pointer_unsafe.go │ │ ├── properties.go │ │ ├── proto3_proto │ │ │ ├── proto3.pb.go │ │ │ └── proto3.proto │ │ ├── proto3_test.go │ │ ├── size2_test.go │ │ ├── size_test.go │ │ ├── testdata │ │ │ ├── Makefile │ │ │ ├── golden_test.go │ │ │ ├── test.pb.go │ │ │ └── test.proto │ │ ├── text.go │ │ ├── text_parser.go │ │ ├── text_parser_test.go │ │ └── text_test.go │ │ ├── protoc-gen-go │ │ ├── Makefile │ │ ├── descriptor │ │ │ ├── Makefile │ │ │ └── descriptor.pb.go │ │ ├── doc.go │ │ ├── generator │ │ │ ├── Makefile │ │ │ ├── generator.go │ │ │ └── name_test.go │ │ ├── grpc │ │ │ └── grpc.go │ │ ├── link_grpc.go │ │ ├── main.go │ │ ├── plugin │ │ │ ├── Makefile │ │ │ ├── plugin.pb.go │ │ │ └── plugin.pb.golden │ │ └── testdata │ │ │ ├── Makefile │ │ │ ├── extension_base.proto │ │ │ ├── extension_extra.proto │ │ │ ├── extension_test.go │ │ │ ├── extension_user.proto │ │ │ ├── grpc.proto │ │ │ ├── imp.pb.go.golden │ │ │ ├── imp.proto │ │ │ ├── imp2.proto │ │ │ ├── imp3.proto │ │ │ ├── main_test.go │ │ │ ├── multi │ │ │ ├── multi1.proto │ │ │ ├── multi2.proto │ │ │ └── multi3.proto │ │ │ ├── my_test │ │ │ ├── test.pb.go │ │ │ ├── test.pb.go.golden │ │ │ └── test.proto │ │ │ └── proto3.proto │ │ └── ptypes │ │ ├── any.go │ │ ├── any │ │ ├── any.pb.go │ │ └── any.proto │ │ ├── any_test.go │ │ ├── doc.go │ │ ├── duration.go │ │ ├── duration │ │ ├── duration.pb.go │ │ └── duration.proto │ │ ├── duration_test.go │ │ ├── empty │ │ ├── empty.pb.go │ │ └── empty.proto │ │ ├── regen.sh │ │ ├── struct │ │ ├── struct.pb.go │ │ └── struct.proto │ │ ├── timestamp.go │ │ ├── timestamp │ │ ├── timestamp.pb.go │ │ └── timestamp.proto │ │ ├── timestamp_test.go │ │ └── wrappers │ │ ├── wrappers.pb.go │ │ └── wrappers.proto │ ├── matttproud │ └── golang_protobuf_extensions │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile.TRAVIS │ │ ├── NOTICE │ │ ├── README.md │ │ ├── ext │ │ └── moved.go │ │ ├── pbtest │ │ └── deleted.go │ │ ├── pbutil │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── all_test.go │ │ ├── decode.go │ │ ├── decode_test.go │ │ ├── doc.go │ │ ├── encode.go │ │ └── encode_test.go │ │ └── testdata │ │ ├── README.THIRD_PARTY │ │ ├── test.pb.go │ │ └── test.proto │ └── prometheus │ ├── client_golang │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS.md │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── VERSION │ ├── api │ │ └── prometheus │ │ │ ├── api.go │ │ │ └── api_test.go │ ├── examples │ │ ├── random │ │ │ └── main.go │ │ └── simple │ │ │ └── main.go │ └── prometheus │ │ ├── .gitignore │ │ ├── README.md │ │ ├── benchmark_test.go │ │ ├── collector.go │ │ ├── counter.go │ │ ├── counter_test.go │ │ ├── desc.go │ │ ├── doc.go │ │ ├── example_clustermanager_test.go │ │ ├── example_memstats_test.go │ │ ├── example_selfcollector_test.go │ │ ├── examples_test.go │ │ ├── expvar.go │ │ ├── expvar_test.go │ │ ├── fnv.go │ │ ├── gauge.go │ │ ├── gauge_test.go │ │ ├── go_collector.go │ │ ├── go_collector_test.go │ │ ├── histogram.go │ │ ├── histogram_test.go │ │ ├── http.go │ │ ├── http_test.go │ │ ├── metric.go │ │ ├── metric_test.go │ │ ├── process_collector.go │ │ ├── process_collector_test.go │ │ ├── push.go │ │ ├── registry.go │ │ ├── registry_test.go │ │ ├── summary.go │ │ ├── summary_test.go │ │ ├── untyped.go │ │ ├── value.go │ │ ├── vec.go │ │ └── vec_test.go │ ├── client_model │ ├── .gitignore │ ├── AUTHORS.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── NOTICE │ ├── README.md │ ├── cpp │ │ ├── metrics.pb.cc │ │ └── metrics.pb.h │ ├── go │ │ └── metrics.pb.go │ ├── metrics.proto │ ├── pom.xml │ ├── python │ │ └── prometheus │ │ │ ├── __init__.py │ │ │ └── client │ │ │ ├── __init__.py │ │ │ └── model │ │ │ ├── __init__.py │ │ │ └── metrics_pb2.py │ ├── ruby │ │ ├── .gitignore │ │ ├── Gemfile │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── Rakefile │ │ ├── lib │ │ │ └── prometheus │ │ │ │ └── client │ │ │ │ ├── model.rb │ │ │ │ └── model │ │ │ │ ├── metrics.pb.rb │ │ │ │ └── version.rb │ │ └── prometheus-client-model.gemspec │ ├── setup.py │ └── src │ │ └── main │ │ └── java │ │ └── io │ │ └── prometheus │ │ └── client │ │ └── Metrics.java │ ├── common │ ├── .travis.yml │ ├── AUTHORS.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── config │ │ ├── config.go │ │ ├── testdata │ │ │ ├── tls_config.cert_no_key.bad.yml │ │ │ ├── tls_config.empty.good.yml │ │ │ ├── tls_config.insecure.good.yml │ │ │ ├── tls_config.invalid_field.bad.yml │ │ │ └── tls_config.key_no_cert.bad.yml │ │ ├── tls_config.go │ │ └── tls_config_test.go │ ├── expfmt │ │ ├── bench_test.go │ │ ├── decode.go │ │ ├── decode_test.go │ │ ├── encode.go │ │ ├── expfmt.go │ │ ├── fuzz.go │ │ ├── fuzz │ │ │ └── corpus │ │ │ │ ├── from_test_parse_0 │ │ │ │ ├── from_test_parse_1 │ │ │ │ ├── from_test_parse_2 │ │ │ │ ├── from_test_parse_3 │ │ │ │ ├── from_test_parse_4 │ │ │ │ ├── from_test_parse_error_0 │ │ │ │ ├── from_test_parse_error_1 │ │ │ │ ├── from_test_parse_error_10 │ │ │ │ ├── from_test_parse_error_11 │ │ │ │ ├── from_test_parse_error_12 │ │ │ │ ├── from_test_parse_error_13 │ │ │ │ ├── from_test_parse_error_14 │ │ │ │ ├── from_test_parse_error_15 │ │ │ │ ├── from_test_parse_error_16 │ │ │ │ ├── from_test_parse_error_17 │ │ │ │ ├── from_test_parse_error_18 │ │ │ │ ├── from_test_parse_error_19 │ │ │ │ ├── from_test_parse_error_2 │ │ │ │ ├── from_test_parse_error_3 │ │ │ │ ├── from_test_parse_error_4 │ │ │ │ ├── from_test_parse_error_5 │ │ │ │ ├── from_test_parse_error_6 │ │ │ │ ├── from_test_parse_error_7 │ │ │ │ ├── from_test_parse_error_8 │ │ │ │ ├── from_test_parse_error_9 │ │ │ │ └── minimal │ │ ├── testdata │ │ │ ├── json2 │ │ │ ├── json2_bad │ │ │ ├── protobuf │ │ │ ├── protobuf.gz │ │ │ ├── text │ │ │ └── text.gz │ │ ├── text_create.go │ │ ├── text_create_test.go │ │ ├── text_parse.go │ │ └── text_parse_test.go │ ├── internal │ │ └── bitbucket.org │ │ │ └── ww │ │ │ └── goautoneg │ │ │ ├── README.txt │ │ │ ├── autoneg.go │ │ │ └── autoneg_test.go │ ├── log │ │ ├── eventlog_formatter.go │ │ ├── log.go │ │ ├── log_test.go │ │ ├── syslog_formatter.go │ │ └── syslog_formatter_test.go │ ├── model │ │ ├── alert.go │ │ ├── alert_test.go │ │ ├── fingerprinting.go │ │ ├── fnv.go │ │ ├── labels.go │ │ ├── labels_test.go │ │ ├── labelset.go │ │ ├── metric.go │ │ ├── metric_test.go │ │ ├── model.go │ │ ├── signature.go │ │ ├── signature_test.go │ │ ├── silence.go │ │ ├── silence_test.go │ │ ├── time.go │ │ ├── time_test.go │ │ ├── value.go │ │ └── value_test.go │ ├── route │ │ ├── route.go │ │ └── route_test.go │ └── version │ │ └── info.go │ └── procfs │ ├── .travis.yml │ ├── AUTHORS.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── NOTICE │ ├── README.md │ ├── doc.go │ ├── fixtures │ ├── 584 │ │ └── stat │ ├── 26231 │ │ ├── cmdline │ │ ├── comm │ │ ├── exe │ │ ├── fd │ │ │ ├── 0 │ │ │ ├── 1 │ │ │ ├── 2 │ │ │ ├── 3 │ │ │ └── 10 │ │ ├── io │ │ ├── limits │ │ ├── mountstats │ │ └── stat │ ├── 26232 │ │ ├── cmdline │ │ ├── comm │ │ ├── fd │ │ │ ├── 0 │ │ │ ├── 1 │ │ │ ├── 2 │ │ │ ├── 3 │ │ │ └── 4 │ │ ├── limits │ │ └── stat │ ├── mdstat │ ├── net │ │ ├── ip_vs │ │ └── ip_vs_stats │ ├── self │ ├── stat │ └── symlinktargets │ │ ├── README │ │ ├── abc │ │ ├── def │ │ ├── ghi │ │ ├── uvw │ │ └── xyz │ ├── fs.go │ ├── fs_test.go │ ├── ipvs.go │ ├── ipvs_test.go │ ├── mdstat.go │ ├── mdstat_test.go │ ├── mountstats.go │ ├── mountstats_test.go │ ├── proc.go │ ├── proc_io.go │ ├── proc_io_test.go │ ├── proc_limits.go │ ├── proc_limits_test.go │ ├── proc_stat.go │ ├── proc_stat_test.go │ ├── proc_test.go │ ├── stat.go │ └── stat_test.go ├── http-hello └── main.go ├── jwt-auth └── auth_test.go ├── neomatrix-coreos ├── README.md ├── coreos.piko ├── coreos.png ├── coreoslogo │ └── coreoslogo.ino ├── png2rgb.go └── working.png ├── nslookup ├── main.go └── main_test.go ├── pagetoken └── pagetoken.go ├── rkt-k8s ├── README.md ├── example.com │ └── host-info │ │ └── manifest └── www-data │ └── index.html ├── ssh-agent-tool ├── .gitignore ├── README.md └── main.go ├── system-api-tutorial └── README.md ├── timeline ├── .gitignore ├── README.md ├── bower.json ├── bower_components │ └── d3 │ │ ├── .bower.json │ │ ├── .gitattributes │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bower.json │ │ ├── d3.js │ │ ├── d3.min.js │ │ └── package.js ├── lib │ └── d3.v3.min.js ├── package.json ├── rawdata.txt ├── root │ ├── app.js │ ├── d3-timeline.js │ ├── index.html │ ├── jackie.png │ ├── timeline1.png │ ├── timeline2.png │ ├── timeline3.png │ ├── timeline4.png │ ├── timeline5.png │ ├── timeline6.png │ ├── troll.png │ └── wat.png └── serve.go └── whois-exp └── main.go /2015-all-things-open/README.md: -------------------------------------------------------------------------------- 1 | # Slides 2 | 3 | https://speakerdeck.com/philips/coreos-plus-kubernetes-at-linuxcon-europe 4 | 5 | # Setup CoreOS + Kubernetes 6 | 7 | Find the docs and set it up: 8 | 9 | - https://coreos.com 10 | - https://coreos.com/docs/ 11 | - https://coreos.com/kubernetes/docs/latest/ 12 | - https://coreos.com/kubernetes/docs/latest/kubernetes-on-vagrant.html 13 | 14 | 15 | # Run our first service 16 | 17 | Use the right cluster: 18 | 19 | ``` 20 | kubectl config use-context vagrant-single 21 | ``` 22 | 23 | Start it up: 24 | ``` 25 | kubectl run host-info --image=quay.io/philips/host-info 26 | kubectl expose rc host-info --port=80 --target-port=5483 --type=NodePort 27 | kubectl describe service host-info 28 | kubectl get pods 29 | ``` 30 | 31 | 32 | Scale it: 33 | ``` 34 | kubectl scale rc host-info --replicas=2 35 | watch -n 0.2 curl http://172.17.4.99:32688/ 36 | ``` 37 | 38 | Shut it down 39 | 40 | ``` 41 | kubectl stop rc host-info 42 | kubectl stop service host-info 43 | ``` 44 | 45 | # Create a new namespace 46 | 47 | kubectl config use-context vagrant 48 | 49 | kubectl create -f namespace.yaml 50 | 51 | # Run a more complex service 52 | 53 | This is going to setup a three tier app with a load balancer, web app, and database. 54 | 55 | ``` 56 | for i in *.json; do kubectl create --namespace=guestbook -f ${i}; done 57 | ``` 58 | 59 | Visit http://172.17.4.202:30002/ 60 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM google/golang:latest 2 | 3 | ADD . /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/_src 4 | 5 | WORKDIR /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/ 6 | RUN cd _src/ && go get && go build -o ../bin/guestbook 7 | RUN cp _src/guestbook/Dockerfile . 8 | 9 | CMD tar cvzf - . 10 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/guestbook/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox:ubuntu-14.04 2 | 3 | ADD ./bin/guestbook /app/guestbook 4 | ADD ./_src/public/index.html /app/public/index.html 5 | ADD ./_src/public/script.js /app/public/script.js 6 | ADD ./_src/public/style.css /app/public/style.css 7 | 8 | WORKDIR /app 9 | CMD ["./guestbook"] 10 | EXPOSE 3000 11 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Guestbook 9 | 10 | 11 | 14 | 15 |
16 |

Waiting for database connection...

17 |
18 | 19 |
20 |
21 | 22 | Submit 23 |
24 |
25 | 26 |
27 |

28 |

/env 29 | /info

30 |
31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/public/script.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var headerTitleElement = $("#header h1"); 3 | var entriesElement = $("#guestbook-entries"); 4 | var formElement = $("#guestbook-form"); 5 | var submitElement = $("#guestbook-submit"); 6 | var entryContentElement = $("#guestbook-entry-content"); 7 | var hostAddressElement = $("#guestbook-host-address"); 8 | 9 | var appendGuestbookEntries = function(data) { 10 | entriesElement.empty(); 11 | $.each(data, function(key, val) { 12 | entriesElement.append("

" + val + "

"); 13 | }); 14 | } 15 | 16 | var handleSubmission = function(e) { 17 | e.preventDefault(); 18 | var entryValue = entryContentElement.val() 19 | if (entryValue.length > 0) { 20 | entriesElement.append("

...

"); 21 | $.getJSON("rpush/guestbook/" + entryValue, appendGuestbookEntries); 22 | } 23 | return false; 24 | } 25 | 26 | // colors = purple, blue, red, green, yellow 27 | var colors = ["#549", "#18d", "#d31", "#2a4", "#db1"]; 28 | var randomColor = colors[Math.floor(5 * Math.random())]; 29 | (function setElementsColor(color) { 30 | headerTitleElement.css("color", color); 31 | entryContentElement.css("box-shadow", "inset 0 0 0 2px " + color); 32 | submitElement.css("background-color", color); 33 | })(randomColor); 34 | 35 | submitElement.click(handleSubmission); 36 | formElement.submit(handleSubmission); 37 | hostAddressElement.append(document.URL); 38 | 39 | // Poll every second. 40 | (function fetchGuestbook() { 41 | $.getJSON("lrange/guestbook").done(appendGuestbookEntries).always( 42 | function() { 43 | setTimeout(fetchGuestbook, 1000); 44 | }); 45 | })(); 46 | }); 47 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/public/style.css: -------------------------------------------------------------------------------- 1 | body, input { 2 | color: #123; 3 | font-family: "Gill Sans", sans-serif; 4 | } 5 | 6 | div { 7 | overflow: hidden; 8 | padding: 1em 0; 9 | position: relative; 10 | text-align: center; 11 | } 12 | 13 | h1, h2, p, input, a { 14 | font-weight: 300; 15 | margin: 0; 16 | } 17 | 18 | h1 { 19 | color: #BDB76B; 20 | font-size: 3.5em; 21 | } 22 | 23 | h2 { 24 | color: #999; 25 | } 26 | 27 | form { 28 | margin: 0 auto; 29 | max-width: 50em; 30 | text-align: center; 31 | } 32 | 33 | input { 34 | border: 0; 35 | border-radius: 1000px; 36 | box-shadow: inset 0 0 0 2px #BDB76B; 37 | display: inline; 38 | font-size: 1.5em; 39 | margin-bottom: 1em; 40 | outline: none; 41 | padding: .5em 5%; 42 | width: 55%; 43 | } 44 | 45 | form a { 46 | background: #BDB76B; 47 | border: 0; 48 | border-radius: 1000px; 49 | color: #FFF; 50 | font-size: 1.25em; 51 | font-weight: 400; 52 | padding: .75em 2em; 53 | text-decoration: none; 54 | text-transform: uppercase; 55 | white-space: normal; 56 | } 57 | 58 | p { 59 | font-size: 1.5em; 60 | line-height: 1.5; 61 | } 62 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/script/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/build.sh 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker build --rm --force-rm -t kubernetes/guestbook-builder . 25 | docker run --rm kubernetes/guestbook-builder | docker build -t "kubernetes/guestbook:${guestbook_version}" - 26 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/script/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/clean.sh 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker rm -f guestbook-builder 2> /dev/null || true 25 | docker rmi -f kubernetes/guestbook-builder || true 26 | docker rmi -f "kubernetes/guestbook:${guestbook_version}" || true 27 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/script/push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/push.sh [TAG] 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker push "kubernetes/guestbook:${guestbook_version}" 25 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/_src/script/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/release.sh [TAG] 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | base_dir=$(dirname "$0") 24 | base_dir=$(cd "${base_dir}" && pwd) 25 | 26 | guestbook_version=${1:-latest} 27 | 28 | echo " ---> Cleaning up before building..." 29 | "${base_dir}/clean.sh" "${guestbook_version}" 2> /dev/null 30 | 31 | echo " ---> Building..." 32 | "${base_dir}/build.sh" "${guestbook_version}" 33 | 34 | echo " ---> Pushing kubernetes/guestbook:${guestbook_version}..." 35 | "${base_dir}/push.sh" "${guestbook_version}" 36 | 37 | echo " ---> Cleaning up..." 38 | "${base_dir}/clean.sh" "${guestbook_version}" 39 | 40 | echo " ---> Done." 41 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/guestbook-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"guestbook", 6 | "labels":{ 7 | "app":"guestbook" 8 | } 9 | }, 10 | "spec":{ 11 | "replicas":3, 12 | "selector":{ 13 | "app":"guestbook" 14 | }, 15 | "template":{ 16 | "metadata":{ 17 | "labels":{ 18 | "app":"guestbook" 19 | } 20 | }, 21 | "spec":{ 22 | "containers":[ 23 | { 24 | "name":"guestbook", 25 | "image":"kubernetes/guestbook:v2", 26 | "ports":[ 27 | { 28 | "name":"http-server", 29 | "containerPort":3000 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/guestbook-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/2015-all-things-open/guestbook/guestbook-page.png -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/guestbook-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"guestbook", 6 | "labels":{ 7 | "app":"guestbook" 8 | } 9 | }, 10 | "spec":{ 11 | "ports": [ 12 | { 13 | "port":3000, 14 | "nodePort":30002, 15 | "targetPort":"http-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"guestbook" 20 | }, 21 | "type": "LoadBalancer" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/redis-master-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-master", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"master" 9 | } 10 | }, 11 | "spec":{ 12 | "replicas":1, 13 | "selector":{ 14 | "app":"redis", 15 | "role":"master" 16 | }, 17 | "template":{ 18 | "metadata":{ 19 | "labels":{ 20 | "app":"redis", 21 | "role":"master" 22 | } 23 | }, 24 | "spec":{ 25 | "containers":[ 26 | { 27 | "name":"redis-master", 28 | "image":"redis", 29 | "ports":[ 30 | { 31 | "name":"redis-server", 32 | "containerPort":6379 33 | } 34 | ] 35 | } 36 | ] 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/redis-master-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-master", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"master" 9 | } 10 | }, 11 | "spec":{ 12 | "ports": [ 13 | { 14 | "port":6379, 15 | "targetPort":"redis-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"redis", 20 | "role":"master" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/redis-slave-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "id":"redis-slave", 5 | "metadata":{ 6 | "name":"redis-slave", 7 | "labels":{ 8 | "app":"redis", 9 | "role":"slave" 10 | } 11 | }, 12 | "spec":{ 13 | "replicas":2, 14 | "selector":{ 15 | "app":"redis", 16 | "role":"slave" 17 | }, 18 | "template":{ 19 | "metadata":{ 20 | "labels":{ 21 | "app":"redis", 22 | "role":"slave" 23 | } 24 | }, 25 | "spec":{ 26 | "containers":[ 27 | { 28 | "name":"redis-slave", 29 | "image":"kubernetes/redis-slave:v2", 30 | "ports":[ 31 | { 32 | "name":"redis-server", 33 | "containerPort":6379 34 | } 35 | ] 36 | } 37 | ] 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /2015-all-things-open/guestbook/redis-slave-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-slave", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"slave" 9 | } 10 | }, 11 | "spec":{ 12 | "ports": [ 13 | { 14 | "port":6379, 15 | "targetPort":"redis-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"redis", 20 | "role":"slave" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2015-all-things-open/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: "guestbook" 5 | labels: 6 | name: "guestbook" 7 | -------------------------------------------------------------------------------- /2015-dex-golangsf/README.md: -------------------------------------------------------------------------------- 1 | ## Get Dex Running 2 | 3 | ``` 4 | git clone https://github.com/coreos/dex 5 | cd dex 6 | ./build 7 | ./bin/dex-worker --no-db 8 | ``` 9 | 10 | 11 | ``` 12 | curl localhost:5556/.well-known/openid-configuration | python -m json.tool 13 | ``` 14 | 15 | 16 | ## Get App Running 17 | 18 | ``` 19 | ./bin/example-app --cent-id=XXX \ 20 | --client-secret=secrete \ 21 | --discovery=http://127.0.0.1:5556 22 | ``` 23 | 24 | ``` 25 | open http://127.0.0.1:5555 26 | ``` 27 | 28 | 29 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: cfssl ca req clean 2 | 3 | CFSSL = @env PATH=$(GOPATH)/bin:$(PATH) cfssl 4 | JSON = env PATH=$(GOPATH)/bin:$(PATH) cfssljson 5 | 6 | all: ca req 7 | 8 | install-cfssl: 9 | go get -u -tags nopkcs11 github.com/cloudflare/cfssl/cmd/cfssl 10 | go get -u github.com/cloudflare/cfssl/cmd/cfssljson 11 | 12 | ca: 13 | mkdir -p certs 14 | $(CFSSL) gencert -initca config/ca-csr.json | $(JSON) -bare certs/ca 15 | 16 | req: 17 | $(CFSSL) gencert \ 18 | -ca certs/ca.pem \ 19 | -ca-key certs/ca-key.pem \ 20 | -config config/ca-config.json \ 21 | config/req-csr.json | $(JSON) -bare certs/etcd 22 | $(CFSSL) gencert \ 23 | -ca certs/ca.pem \ 24 | -ca-key certs/ca-key.pem \ 25 | -config config/ca-config.json \ 26 | config/req-csr.json | $(JSON) -bare certs/k8s 27 | 28 | clean: 29 | rm -rf certs 30 | 31 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/README.md: -------------------------------------------------------------------------------- 1 | This demonstrates using Cloudflare's [cfssl](https://github.com/cloudflare/cfssl) to easily generate certificates for an etcd cluster. 2 | 3 | Defaults generate an ECDSA-384 root and leaf certificates for `localhost`. etcd nodes will use the same certificates for both sides of mutual authentication, but won't require client certs for non-peer clients. 4 | 5 | **Instructions** 6 | 7 | 1. Install git, go, and make 8 | 2. Run `make install-cfssl` to install cfssl tool 9 | 2. Run `make` to generate the certs 10 | 3. Run `goreman start` 11 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/ca-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MIGkAgEBBDBJvOyBpiil5TyKA7KY7Or5hug9Xw/woe3ve56Ry9yqXlskQe1WCS1r 3 | EppiF7zIrKCgBwYFK4EEACKhZANiAAT7EEzlWekmd9a0JfkS/HlFZwsQti2g7c/c 4 | wrCRsH2xv03pv/v5Fm+CSu7f3f1fyDAPu6RpA6X+1v0DZ6Orrli2WJyXYnkmwTxY 5 | efNcT/e0vU0AGFYuE9ADjslxOmkh2b0= 6 | -----END EC PRIVATE KEY----- 7 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/ca.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBpjCCASwCAQAwgawxCzAJBgNVBAYTAlVTMSowKAYDVQQKEyFIb25lc3QgQWNo 3 | bWVkJ3MgVXNlZCBDZXJ0aWZpY2F0ZXMxKTAnBgNVBAsTIEhhc3RpbHktR2VuZXJh 4 | dGVkIFZhbHVlcyBEaXZpc29uMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYD 5 | VQQIEwpDYWxpZm9ybmlhMRkwFwYDVQQDExBBdXRvZ2VuZXJhdGVkIENBMHYwEAYH 6 | KoZIzj0CAQYFK4EEACIDYgAE+xBM5VnpJnfWtCX5Evx5RWcLELYtoO3P3MKwkbB9 7 | sb9N6b/7+RZvgkru3939X8gwD7ukaQOl/tb9A2ejq65Ytlicl2J5JsE8WHnzXE/3 8 | tL1NABhWLhPQA47JcTppIdm9oAAwCgYIKoZIzj0EAwMDaAAwZQIwPJ+gUQ1BKH8O 9 | IXA+vT5T5DwW2fSeEBUJS4yqL8BGgonnYcgyW202anxnMmW9+TWaAjEAiqNNzoH2 10 | E4J5sG38jcr0wWozl0qCq05JIvvCKHwEHri1rOCnI5TI85AtFs9cP1oV 11 | -----END CERTIFICATE REQUEST----- 12 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/ca.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC8zCCAnmgAwIBAgIII/abESjKcTAwCgYIKoZIzj0EAwMwgawxCzAJBgNVBAYT 3 | AlVTMSowKAYDVQQKEyFIb25lc3QgQWNobWVkJ3MgVXNlZCBDZXJ0aWZpY2F0ZXMx 4 | KTAnBgNVBAsTIEhhc3RpbHktR2VuZXJhdGVkIFZhbHVlcyBEaXZpc29uMRYwFAYD 5 | VQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRkwFwYDVQQD 6 | ExBBdXRvZ2VuZXJhdGVkIENBMB4XDTE1MTExMTA0MzMwMFoXDTIwMTEwOTA0MzMw 7 | MFowgawxCzAJBgNVBAYTAlVTMSowKAYDVQQKEyFIb25lc3QgQWNobWVkJ3MgVXNl 8 | ZCBDZXJ0aWZpY2F0ZXMxKTAnBgNVBAsTIEhhc3RpbHktR2VuZXJhdGVkIFZhbHVl 9 | cyBEaXZpc29uMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxp 10 | Zm9ybmlhMRkwFwYDVQQDExBBdXRvZ2VuZXJhdGVkIENBMHYwEAYHKoZIzj0CAQYF 11 | K4EEACIDYgAE+xBM5VnpJnfWtCX5Evx5RWcLELYtoO3P3MKwkbB9sb9N6b/7+RZv 12 | gkru3939X8gwD7ukaQOl/tb9A2ejq65Ytlicl2J5JsE8WHnzXE/3tL1NABhWLhPQ 13 | A47JcTppIdm9o2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIB 14 | AjAdBgNVHQ4EFgQUYrBfFHoX6NVY2MqeKSy4xzOeaccwHwYDVR0jBBgwFoAUYrBf 15 | FHoX6NVY2MqeKSy4xzOeaccwCgYIKoZIzj0EAwMDaAAwZQIxANZRoGDoA7MSLMMD 16 | lV1bv5d5Gp6voa7vksv4BieNBk+1VKXFif32zAw+UwkPcuXGuAIwAwCe6OQuqq2g 17 | uE/iHgYgKQtHasK6m44GufLlCfoJCoSTwO/qQRYQO1vq+FODLAxE 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/etcd-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MIGkAgEBBDDerWqO6+5Rd6RqAmRz+OmBjoFflaiWymlL4cbNfn4bJv366Xv8VIW6 3 | 9+9d42XdM5igBwYFK4EEACKhZANiAAQ9zPUVLi2o/VFgJH/cBxR2sV/D5sMNWaVU 4 | ONivi3gDzuKOPsuMYkIQHCG1atBxJzzg0qVXY0NI9w7kvxJ1ldDLP0r+5wjhIrk0 5 | OlpoLPwpwFpVSzp4NioYWEhwOTBfZ2E= 6 | -----END EC PRIVATE KEY----- 7 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/etcd.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBdDCB+wIBADBVMRYwFAYDVQQKEw1hdXRvZ2VuZXJhdGVkMRUwEwYDVQQLEwxl 3 | dGNkIGNsdXN0ZXIxFTATBgNVBAcTDHRoZSBpbnRlcm5ldDENMAsGA1UEAxMEZXRj 4 | ZDB2MBAGByqGSM49AgEGBSuBBAAiA2IABD3M9RUuLaj9UWAkf9wHFHaxX8Pmww1Z 5 | pVQ42K+LeAPO4o4+y4xiQhAcIbVq0HEnPODSpVdjQ0j3DuS/EnWV0Ms/Sv7nCOEi 6 | uTQ6Wmgs/CnAWlVLOng2KhhYSHA5MF9nYaAnMCUGCSqGSIb3DQEJDjEYMBYwFAYD 7 | VR0RBA0wC4IJbG9jYWxob3N0MAoGCCqGSM49BAMDA2gAMGUCMHfsizkEwzGu9vst 8 | WoBgmWVCZgo4RjPm4zEGZTPbvMYxR8/XIYm+oGCr8fKHhs7DlwIxAMy9CV3d6dJ9 9 | +it4CY2G5WsbMaHeOfWzpGTIwsa6TdT4MSYd8mTUE85wFKRZxsulzA== 10 | -----END CERTIFICATE REQUEST----- 11 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/etcd.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICyzCCAlKgAwIBAgIIIlLeQXqkzqUwCgYIKoZIzj0EAwMwgawxCzAJBgNVBAYT 3 | AlVTMSowKAYDVQQKEyFIb25lc3QgQWNobWVkJ3MgVXNlZCBDZXJ0aWZpY2F0ZXMx 4 | KTAnBgNVBAsTIEhhc3RpbHktR2VuZXJhdGVkIFZhbHVlcyBEaXZpc29uMRYwFAYD 5 | VQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRkwFwYDVQQD 6 | ExBBdXRvZ2VuZXJhdGVkIENBMB4XDTE1MTExMTA0MzMwMFoXDTE2MTExMDA0MzMw 7 | MFowVTEWMBQGA1UEChMNYXV0b2dlbmVyYXRlZDEVMBMGA1UECxMMZXRjZCBjbHVz 8 | dGVyMRUwEwYDVQQHEwx0aGUgaW50ZXJuZXQxDTALBgNVBAMTBGV0Y2QwdjAQBgcq 9 | hkjOPQIBBgUrgQQAIgNiAAQ9zPUVLi2o/VFgJH/cBxR2sV/D5sMNWaVUONivi3gD 10 | zuKOPsuMYkIQHCG1atBxJzzg0qVXY0NI9w7kvxJ1ldDLP0r+5wjhIrk0OlpoLPwp 11 | wFpVSzp4NioYWEhwOTBfZ2GjgZYwgZMwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQW 12 | MBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBTO 13 | x8w6v+Rphv+1aE2Ak4dgK+jy4TAfBgNVHSMEGDAWgBRisF8Uehfo1VjYyp4pLLjH 14 | M55pxzAUBgNVHREEDTALgglsb2NhbGhvc3QwCgYIKoZIzj0EAwMDZwAwZAIwb2D/ 15 | hHyHWa8klQruK1TRRv9HCW3lZL1tpdo2Wv5zXdwnA7+LhUjdnJjF272VPpSCAjBe 16 | cVeeI46DQx1kXOF/7P8s6d1jZw/xQ3bMvpOJG0vwmqFLy5EvQP6BDNp893WK7zA= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/k8s-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MIGkAgEBBDDHbA01LL2nnBvNJHFY9Iq1NYRDBuNuhrll4qR/Ceb7iDvf5RxqtbcF 3 | BffyNxHAem6gBwYFK4EEACKhZANiAATMv2cx3bkdkee2BrWPAHIs+IlayiJp1Jl7 4 | jb6PBo7Uw2CQCBOmGVOO05YOsE/Xz7kV+8pj+CwE7flf/ppq6SWHxlS8TQD5CohE 5 | S9gcaaUUmkVnJ3tC/zFBdjz+y/9hch0= 6 | -----END EC PRIVATE KEY----- 7 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/k8s.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBdTCB+wIBADBVMRYwFAYDVQQKEw1hdXRvZ2VuZXJhdGVkMRUwEwYDVQQLEwxl 3 | dGNkIGNsdXN0ZXIxFTATBgNVBAcTDHRoZSBpbnRlcm5ldDENMAsGA1UEAxMEZXRj 4 | ZDB2MBAGByqGSM49AgEGBSuBBAAiA2IABMy/ZzHduR2R57YGtY8Aciz4iVrKImnU 5 | mXuNvo8GjtTDYJAIE6YZU47Tlg6wT9fPuRX7ymP4LATt+V/+mmrpJYfGVLxNAPkK 6 | iERL2BxppRSaRWcne0L/MUF2PP7L/2FyHaAnMCUGCSqGSIb3DQEJDjEYMBYwFAYD 7 | VR0RBA0wC4IJbG9jYWxob3N0MAoGCCqGSM49BAMDA2kAMGYCMQCmLjXD6h2nNlzg 8 | Dg0zWnc2ngsY++czjj1KoVFZtzoue9gtcIz/pKiFfECLdOWalacCMQCbrUUyTIvb 9 | JO9ArQi2JBFxb+Fxy48vpO0NGpg+hWmVjjwUjWDH4xcSr5mrEli3X8M= 10 | -----END CERTIFICATE REQUEST----- 11 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/certs/k8s.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICyzCCAlKgAwIBAgIIFZKAGAkUV70wCgYIKoZIzj0EAwMwgawxCzAJBgNVBAYT 3 | AlVTMSowKAYDVQQKEyFIb25lc3QgQWNobWVkJ3MgVXNlZCBDZXJ0aWZpY2F0ZXMx 4 | KTAnBgNVBAsTIEhhc3RpbHktR2VuZXJhdGVkIFZhbHVlcyBEaXZpc29uMRYwFAYD 5 | VQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRkwFwYDVQQD 6 | ExBBdXRvZ2VuZXJhdGVkIENBMB4XDTE1MTExMTA0MzMwMFoXDTE2MTExMDA0MzMw 7 | MFowVTEWMBQGA1UEChMNYXV0b2dlbmVyYXRlZDEVMBMGA1UECxMMZXRjZCBjbHVz 8 | dGVyMRUwEwYDVQQHEwx0aGUgaW50ZXJuZXQxDTALBgNVBAMTBGV0Y2QwdjAQBgcq 9 | hkjOPQIBBgUrgQQAIgNiAATMv2cx3bkdkee2BrWPAHIs+IlayiJp1Jl7jb6PBo7U 10 | w2CQCBOmGVOO05YOsE/Xz7kV+8pj+CwE7flf/ppq6SWHxlS8TQD5CohES9gcaaUU 11 | mkVnJ3tC/zFBdjz+y/9hch2jgZYwgZMwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQW 12 | MBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRE 13 | uqhOAWApQjg1h6lNSQSKZbh8QzAfBgNVHSMEGDAWgBRisF8Uehfo1VjYyp4pLLjH 14 | M55pxzAUBgNVHREEDTALgglsb2NhbGhvc3QwCgYIKoZIzj0EAwMDZwAwZAIwd7QF 15 | uQ/MaFz4a6RD8rhpG+wmJKkESb3PUTbHIKQyi4yC1UuBDM4sCPGclIk8rTdCAjBI 16 | WRFIWiYgAB317MU4fPfewuXthxEORTLLxYKRLZPXH3PDHFBqoFc307U5PbkqP74= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/config/ca-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "8760h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/config/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "Autogenerated CA", 3 | "key": { 4 | "algo": "ecdsa", 5 | "size": 384 6 | }, 7 | "names": [ 8 | { 9 | "O": "Honest Achmed's Used Certificates", 10 | "OU": "Hastily-Generated Values Divison", 11 | "L": "San Francisco", 12 | "ST": "California", 13 | "C": "US" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /2015-kubecon/tls-setup/config/req-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "etcd", 3 | "hosts": [ 4 | "localhost" 5 | ], 6 | "key": { 7 | "algo": "ecdsa", 8 | "size": 384 9 | }, 10 | "names": [ 11 | { 12 | "O": "autogenerated", 13 | "OU": "etcd cluster", 14 | "L": "the internet" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /2015-linuxcon-europe/README.md: -------------------------------------------------------------------------------- 1 | # Slides 2 | 3 | https://speakerdeck.com/philips/coreos-plus-kubernetes-at-linuxcon-europe 4 | 5 | # Setup CoreOS + Kubernetes 6 | 7 | Find the docs and set it up: 8 | 9 | - https://coreos.com 10 | - https://coreos.com/docs/ 11 | - https://coreos.com/kubernetes/docs/latest/ 12 | - https://coreos.com/kubernetes/docs/latest/kubernetes-on-vagrant.html 13 | 14 | 15 | # Run our first service 16 | 17 | ``` 18 | kubectl run host-info --image=quay.io/philips/host-info 19 | kubectl expose rc host-info --port=80 --target-port=5483 --type=NodePort 20 | kubectl describe service host-info 21 | kubectl scale rc host-info --replicas=5 22 | kubectl get pods 23 | kubectl stop host-info 24 | watch -n 0.2 curl http://172.17.4.202:32430/ 25 | ``` 26 | 27 | # Create a new namespace 28 | 29 | kubectl create -f namespace/namespace-guestbook.yaml 30 | 31 | # Run a more complex service 32 | 33 | This is going to setup a three tier app with a load balancer, web app, and database. 34 | 35 | ``` 36 | for i in *.json; do kubectl create --namespace=guestbook -f ${i}; done 37 | ``` 38 | 39 | Visit http://172.17.4.202:30002/ 40 | -------------------------------------------------------------------------------- /2015-twilio/README.md: -------------------------------------------------------------------------------- 1 | # Slides 2 | 3 | https://speakerdeck.com/philips/coreos-plus-kubernetes-at-linuxcon-europe 4 | 5 | # Setup CoreOS + Kubernetes 6 | 7 | Find the docs and set it up: 8 | 9 | - https://coreos.com 10 | - https://coreos.com/docs/ 11 | - https://coreos.com/kubernetes/docs/latest/ 12 | - https://coreos.com/kubernetes/docs/latest/kubernetes-on-vagrant.html 13 | 14 | 15 | # Run our first service 16 | 17 | Use the right cluster: 18 | 19 | ``` 20 | kubectl config use-context vagrant-single 21 | ``` 22 | 23 | Start it up: 24 | ``` 25 | kubectl run host-info --image=quay.io/philips/host-info 26 | kubectl expose rc host-info --port=80 --target-port=5483 --type=NodePort 27 | kubectl describe service host-info 28 | kubectl get pods 29 | ``` 30 | 31 | 32 | Scale it: 33 | ``` 34 | kubectl scale rc host-info --replicas=2 35 | watch -n 0.2 curl http://172.17.4.99:32688/ 36 | ``` 37 | 38 | Shut it down 39 | 40 | ``` 41 | kubectl stop rc host-info 42 | kubectl stop service host-info 43 | ``` 44 | 45 | # Create a new namespace 46 | 47 | kubectl config use-context vagrant 48 | 49 | kubectl create -f namespace.yaml 50 | 51 | # Run a more complex service 52 | 53 | This is going to setup a three tier app with a load balancer, web app, and database. 54 | 55 | ``` 56 | for i in *.json; do kubectl create --namespace=guestbook -f ${i}; done 57 | ``` 58 | 59 | Visit http://172.17.4.202:30002/ 60 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM google/golang:latest 2 | 3 | ADD . /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/_src 4 | 5 | WORKDIR /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/ 6 | RUN cd _src/ && go get && go build -o ../bin/guestbook 7 | RUN cp _src/guestbook/Dockerfile . 8 | 9 | CMD tar cvzf - . 10 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/guestbook/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox:ubuntu-14.04 2 | 3 | ADD ./bin/guestbook /app/guestbook 4 | ADD ./_src/public/index.html /app/public/index.html 5 | ADD ./_src/public/script.js /app/public/script.js 6 | ADD ./_src/public/style.css /app/public/style.css 7 | 8 | WORKDIR /app 9 | CMD ["./guestbook"] 10 | EXPOSE 3000 11 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Guestbook 9 | 10 | 11 | 14 | 15 |
16 |

Waiting for database connection...

17 |
18 | 19 |
20 |
21 | 22 | Submit 23 |
24 |
25 | 26 |
27 |

28 |

/env 29 | /info

30 |
31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/public/script.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var headerTitleElement = $("#header h1"); 3 | var entriesElement = $("#guestbook-entries"); 4 | var formElement = $("#guestbook-form"); 5 | var submitElement = $("#guestbook-submit"); 6 | var entryContentElement = $("#guestbook-entry-content"); 7 | var hostAddressElement = $("#guestbook-host-address"); 8 | 9 | var appendGuestbookEntries = function(data) { 10 | entriesElement.empty(); 11 | $.each(data, function(key, val) { 12 | entriesElement.append("

" + val + "

"); 13 | }); 14 | } 15 | 16 | var handleSubmission = function(e) { 17 | e.preventDefault(); 18 | var entryValue = entryContentElement.val() 19 | if (entryValue.length > 0) { 20 | entriesElement.append("

...

"); 21 | $.getJSON("rpush/guestbook/" + entryValue, appendGuestbookEntries); 22 | } 23 | return false; 24 | } 25 | 26 | // colors = purple, blue, red, green, yellow 27 | var colors = ["#549", "#18d", "#d31", "#2a4", "#db1"]; 28 | var randomColor = colors[Math.floor(5 * Math.random())]; 29 | (function setElementsColor(color) { 30 | headerTitleElement.css("color", color); 31 | entryContentElement.css("box-shadow", "inset 0 0 0 2px " + color); 32 | submitElement.css("background-color", color); 33 | })(randomColor); 34 | 35 | submitElement.click(handleSubmission); 36 | formElement.submit(handleSubmission); 37 | hostAddressElement.append(document.URL); 38 | 39 | // Poll every second. 40 | (function fetchGuestbook() { 41 | $.getJSON("lrange/guestbook").done(appendGuestbookEntries).always( 42 | function() { 43 | setTimeout(fetchGuestbook, 1000); 44 | }); 45 | })(); 46 | }); 47 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/public/style.css: -------------------------------------------------------------------------------- 1 | body, input { 2 | color: #123; 3 | font-family: "Gill Sans", sans-serif; 4 | } 5 | 6 | div { 7 | overflow: hidden; 8 | padding: 1em 0; 9 | position: relative; 10 | text-align: center; 11 | } 12 | 13 | h1, h2, p, input, a { 14 | font-weight: 300; 15 | margin: 0; 16 | } 17 | 18 | h1 { 19 | color: #BDB76B; 20 | font-size: 3.5em; 21 | } 22 | 23 | h2 { 24 | color: #999; 25 | } 26 | 27 | form { 28 | margin: 0 auto; 29 | max-width: 50em; 30 | text-align: center; 31 | } 32 | 33 | input { 34 | border: 0; 35 | border-radius: 1000px; 36 | box-shadow: inset 0 0 0 2px #BDB76B; 37 | display: inline; 38 | font-size: 1.5em; 39 | margin-bottom: 1em; 40 | outline: none; 41 | padding: .5em 5%; 42 | width: 55%; 43 | } 44 | 45 | form a { 46 | background: #BDB76B; 47 | border: 0; 48 | border-radius: 1000px; 49 | color: #FFF; 50 | font-size: 1.25em; 51 | font-weight: 400; 52 | padding: .75em 2em; 53 | text-decoration: none; 54 | text-transform: uppercase; 55 | white-space: normal; 56 | } 57 | 58 | p { 59 | font-size: 1.5em; 60 | line-height: 1.5; 61 | } 62 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/script/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/build.sh 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker build --rm --force-rm -t kubernetes/guestbook-builder . 25 | docker run --rm kubernetes/guestbook-builder | docker build -t "kubernetes/guestbook:${guestbook_version}" - 26 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/script/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/clean.sh 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker rm -f guestbook-builder 2> /dev/null || true 25 | docker rmi -f kubernetes/guestbook-builder || true 26 | docker rmi -f "kubernetes/guestbook:${guestbook_version}" || true 27 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/script/push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/push.sh [TAG] 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker push "kubernetes/guestbook:${guestbook_version}" 25 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/_src/script/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/release.sh [TAG] 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | base_dir=$(dirname "$0") 24 | base_dir=$(cd "${base_dir}" && pwd) 25 | 26 | guestbook_version=${1:-latest} 27 | 28 | echo " ---> Cleaning up before building..." 29 | "${base_dir}/clean.sh" "${guestbook_version}" 2> /dev/null 30 | 31 | echo " ---> Building..." 32 | "${base_dir}/build.sh" "${guestbook_version}" 33 | 34 | echo " ---> Pushing kubernetes/guestbook:${guestbook_version}..." 35 | "${base_dir}/push.sh" "${guestbook_version}" 36 | 37 | echo " ---> Cleaning up..." 38 | "${base_dir}/clean.sh" "${guestbook_version}" 39 | 40 | echo " ---> Done." 41 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/guestbook-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"guestbook", 6 | "labels":{ 7 | "app":"guestbook" 8 | } 9 | }, 10 | "spec":{ 11 | "replicas":3, 12 | "selector":{ 13 | "app":"guestbook" 14 | }, 15 | "template":{ 16 | "metadata":{ 17 | "labels":{ 18 | "app":"guestbook" 19 | } 20 | }, 21 | "spec":{ 22 | "containers":[ 23 | { 24 | "name":"guestbook", 25 | "image":"kubernetes/guestbook:v2", 26 | "ports":[ 27 | { 28 | "name":"http-server", 29 | "containerPort":3000 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/guestbook-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/2015-twilio/guestbook/guestbook-page.png -------------------------------------------------------------------------------- /2015-twilio/guestbook/guestbook-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"guestbook", 6 | "labels":{ 7 | "app":"guestbook" 8 | } 9 | }, 10 | "spec":{ 11 | "ports": [ 12 | { 13 | "port":3000, 14 | "nodePort":30002, 15 | "targetPort":"http-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"guestbook" 20 | }, 21 | "type": "LoadBalancer" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/redis-master-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-master", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"master" 9 | } 10 | }, 11 | "spec":{ 12 | "replicas":1, 13 | "selector":{ 14 | "app":"redis", 15 | "role":"master" 16 | }, 17 | "template":{ 18 | "metadata":{ 19 | "labels":{ 20 | "app":"redis", 21 | "role":"master" 22 | } 23 | }, 24 | "spec":{ 25 | "containers":[ 26 | { 27 | "name":"redis-master", 28 | "image":"redis", 29 | "ports":[ 30 | { 31 | "name":"redis-server", 32 | "containerPort":6379 33 | } 34 | ] 35 | } 36 | ] 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/redis-master-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-master", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"master" 9 | } 10 | }, 11 | "spec":{ 12 | "ports": [ 13 | { 14 | "port":6379, 15 | "targetPort":"redis-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"redis", 20 | "role":"master" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/redis-slave-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-slave", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"slave" 9 | } 10 | }, 11 | "spec":{ 12 | "replicas":2, 13 | "selector":{ 14 | "app":"redis", 15 | "role":"slave" 16 | }, 17 | "template":{ 18 | "metadata":{ 19 | "labels":{ 20 | "app":"redis", 21 | "role":"slave" 22 | } 23 | }, 24 | "spec":{ 25 | "containers":[ 26 | { 27 | "name":"redis-slave", 28 | "image":"kubernetes/redis-slave:v2", 29 | "ports":[ 30 | { 31 | "name":"redis-server", 32 | "containerPort":6379 33 | } 34 | ] 35 | } 36 | ] 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /2015-twilio/guestbook/redis-slave-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-slave", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"slave" 9 | } 10 | }, 11 | "spec":{ 12 | "ports": [ 13 | { 14 | "port":6379, 15 | "targetPort":"redis-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"redis", 20 | "role":"slave" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2015-twilio/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: "guestbook" 5 | labels: 6 | name: "guestbook" 7 | -------------------------------------------------------------------------------- /2016-great-wide-open/README.md: -------------------------------------------------------------------------------- 1 | # Slides 2 | 3 | https://speakerdeck.com/philips/coreos-plus-kubernetes-at-linuxcon-europe 4 | 5 | # Setup CoreOS + Kubernetes 6 | 7 | Find the docs and set it up: 8 | 9 | - https://coreos.com 10 | - https://coreos.com/docs/ 11 | - https://coreos.com/kubernetes/docs/latest/ 12 | - https://coreos.com/kubernetes/docs/latest/kubernetes-on-vagrant.html 13 | 14 | 15 | # Run our first service 16 | 17 | Use the right cluster: 18 | 19 | ``` 20 | kubectl config use-context vagrant-single 21 | ``` 22 | 23 | Start it up: 24 | ``` 25 | kubectl run host-info --image=quay.io/philips/host-info 26 | kubectl expose rc host-info --port=80 --target-port=5483 --type=NodePort 27 | kubectl describe service host-info 28 | kubectl get pods 29 | ``` 30 | 31 | 32 | Scale it: 33 | ``` 34 | kubectl scale rc host-info --replicas=2 35 | watch -n 0.2 curl http://172.17.4.99:32688/ 36 | ``` 37 | 38 | Shut it down 39 | 40 | ``` 41 | kubectl stop rc host-info 42 | kubectl stop service host-info 43 | ``` 44 | 45 | # Create a new namespace 46 | 47 | kubectl config use-context vagrant 48 | 49 | kubectl create -f namespace.yaml 50 | 51 | # Run a more complex service 52 | 53 | This is going to setup a three tier app with a load balancer, web app, and database. 54 | 55 | ``` 56 | for i in *.json; do kubectl create --namespace=guestbook -f ${i}; done 57 | ``` 58 | 59 | Visit http://172.17.4.99:30002/ 60 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM google/golang:latest 2 | 3 | ADD . /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/_src 4 | 5 | WORKDIR /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/ 6 | RUN cd _src/ && go get && go build -o ../bin/guestbook 7 | RUN cp _src/guestbook/Dockerfile . 8 | 9 | CMD tar cvzf - . 10 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/guestbook/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox:ubuntu-14.04 2 | 3 | ADD ./bin/guestbook /app/guestbook 4 | ADD ./_src/public/index.html /app/public/index.html 5 | ADD ./_src/public/script.js /app/public/script.js 6 | ADD ./_src/public/style.css /app/public/style.css 7 | 8 | WORKDIR /app 9 | CMD ["./guestbook"] 10 | EXPOSE 3000 11 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Guestbook 9 | 10 | 11 | 14 | 15 |
16 |

Waiting for database connection...

17 |
18 | 19 |
20 |
21 | 22 | Submit 23 |
24 |
25 | 26 |
27 |

28 |

/env 29 | /info

30 |
31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/public/script.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var headerTitleElement = $("#header h1"); 3 | var entriesElement = $("#guestbook-entries"); 4 | var formElement = $("#guestbook-form"); 5 | var submitElement = $("#guestbook-submit"); 6 | var entryContentElement = $("#guestbook-entry-content"); 7 | var hostAddressElement = $("#guestbook-host-address"); 8 | 9 | var appendGuestbookEntries = function(data) { 10 | entriesElement.empty(); 11 | $.each(data, function(key, val) { 12 | entriesElement.append("

" + val + "

"); 13 | }); 14 | } 15 | 16 | var handleSubmission = function(e) { 17 | e.preventDefault(); 18 | var entryValue = entryContentElement.val() 19 | if (entryValue.length > 0) { 20 | entriesElement.append("

...

"); 21 | $.getJSON("rpush/guestbook/" + entryValue, appendGuestbookEntries); 22 | } 23 | return false; 24 | } 25 | 26 | // colors = purple, blue, red, green, yellow 27 | var colors = ["#549", "#18d", "#d31", "#2a4", "#db1"]; 28 | var randomColor = colors[Math.floor(5 * Math.random())]; 29 | (function setElementsColor(color) { 30 | headerTitleElement.css("color", color); 31 | entryContentElement.css("box-shadow", "inset 0 0 0 2px " + color); 32 | submitElement.css("background-color", color); 33 | })(randomColor); 34 | 35 | submitElement.click(handleSubmission); 36 | formElement.submit(handleSubmission); 37 | hostAddressElement.append(document.URL); 38 | 39 | // Poll every second. 40 | (function fetchGuestbook() { 41 | $.getJSON("lrange/guestbook").done(appendGuestbookEntries).always( 42 | function() { 43 | setTimeout(fetchGuestbook, 1000); 44 | }); 45 | })(); 46 | }); 47 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/public/style.css: -------------------------------------------------------------------------------- 1 | body, input { 2 | color: #123; 3 | font-family: "Gill Sans", sans-serif; 4 | } 5 | 6 | div { 7 | overflow: hidden; 8 | padding: 1em 0; 9 | position: relative; 10 | text-align: center; 11 | } 12 | 13 | h1, h2, p, input, a { 14 | font-weight: 300; 15 | margin: 0; 16 | } 17 | 18 | h1 { 19 | color: #BDB76B; 20 | font-size: 3.5em; 21 | } 22 | 23 | h2 { 24 | color: #999; 25 | } 26 | 27 | form { 28 | margin: 0 auto; 29 | max-width: 50em; 30 | text-align: center; 31 | } 32 | 33 | input { 34 | border: 0; 35 | border-radius: 1000px; 36 | box-shadow: inset 0 0 0 2px #BDB76B; 37 | display: inline; 38 | font-size: 1.5em; 39 | margin-bottom: 1em; 40 | outline: none; 41 | padding: .5em 5%; 42 | width: 55%; 43 | } 44 | 45 | form a { 46 | background: #BDB76B; 47 | border: 0; 48 | border-radius: 1000px; 49 | color: #FFF; 50 | font-size: 1.25em; 51 | font-weight: 400; 52 | padding: .75em 2em; 53 | text-decoration: none; 54 | text-transform: uppercase; 55 | white-space: normal; 56 | } 57 | 58 | p { 59 | font-size: 1.5em; 60 | line-height: 1.5; 61 | } 62 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/script/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/build.sh 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker build --rm --force-rm -t kubernetes/guestbook-builder . 25 | docker run --rm kubernetes/guestbook-builder | docker build -t "kubernetes/guestbook:${guestbook_version}" - 26 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/script/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/clean.sh 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker rm -f guestbook-builder 2> /dev/null || true 25 | docker rmi -f kubernetes/guestbook-builder || true 26 | docker rmi -f "kubernetes/guestbook:${guestbook_version}" || true 27 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/script/push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/push.sh [TAG] 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | guestbook_version=${1:-latest} 24 | docker push "kubernetes/guestbook:${guestbook_version}" 25 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/_src/script/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2014 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: ./script/release.sh [TAG] 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | base_dir=$(dirname "$0") 24 | base_dir=$(cd "${base_dir}" && pwd) 25 | 26 | guestbook_version=${1:-latest} 27 | 28 | echo " ---> Cleaning up before building..." 29 | "${base_dir}/clean.sh" "${guestbook_version}" 2> /dev/null 30 | 31 | echo " ---> Building..." 32 | "${base_dir}/build.sh" "${guestbook_version}" 33 | 34 | echo " ---> Pushing kubernetes/guestbook:${guestbook_version}..." 35 | "${base_dir}/push.sh" "${guestbook_version}" 36 | 37 | echo " ---> Cleaning up..." 38 | "${base_dir}/clean.sh" "${guestbook_version}" 39 | 40 | echo " ---> Done." 41 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/guestbook-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"guestbook", 6 | "labels":{ 7 | "app":"guestbook" 8 | } 9 | }, 10 | "spec":{ 11 | "replicas":3, 12 | "selector":{ 13 | "app":"guestbook" 14 | }, 15 | "template":{ 16 | "metadata":{ 17 | "labels":{ 18 | "app":"guestbook" 19 | } 20 | }, 21 | "spec":{ 22 | "containers":[ 23 | { 24 | "name":"guestbook", 25 | "image":"kubernetes/guestbook:v2", 26 | "ports":[ 27 | { 28 | "name":"http-server", 29 | "containerPort":3000 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/guestbook-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/2016-great-wide-open/guestbook/guestbook-page.png -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/guestbook-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"guestbook", 6 | "labels":{ 7 | "app":"guestbook" 8 | } 9 | }, 10 | "spec":{ 11 | "ports": [ 12 | { 13 | "port":3000, 14 | "nodePort":30002, 15 | "targetPort":"http-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"guestbook" 20 | }, 21 | "type": "LoadBalancer" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/redis-master-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-master", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"master" 9 | } 10 | }, 11 | "spec":{ 12 | "replicas":1, 13 | "selector":{ 14 | "app":"redis", 15 | "role":"master" 16 | }, 17 | "template":{ 18 | "metadata":{ 19 | "labels":{ 20 | "app":"redis", 21 | "role":"master" 22 | } 23 | }, 24 | "spec":{ 25 | "containers":[ 26 | { 27 | "name":"redis-master", 28 | "image":"redis", 29 | "ports":[ 30 | { 31 | "name":"redis-server", 32 | "containerPort":6379 33 | } 34 | ] 35 | } 36 | ] 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/redis-master-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-master", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"master" 9 | } 10 | }, 11 | "spec":{ 12 | "ports": [ 13 | { 14 | "port":6379, 15 | "targetPort":"redis-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"redis", 20 | "role":"master" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/redis-slave-controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"ReplicationController", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-slave", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"slave" 9 | } 10 | }, 11 | "spec":{ 12 | "replicas":2, 13 | "selector":{ 14 | "app":"redis", 15 | "role":"slave" 16 | }, 17 | "template":{ 18 | "metadata":{ 19 | "labels":{ 20 | "app":"redis", 21 | "role":"slave" 22 | } 23 | }, 24 | "spec":{ 25 | "containers":[ 26 | { 27 | "name":"redis-slave", 28 | "image":"kubernetes/redis-slave:v2", 29 | "ports":[ 30 | { 31 | "name":"redis-server", 32 | "containerPort":6379 33 | } 34 | ] 35 | } 36 | ] 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /2016-great-wide-open/guestbook/redis-slave-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"redis-slave", 6 | "labels":{ 7 | "app":"redis", 8 | "role":"slave" 9 | } 10 | }, 11 | "spec":{ 12 | "ports": [ 13 | { 14 | "port":6379, 15 | "targetPort":"redis-server" 16 | } 17 | ], 18 | "selector":{ 19 | "app":"redis", 20 | "role":"slave" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2016-great-wide-open/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: "guestbook" 5 | labels: 6 | name: "guestbook" 7 | -------------------------------------------------------------------------------- /2016-philly-ete/README.md: -------------------------------------------------------------------------------- 1 | ## Tectonic Console Rolling Update 2 | 3 | Create the service 4 | 5 | ``` 6 | kubectl create -f tectonic-console-service.json 7 | ``` 8 | 9 | Deploy the container 10 | 11 | ``` 12 | kubectl create -f tectonic-console-v0.1.4.yaml 13 | ``` 14 | 15 | Checkout the version number 16 | 17 | ``` 18 | while true ; do curl --silent http://172.17.4.99:31190/version | jq .version; sleep 1; done 19 | ``` 20 | 21 | Roll to the new version 22 | 23 | ``` 24 | kubectl rolling-update tectonic-console-v0.1.4 -f tectonic-console-v0.1.5.yaml --update-period=5s 25 | ``` 26 | 27 | 28 | -------------------------------------------------------------------------------- /2016-philly-ete/tectonic-console-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind":"Service", 3 | "apiVersion":"v1", 4 | "metadata":{ 5 | "name":"tectonic-console", 6 | "labels":{ 7 | "tectonic-app":"console" 8 | } 9 | }, 10 | "spec":{ 11 | "ports": [ 12 | { 13 | "port":9000, 14 | "targetPort":9000, 15 | "nodePort": 31190 16 | } 17 | ], 18 | "selector":{ 19 | "tectonic-app":"console" 20 | }, 21 | "type": "NodePort" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2017-keynote/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | items: 3 | - apiVersion: vault.security.coreos.com/v1alpha1 4 | kind: VaultService 5 | metadata: 6 | clusterName: "" 7 | creationTimestamp: 2017-12-01T23:34:32Z 8 | generation: 0 9 | name: example 10 | namespace: default 11 | resourceVersion: "10565469" 12 | selfLink: /apis/vault.security.coreos.com/v1alpha1/namespaces/default/vaultservices/example 13 | uid: 2eef33da-d6f0-11e7-9ca7-06a566138fa2 14 | spec: 15 | TLS: 16 | static: 17 | clientSecret: example-default-vault-client-tls 18 | serverSecret: example-default-vault-server-tls 19 | baseImage: quay.io/coreos/vault 20 | configMapName: "" 21 | nodes: 2 22 | version: 0.8.3-0 23 | status: 24 | activeNode: "" 25 | availableNodes: 26 | - example-2199347398-nnpzb 27 | - example-2199347398-r2hrs 28 | initialized: false 29 | sealedNodes: 30 | - example-2199347398-nnpzb 31 | - example-2199347398-r2hrs 32 | standbyNodes: null 33 | updatedNodes: 34 | - example-2199347398-nnpzb 35 | - example-2199347398-r2hrs 36 | kind: List 37 | metadata: 38 | resourceVersion: "" 39 | selfLink: "" 40 | -------------------------------------------------------------------------------- /etcd-acl-proxy/README.md: -------------------------------------------------------------------------------- 1 | This is a simple proxy that will deny non-GET requests to /v2/keys/read-only 2 | and deny GET requests to /v2/keys/write-only. It uses the new members API 3 | exposed in etcd 0.5.0 so a build of etcd from git is required. 4 | 5 | Examples: 6 | 7 | ``` 8 | philips:874c7de0d742fb9fcfcc/ (master*) $ curl --verbose -X PUT http://localhost:7777/v2/keys/read-only -d value=asdf 9 | * Hostname was NOT found in DNS cache 10 | * Trying 127.0.0.1... 11 | * Connected to localhost (127.0.0.1) port 7777 (#0) 12 | > PUT /v2/keys/read-only HTTP/1.1 13 | > User-Agent: curl/7.37.1 14 | > Host: localhost:7777 15 | > Accept: */* 16 | > Content-Length: 10 17 | > Content-Type: application/x-www-form-urlencoded 18 | > 19 | * upload completely sent off: 10 out of 10 bytes 20 | < HTTP/1.1 501 Not Implemented 21 | < Date: Thu, 30 Oct 2014 00:48:08 GMT 22 | < Content-Length: 0 23 | < Content-Type: text/plain; charset=utf-8 24 | < 25 | * Connection #0 to host localhost left intact 26 | philips:874c7de0d742fb9fcfcc/ (master) $ curl --verbose http://localhost:7777/v2/keys/write-only/asdf 27 | * Hostname was NOT found in DNS cache 28 | * Trying 127.0.0.1... 29 | * Connected to localhost (127.0.0.1) port 7777 (#0) 30 | > GET /v2/keys/write-only/asdf HTTP/1.1 31 | > User-Agent: curl/7.37.1 32 | > Host: localhost:7777 33 | > Accept: */* 34 | > 35 | < HTTP/1.1 501 Not Implemented 36 | < Date: Thu, 30 Oct 2014 00:48:21 GMT 37 | < Content-Length: 0 38 | < Content-Type: text/plain; charset=utf-8 39 | < 40 | * Connection #0 to host localhost left intact 41 | ``` 42 | -------------------------------------------------------------------------------- /etcd-backup/cache.json: -------------------------------------------------------------------------------- 1 | {"AccessToken":"ya29.WAH7whZgD0NCp_7_J3CgxXGsp9Vy_B2olkHnEhtD8B3M-3lEAz0JTUdF4FRenKIxGSLbDwBsHIHo6A","RefreshToken":"1/vsc-ybz4WvTsH4kQttzdNEDPeFw8vLuHHDnaUuhbBnQMEudVrK5jSpoR30zcRFq6","Expiry":"2015-04-17T11:41:47.62235139-07:00","Extra":null} 2 | -------------------------------------------------------------------------------- /etcd-backup/gpg-batch: -------------------------------------------------------------------------------- 1 | %echo Generating a default key 2 | Key-Type: 1 3 | Subkey-Type: 1 4 | Name-Real: Brandon Philips 5 | Name-Comment: ACI signing key 6 | Name-Email: brandon.philips@coreos.com 7 | Expire-Date: 0 8 | Passphrase: rkt 9 | %pubring rkt.pub 10 | %secring rkt.sec 11 | %commit 12 | %echo done 13 | -------------------------------------------------------------------------------- /etcd-backup/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "io/ioutil" 7 | "log" 8 | "net/http" 9 | "os" 10 | "path" 11 | "time" 12 | ) 13 | 14 | func cp(dst, src string) error { 15 | s, err := os.Open(src) 16 | if err != nil { 17 | return err 18 | } 19 | // no need to check errors on read only file, we already got everything 20 | // we need from the filesystem, so nothing can go wrong now. 21 | defer s.Close() 22 | d, err := os.Create(dst) 23 | if err != nil { 24 | return err 25 | } 26 | if _, err := io.Copy(d, s); err != nil { 27 | d.Close() 28 | return err 29 | } 30 | return d.Close() 31 | } 32 | 33 | func main() { 34 | dataDir := os.Args[1] 35 | backupDir := os.Args[2] 36 | 37 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 38 | log.Printf("request from %v\n", r.RemoteAddr) 39 | w.Write([]byte("OK\n")) 40 | }) 41 | go http.ListenAndServe(":5000", nil) 42 | 43 | for { 44 | info, err := ioutil.ReadDir(dataDir) 45 | if err != nil { 46 | fmt.Printf("readdir: %v\n", err) 47 | } 48 | 49 | for _, i := range info { 50 | err = cp(path.Join(backupDir, i.Name()), path.Join(dataDir, i.Name())) 51 | if err != nil { 52 | fmt.Printf("cp %s: %v\n", i.Name(), err) 53 | continue 54 | } 55 | fmt.Printf("cp %s: success\n", i.Name()) 56 | } 57 | 58 | time.Sleep(time.Second) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /etcd-backup/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "acKind": "ImageManifest", 3 | "acVersion": "0.5.1", 4 | "name": "github.com/philips/hacks/etcd-backup", 5 | "labels": [ 6 | { 7 | "name": "version", 8 | "value": "1.0.0" 9 | }, 10 | { 11 | "name": "arch", 12 | "value": "amd64" 13 | }, 14 | { 15 | "name": "os", 16 | "value": "linux" 17 | } 18 | ], 19 | "app": { 20 | "user": "0", 21 | "group": "0", 22 | "exec": [ 23 | "/bin/etcd-backup", 24 | "/data-dir", 25 | "/backup-dir" 26 | ], 27 | "ports": [ 28 | { 29 | "name": "health", 30 | "protocol": "tcp", 31 | "port": 5000 32 | } 33 | ] 34 | }, 35 | "mountPoints": [ 36 | { 37 | "name": "data-dir", 38 | "path": "/data-dir" 39 | }, 40 | { 41 | "name": "backup-dir", 42 | "path": "/backup-dir" 43 | } 44 | ], 45 | "annotations": [ 46 | { 47 | "name": "authors", 48 | "value": "Brandon Philips " 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /etcd-demos/confd/conf.d/myconfig.toml: -------------------------------------------------------------------------------- 1 | [template] 2 | src = "myconfig.conf.tmpl" 3 | dest = "/tmp/myconfig.conf" 4 | keys = [ 5 | "/myapp/database/url", 6 | "/myapp/database/user", 7 | ] 8 | -------------------------------------------------------------------------------- /etcd-demos/confd/templates/myconfig.conf.tmpl: -------------------------------------------------------------------------------- 1 | [myconfig] 2 | database_url = {{getv "/myapp/database/url"}} 3 | database_user = {{getv "/myapp/database/user"}} 4 | -------------------------------------------------------------------------------- /etcd-demos/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func main() { 8 | http.Handle("/", http.FileServer(http.Dir("."))) 9 | http.ListenAndServe(":3000", nil) 10 | } 11 | -------------------------------------------------------------------------------- /etcd-tls-2.0/.etcd-ca/ca.crt.info: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /etcd-tls-2.0/Procfile: -------------------------------------------------------------------------------- 1 | # Use goreman to run `go get github.com/mattn/goreman` 2 | etcd1: bin/etcd -name infra1 -listen-client-urls http://127.0.0.1:4001 -advertise-client-urls http://127.0.0.1:4001 -listen-peer-urls https://127.0.0.1:7001 -initial-advertise-peer-urls https://127.0.0.1:7001 -initial-cluster-token etcd-cluster-1 -initial-cluster 'infra1=https://127.0.0.1:7001,infra2=https://127.0.0.1:7002,infra3=https://127.0.0.1:7003' -initial-cluster-state new --peer-cert-file infra1.crt -peer-key-file infra1.key.insecure -peer-ca-file ca.crt -ca-file ca.crt 3 | etcd2: bin/etcd -name infra2 -listen-client-urls http://127.0.0.1:4002 -advertise-client-urls http://127.0.0.1:4002 -listen-peer-urls https://127.0.0.1:7002 -initial-advertise-peer-urls https://127.0.0.1:7002 -initial-cluster-token etcd-cluster-1 -initial-cluster 'infra1=https://127.0.0.1:7001,infra2=https://127.0.0.1:7002,infra3=https://127.0.0.1:7003' -initial-cluster-state new --peer-cert-file infra2.crt -peer-key-file infra2.key.insecure -peer-ca-file ca.crt -ca-file ca.crt 4 | etcd3: bin/etcd -name infra3 -listen-client-urls http://127.0.0.1:4003 -advertise-client-urls http://127.0.0.1:4003 -listen-peer-urls https://127.0.0.1:7003 -initial-advertise-peer-urls https://127.0.0.1:7003 -initial-cluster-token etcd-cluster-1 -initial-cluster 'infra1=https://127.0.0.1:7001,infra2=https://127.0.0.1:7002,infra3=https://127.0.0.1:7003' -initial-cluster-state new -peer-cert-file infra3.crt -peer-key-file infra3.key.insecure -peer-ca-file ca.crt -ca-file ca.crt 5 | -------------------------------------------------------------------------------- /etcd-tls-2.0/README.md: -------------------------------------------------------------------------------- 1 | Put a etcd 2.0 build into the bin directory. 2 | 3 | Initial setup: 4 | 5 | ``` 6 | etcd-ca init 7 | etcd-ca new-cert --help 8 | etcd-ca new-cert infra2 9 | etcd-ca new-cert infra3 10 | etcd-ca sign infra1 11 | etcd-ca sign infra2 12 | etcd-ca sign infra3 13 | etcd-ca export --insecure infra1 | tar xvf - 14 | etcd-ca export --insecure infra2 | tar xvf - 15 | etcd-ca export --insecure infra3 | tar xvf - 16 | etcd-ca export | tar xzvf - 17 | ``` 18 | -------------------------------------------------------------------------------- /etcd-tls/.etcd-ca/ca.crt.info: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /etcd-tls/Procfile: -------------------------------------------------------------------------------- 1 | # Use goreman to run `go get github.com/mattn/goreman` 2 | etcd1: etcd -name infra1 -listen-client-urls http://127.0.0.1:4001 -advertise-client-urls http://127.0.0.1:4001 -listen-peer-urls https://127.0.0.1:7001 -initial-advertise-peer-urls https://127.0.0.1:7001 -initial-cluster-token etcd-cluster-1 -initial-cluster 'infra1=https://127.0.0.1:7001,infra2=https://127.0.0.1:7002,infra3=https://127.0.0.1:7003' -initial-cluster-state new --peer-cert-file infra1.crt -peer-key-file infra1.key.insecure -peer-trusted-ca-file ca.crt --client-cert-auth 3 | etcd2: etcd -name infra2 -listen-client-urls http://127.0.0.1:4002 -advertise-client-urls http://127.0.0.1:4002 -listen-peer-urls https://127.0.0.1:7002 -initial-advertise-peer-urls https://127.0.0.1:7002 -initial-cluster-token etcd-cluster-1 -initial-cluster 'infra1=https://127.0.0.1:7001,infra2=https://127.0.0.1:7002,infra3=https://127.0.0.1:7003' -initial-cluster-state new --peer-cert-file infra2.crt -peer-key-file infra2.key.insecure -peer-trusted-ca-file ca.crt --client-cert-auth 4 | etcd3: etcd -name infra3 -listen-client-urls http://127.0.0.1:4003 -advertise-client-urls http://127.0.0.1:4003 -listen-peer-urls https://127.0.0.1:7003 -initial-advertise-peer-urls https://127.0.0.1:7003 -initial-cluster-token etcd-cluster-1 -initial-cluster 'infra1=https://127.0.0.1:7001,infra2=https://127.0.0.1:7002,infra3=https://127.0.0.1:7003' -initial-cluster-state new -peer-cert-file infra3.crt -peer-key-file infra3.key.insecure -peer-trusted-ca-file ca.crt --client-cert-auth 5 | -------------------------------------------------------------------------------- /golang-rpc-comparison/README.md: -------------------------------------------------------------------------------- 1 | # Go RPC Comparison 2 | 3 | ## Goal 4 | 5 | The goal of this repository is to compare RPC options for Golang and their ability to be useful. 6 | The metrics used for usefulness include: 7 | 8 | - ease of use in Go 9 | - compatibility with frontend web (XHR/websocket/etc) 10 | - bandwidth 11 | - latency 12 | - memory usage 13 | - language interoperability 14 | - client generation 15 | 16 | Things that won't be covered 17 | 18 | - resiliancy to network partitions and latency 19 | - error handling mechanismsj 20 | 21 | The methods of analysis will be benchmarks, research, and educated guesses. 22 | 23 | ## Options Considered 24 | 25 | Any engineer can do a little Sprintf and Scanf, throw in some sockets and BOOM RPC method; and in fact many people have done just that (myself included). 26 | But, we need to narrow the field and so we will focus on just a handful of options. 27 | 28 | name | transport | encoding 29 | -----------------|-----------|----------- 30 | RESTish | http | json 31 | RESTish+protobuf | http | protobuf 32 | net/rpc | http | gob 33 | net/rpc/jsonrpc | http | json 34 | capnproto | tcp | capnproto 35 | grpc | http2 | protobuf3 36 | 37 | ## RESTish 38 | 39 | 40 | 41 | ## net/rpc 42 | 43 | ## net/rpc/jsonrpc 44 | 45 | ## capnproto 46 | 47 | ## grpc 48 | 49 | Package: google.golang.org/grpc 50 | Version: 0acf7 51 | 52 | 53 | -------------------------------------------------------------------------------- /golang-rpc-comparison/pbpayload/new.go: -------------------------------------------------------------------------------- 1 | package pbpayload 2 | 3 | import ( 4 | "google.golang.org/grpc/grpclog" 5 | ) 6 | 7 | func NewPayload(t PayloadType, size int) *Payload { 8 | if size < 0 { 9 | grpclog.Fatalf("Requested a response with invalid length %d", size) 10 | } 11 | body := make([]byte, size) 12 | switch t { 13 | case PayloadType_COMPRESSABLE: 14 | case PayloadType_UNCOMPRESSABLE: 15 | grpclog.Fatalf("PayloadType UNCOMPRESSABLE is not supported") 16 | default: 17 | grpclog.Fatalf("Unsupported payload type: %d", t) 18 | } 19 | return &Payload{ 20 | Type: t, 21 | Body: body, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /golang-rpc-comparison/restish/benchmark_test.go: -------------------------------------------------------------------------------- 1 | package restish 2 | 3 | import ( 4 | "net/http" 5 | "os" 6 | "sync" 7 | "testing" 8 | "time" 9 | 10 | "google.golang.org/grpc/benchmark/stats" 11 | ) 12 | 13 | func caller(hc testClient) { 14 | DoCall(hc, 1, 1) 15 | } 16 | 17 | func run(b *testing.B, maxConcurrentCalls int) { 18 | s := stats.AddStats(b, 38) 19 | b.StopTimer() 20 | target, stopper := StartServer("localhost:0") 21 | defer stopper() 22 | hc := testClient{target, &http.Client{}} 23 | 24 | // Warm up connection. 25 | for i := 0; i < 10; i++ { 26 | caller(hc) 27 | } 28 | ch := make(chan int, maxConcurrentCalls*4) 29 | var ( 30 | mu sync.Mutex 31 | wg sync.WaitGroup 32 | ) 33 | wg.Add(maxConcurrentCalls) 34 | 35 | // Distribute the b.N calls over maxConcurrentCalls workers. 36 | for i := 0; i < maxConcurrentCalls; i++ { 37 | go func() { 38 | for _ = range ch { 39 | start := time.Now() 40 | caller(hc) 41 | elapse := time.Since(start) 42 | mu.Lock() 43 | s.Add(elapse) 44 | mu.Unlock() 45 | } 46 | wg.Done() 47 | }() 48 | } 49 | b.StartTimer() 50 | for i := 0; i < b.N; i++ { 51 | ch <- i 52 | } 53 | b.StopTimer() 54 | close(ch) 55 | wg.Wait() 56 | } 57 | 58 | func BenchmarkClientc8(b *testing.B) { 59 | run(b, 8) 60 | } 61 | 62 | func BenchmarkClientc64(b *testing.B) { 63 | run(b, 64) 64 | } 65 | 66 | func BenchmarkClient512(b *testing.B) { 67 | run(b, 512) 68 | } 69 | 70 | func TestMain(m *testing.M) { 71 | os.Exit(stats.RunTestMain(m)) 72 | } 73 | -------------------------------------------------------------------------------- /golang-rpc-comparison/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TESTS="restish grpc" 4 | 5 | if [ $# -ne 0 ]; then 6 | TESTS=$@ 7 | fi 8 | 9 | for i in $TESTS; do 10 | go test ./${i}/ -test.bench . -test.benchmem 11 | done 12 | -------------------------------------------------------------------------------- /grpc-play/README.md: -------------------------------------------------------------------------------- 1 | ## gRPC + REST Gateway Play 2 | 3 | This runs a simple gRPC service on port 10000 and a REST interface to this gRPC endpoint on port 8080. 4 | 5 | To try it all out do this: 6 | 7 | ``` 8 | $ go install github.com/philips/hacks/grpc-play/grpc-play-client 9 | $ go install github.com/philips/hacks/grpc-play 10 | 11 | $ grpc-play 12 | $ grpc-play-client "my first rpc echo" 13 | $ curl -X POST -k https://localhost:10000/v1/example/echo -H "Content-Type: text/plain" -d '{"value": "foo"}' 14 | {"value":"my REST echo"} 15 | ``` 16 | 17 | 18 | Huge thanks to the hard work people have put into the [Go gRPC bindings][gogrpc] and [gRPC to JSON Gateway][grpcgateway] 19 | 20 | [gogrpc]: https://github.com/grpc/grpc-go 21 | [grpcgateway]: https://github.com/gengo/grpc-gateway 22 | -------------------------------------------------------------------------------- /grpc-play/certs/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | openssl genrsa -out server.key 2048 3 | openssl req -new -x509 -key server.key -out server.pem -days 3650 4 | 5 | -------------------------------------------------------------------------------- /grpc-play/certs/server.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEBjCCAu6gAwIBAgIJAKaeXTcX/kNiMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV 3 | BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX 4 | aWRnaXRzIFB0eSBMdGQxGDAWBgNVBAMTD2xvY2FsaG9zdDoxMDAwMDAeFw0xNjAy 5 | MTUyMjE3NTlaFw0yNjAyMTIyMjE3NTlaMF8xCzAJBgNVBAYTAkFVMRMwEQYDVQQI 6 | EwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQx 7 | GDAWBgNVBAMTD2xvY2FsaG9zdDoxMDAwMDCCASIwDQYJKoZIhvcNAQEBBQADggEP 8 | ADCCAQoCggEBAOGpCJyHe2je9egag9GqiMUXBolQAwsvz/lOtGDRhNZP5c36JGvl 9 | NeU7I9z90Fhw54cGJPK0Z/F3G60qmtFK3ng+emZUu2lvDjA3zLuHbtbafXQyUGwx 10 | nhUHiZ0Gql2Ub2/WYb1p3l7pCKhtqbk2+HM44hNzbNiwZ+BLTlWI9tq2e2HMYAli 11 | pRN3HeHOGni3LrTIMNqFbAE+5FUR9Wu7MWS8cb+GfDu92N6RfIZ6KKXl6uNXYcKv 12 | /KUX+LGBhlmlFs8mKmk1QgCL0qw3EE0TUX6ItTpQMEH5D7SBEHPqV5q5zl6B6hRk 13 | jNhP5qEYXLGiEzFuyKBQBFxYEy1TciRSg2sCAwEAAaOBxDCBwTAdBgNVHQ4EFgQU 14 | gFVW7OdpoctFELBHiiER39867owwgZEGA1UdIwSBiTCBhoAUgFVW7OdpoctFELBH 15 | iiER39867oyhY6RhMF8xCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRl 16 | MSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxGDAWBgNVBAMTD2xv 17 | Y2FsaG9zdDoxMDAwMIIJAKaeXTcX/kNiMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN 18 | AQEFBQADggEBAIG1Pq8zLTDrgaawXPbpJhs8LybuYppYr51lBR1Jc4mI8XDshE5J 19 | wcpqAhWm3jZMTokDNSA50hMNpUPhUmk8JQIgjz5G9V7ETVWx1QbfdEr6deqOq6o2 20 | itwt5ZmlXC0ZN+zyt0MS7NQnCHM9jpb5MpGCDWUyCdbArNGp+Mj78P+rC6P/i02J 21 | 0RdF6WCe/VyDnw8OgRndQDD4U4jfO2isWN8OnXh8fWAgXJJTtuZLtZPZXAbFtQNn 22 | lzCMcbPnvl2Yj1naUDH7u/A4XYV/1dIetMI8E0Ef8UNwtlEtUW1I9wIrM1/eQ9d5 23 | gyRJacQ9aPzPnC8wdNWeBw/7QNmrZbseRgE= 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /grpc-play/grpc-play-client/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "os" 6 | 7 | pb "github.com/philips/hacks/grpc-play/proto" 8 | "golang.org/x/net/context" 9 | "google.golang.org/grpc" 10 | "google.golang.org/grpc/credentials" 11 | "google.golang.org/grpc/grpclog" 12 | ) 13 | 14 | var ( 15 | tls = flag.Bool("tls", true, "Connection uses TLS if true, else plain TCP") 16 | caFile = flag.String("ca_file", "testdata/ca.pem", "The file containning the CA root cert file") 17 | ) 18 | 19 | func main() { 20 | flag.Parse() 21 | var opts []grpc.DialOption 22 | var creds credentials.TransportAuthenticator 23 | if *caFile != "" { 24 | var err error 25 | creds, err = credentials.NewClientTLSFromFile(*caFile, sn) 26 | if err != nil { 27 | grpclog.Fatalf("Failed to create TLS credentials %v", err) 28 | } 29 | } 30 | opts = append(opts, grpc.WithTransportCredentials(creds)) 31 | conn, err := grpc.Dial(*serverAddr, opts...) 32 | if err != nil { 33 | grpclog.Fatalf("fail to dial: %v", err) 34 | } 35 | defer conn.Close() 36 | client := pb.NewYourServiceClient(conn) 37 | 38 | msg, err := client.Echo(context.Background(), &pb.StringMessage{os.Args[1]}) 39 | println(msg.Value) 40 | } 41 | -------------------------------------------------------------------------------- /grpc-play/proto/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | protoc -I/usr/local/include -I. \ 3 | -I${GOPATH}/src \ 4 | -I${GOPATH}/src/github.com/gengo/grpc-gateway/third_party/googleapis \ 5 | --go_out=Mgoogle/api/annotations.proto=github.com/gengo/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. \ 6 | service.proto 7 | protoc -I/usr/local/include -I. \ 8 | -I${GOPATH}/src \ 9 | -I${GOPATH}/src/github.com/gengo/grpc-gateway/third_party/googleapis \ 10 | --grpc-gateway_out=logtostderr=true:. \ 11 | service.proto 12 | protoc -I/usr/local/include -I. \ 13 | -I${GOPATH}/src \ 14 | -I${GOPATH}/src/github.com/gengo/grpc-gateway/third_party/googleapis \ 15 | --swagger_out=logtostderr=true:. \ 16 | service.proto 17 | -------------------------------------------------------------------------------- /grpc-play/proto/service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package play; 3 | 4 | import "google/api/annotations.proto"; 5 | 6 | message StringMessage { 7 | string value = 1; 8 | } 9 | 10 | service YourService { 11 | rpc Echo(StringMessage) returns (StringMessage) { 12 | option (google.api.http) = { 13 | post: "/v1/example/echo" 14 | body: "*" 15 | }; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /grpc-play/proto/service.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "version": "", 5 | "title": "" 6 | }, 7 | "schemes": [ 8 | "http", 9 | "https" 10 | ], 11 | "consumes": [ 12 | "application/json" 13 | ], 14 | "produces": [ 15 | "application/json" 16 | ], 17 | "paths": { 18 | "/v1/example/echo": { 19 | "post": { 20 | "summary": "YourService.Echo", 21 | "operationId": "Echo", 22 | "responses": { 23 | "default": { 24 | "description": "Description", 25 | "schema": { 26 | "$ref": "#/definitions/playStringMessage" 27 | } 28 | } 29 | }, 30 | "parameters": [ 31 | { 32 | "name": "body", 33 | "in": "body", 34 | "required": true, 35 | "schema": { 36 | "$ref": "#/definitions/playStringMessage" 37 | } 38 | } 39 | ], 40 | "tags": [ 41 | "YourService" 42 | ] 43 | } 44 | } 45 | }, 46 | "definitions": { 47 | "playStringMessage": { 48 | "properties": { 49 | "value": { 50 | "type": "string", 51 | "format": "string" 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /grpc-play/proxy/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "net/http" 6 | 7 | "github.com/gengo/grpc-gateway/runtime" 8 | "github.com/golang/glog" 9 | "golang.org/x/net/context" 10 | 11 | gw "github.com/philips/hacks/grpc-play/gateway" 12 | ) 13 | 14 | var ( 15 | echoEndpoint = flag.String("echo_endpoint", "localhost:10000", "endpoint of YourService") 16 | ) 17 | 18 | func run() error { 19 | ctx := context.Background() 20 | ctx, cancel := context.WithCancel(ctx) 21 | defer cancel() 22 | 23 | mux := runtime.NewServeMux() 24 | err := gw.RegisterYourServiceHandlerFromEndpoint(ctx, mux, *echoEndpoint) 25 | if err != nil { 26 | return err 27 | } 28 | 29 | http.ListenAndServe(":8080", mux) 30 | return nil 31 | } 32 | 33 | func main() { 34 | flag.Parse() 35 | defer glog.Flush() 36 | 37 | if err := run(); err != nil { 38 | glog.Fatal(err) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/1.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/10.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12},{"key":"/services/192-168-1-9.infra.example.com","value":"192.168.1.9:19","modifiedIndex":13,"createdIndex":13},{"key":"/services/192-168-1-10.infra.example.com","value":"192.168.1.10:110","modifiedIndex":14,"createdIndex":14}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/11.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-11.infra.example.com","value":"192.168.1.11:111","modifiedIndex":15,"createdIndex":15},{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12},{"key":"/services/192-168-1-9.infra.example.com","value":"192.168.1.9:19","modifiedIndex":13,"createdIndex":13},{"key":"/services/192-168-1-10.infra.example.com","value":"192.168.1.10:110","modifiedIndex":14,"createdIndex":14}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/12.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-11.infra.example.com","value":"192.168.1.11:111","modifiedIndex":15,"createdIndex":15},{"key":"/services/192-168-1-12.infra.example.com","value":"192.168.1.12:112","modifiedIndex":16,"createdIndex":16},{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12},{"key":"/services/192-168-1-9.infra.example.com","value":"192.168.1.9:19","modifiedIndex":13,"createdIndex":13},{"key":"/services/192-168-1-10.infra.example.com","value":"192.168.1.10:110","modifiedIndex":14,"createdIndex":14}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/13.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12},{"key":"/services/192-168-1-9.infra.example.com","value":"192.168.1.9:19","modifiedIndex":13,"createdIndex":13},{"key":"/services/192-168-1-10.infra.example.com","value":"192.168.1.10:110","modifiedIndex":14,"createdIndex":14},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-11.infra.example.com","value":"192.168.1.11:111","modifiedIndex":15,"createdIndex":15},{"key":"/services/192-168-1-12.infra.example.com","value":"192.168.1.12:112","modifiedIndex":16,"createdIndex":16},{"key":"/services/192-168-1-13.infra.example.com","value":"192.168.1.13:113","modifiedIndex":17,"createdIndex":17}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/14.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-11.infra.example.com","value":"192.168.1.11:111","modifiedIndex":15,"createdIndex":15},{"key":"/services/192-168-1-12.infra.example.com","value":"192.168.1.12:112","modifiedIndex":16,"createdIndex":16},{"key":"/services/192-168-1-14.infra.example.com","value":"192.168.1.14:114","modifiedIndex":18,"createdIndex":18},{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-13.infra.example.com","value":"192.168.1.13:113","modifiedIndex":17,"createdIndex":17},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-9.infra.example.com","value":"192.168.1.9:19","modifiedIndex":13,"createdIndex":13},{"key":"/services/192-168-1-10.infra.example.com","value":"192.168.1.10:110","modifiedIndex":14,"createdIndex":14}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/15.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12},{"key":"/services/192-168-1-15.infra.example.com","value":"192.168.1.15:115","modifiedIndex":19,"createdIndex":19},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-13.infra.example.com","value":"192.168.1.13:113","modifiedIndex":17,"createdIndex":17},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-9.infra.example.com","value":"192.168.1.9:19","modifiedIndex":13,"createdIndex":13},{"key":"/services/192-168-1-10.infra.example.com","value":"192.168.1.10:110","modifiedIndex":14,"createdIndex":14},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-11.infra.example.com","value":"192.168.1.11:111","modifiedIndex":15,"createdIndex":15},{"key":"/services/192-168-1-12.infra.example.com","value":"192.168.1.12:112","modifiedIndex":16,"createdIndex":16},{"key":"/services/192-168-1-14.infra.example.com","value":"192.168.1.14:114","modifiedIndex":18,"createdIndex":18}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/2.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/3.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/4.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/5.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/6.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/7.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/8.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/fixtures/9.json: -------------------------------------------------------------------------------- 1 | {"action":"get","node":{"key":"/services","dir":true,"nodes":[{"key":"/services/192-168-1-1.infra.example.com","value":"192.168.1.1:11","modifiedIndex":5,"createdIndex":5},{"key":"/services/192-168-1-2.infra.example.com","value":"192.168.1.2:12","modifiedIndex":6,"createdIndex":6},{"key":"/services/192-168-1-3.infra.example.com","value":"192.168.1.3:13","modifiedIndex":7,"createdIndex":7},{"key":"/services/192-168-1-5.infra.example.com","value":"192.168.1.5:15","modifiedIndex":9,"createdIndex":9},{"key":"/services/192-168-1-7.infra.example.com","value":"192.168.1.7:17","modifiedIndex":11,"createdIndex":11},{"key":"/services/192-168-1-8.infra.example.com","value":"192.168.1.8:18","modifiedIndex":12,"createdIndex":12},{"key":"/services/192-168-1-9.infra.example.com","value":"192.168.1.9:19","modifiedIndex":13,"createdIndex":13},{"key":"/services/192-168-1-4.infra.example.com","value":"192.168.1.4:14","modifiedIndex":8,"createdIndex":8},{"key":"/services/192-168-1-6.infra.example.com","value":"192.168.1.6:16","modifiedIndex":10,"createdIndex":10}],"modifiedIndex":5,"createdIndex":5}} 2 | -------------------------------------------------------------------------------- /gzip-size-test/gzip_comp.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "compress/gzip" 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | "text/tabwriter" 10 | ) 11 | 12 | func main() { 13 | w := new(tabwriter.Writer) 14 | 15 | // Format in tab-separated columns with a tab stop of 8. 16 | w.Init(os.Stdout, 1, 8, 1, '\t', 0) 17 | fmt.Fprintf(w, "file\timprov\torig siz\tcomp siz\n") 18 | for i := 1; i < 256; i++ { 19 | fname := fmt.Sprintf("%d.json", i) 20 | b, err := ioutil.ReadFile(fmt.Sprintf("fixtures/%s", fname)) 21 | if err != nil { 22 | panic(err) 23 | } 24 | var buf bytes.Buffer 25 | c := gzip.NewWriter(&buf) 26 | c.Write(b) 27 | c.Close() 28 | savings := (float64(len(b)) - float64(buf.Len())) / float64(len(b)) * 100 29 | fmt.Fprintf(w, "%s\t%f\t%d bytes\t%d bytes\n", fname, savings, len(b), buf.Len()) 30 | } 31 | w.Flush() 32 | } 33 | -------------------------------------------------------------------------------- /host-info/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.4.2-onbuild 2 | -------------------------------------------------------------------------------- /host-info/README.md: -------------------------------------------------------------------------------- 1 | ## Simple Host Info 2 | 3 | [![Docker Repository on Quay.io](https://quay.io/repository/philips/host-info/status "Docker Repository on Quay.io")](https://quay.io/repository/philips/host-info) 4 | 5 | 6 | ``` 7 | kubectl run --image=quay.io/philips/host-info:latest host-info 8 | kubectl expose deployment host-info --session-affinity=None --port 8080 9 | ``` 10 | 11 | ``` 12 | kubectl proxy 13 | ``` 14 | 15 | Visit http://localhost:8001/api/v1/proxy/namespaces/default/services/host-info/ 16 | 17 | 18 | ![host-info screenshot](screenshot.png) 19 | -------------------------------------------------------------------------------- /host-info/deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: host-info 5 | labels: 6 | app: host-info 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - name: web 11 | port: 80 12 | protocol: TCP 13 | targetPort: 8080 14 | selector: 15 | app: host-info 16 | --- 17 | apiVersion: monitoring.coreos.com/v1alpha1 18 | kind: Prometheus 19 | metadata: 20 | name: host-info-prometheus 21 | labels: 22 | prometheus: host-info-prometheus 23 | spec: 24 | version: v1.4.0 25 | replicas: 2 26 | serviceMonitorSelector: 27 | matchExpressions: 28 | - {key: app, operator: In, values: [host-info]} 29 | --- 30 | apiVersion: v1 31 | kind: Service 32 | metadata: 33 | name: host-info-prometheus 34 | spec: 35 | type: LoadBalancer 36 | ports: 37 | - name: web 38 | port: 80 39 | protocol: TCP 40 | targetPort: web 41 | selector: 42 | prometheus: host-info-prometheus 43 | --- 44 | apiVersion: "monitoring.coreos.com/v1alpha1" 45 | kind: "ServiceMonitor" 46 | metadata: 47 | name: "host-info" 48 | labels: 49 | app: host-info 50 | spec: 51 | selector: 52 | matchLabels: 53 | app: host-info 54 | endpoints: 55 | - port: web 56 | interval: 1s 57 | -------------------------------------------------------------------------------- /host-info/glide.lock: -------------------------------------------------------------------------------- 1 | hash: 42454349a7cbc4ea5be5c799b687ebc4e45d67787fdf0ff9b6e8d2059bef7bb1 2 | updated: 2017-02-04T03:52:29.964897144+01:00 3 | imports: 4 | - name: github.com/beorn7/perks 5 | version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9 6 | subpackages: 7 | - quantile 8 | - name: github.com/dchest/siphash 9 | version: 8f8998549bb000140299d732e93d79c2d5ddffa7 10 | - name: github.com/dgryski/go-identicon 11 | version: 371855927d74dba898c75122917a0ebe1e146879 12 | - name: github.com/golang/protobuf 13 | version: 8616e8ee5e20a1704615e6c8d7afcdac06087a67 14 | subpackages: 15 | - proto 16 | - name: github.com/matttproud/golang_protobuf_extensions 17 | version: c12348ce28de40eed0136aa2b644d0ee0650e56c 18 | subpackages: 19 | - pbutil 20 | - name: github.com/prometheus/client_golang 21 | version: d38f1ef46f0d78136db3e585f7ebe1bcc3476f73 22 | subpackages: 23 | - prometheus 24 | - name: github.com/prometheus/client_model 25 | version: fa8ad6fec33561be4280a8f0514318c79d7f6cb6 26 | subpackages: 27 | - go 28 | - name: github.com/prometheus/common 29 | version: dd2f054febf4a6c00f2343686efb775948a8bff4 30 | subpackages: 31 | - expfmt 32 | - internal/bitbucket.org/ww/goautoneg 33 | - model 34 | - name: github.com/prometheus/procfs 35 | version: 1878d9fbb537119d24b21ca07effd591627cd160 36 | testImports: [] 37 | -------------------------------------------------------------------------------- /host-info/glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/philips/hacks/host-info 2 | import: 3 | - package: github.com/dchest/siphash 4 | version: 8f8998549bb000140299d732e93d79c2d5ddffa7 5 | - package: github.com/dgryski/go-identicon 6 | version: 371855927d74dba898c75122917a0ebe1e146879 7 | - package: github.com/prometheus/client_golang/prometheus 8 | version: d38f1ef46f0d78136db3e585f7ebe1bcc3476f73 9 | -------------------------------------------------------------------------------- /host-info/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/screenshot.png -------------------------------------------------------------------------------- /host-info/vendor/github.com/beorn7/perks/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | *.prof 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/beorn7/perks/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Blake Mizerany 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/beorn7/perks/histogram/bench_test.go: -------------------------------------------------------------------------------- 1 | package histogram 2 | 3 | import ( 4 | "math/rand" 5 | "testing" 6 | ) 7 | 8 | func BenchmarkInsert10Bins(b *testing.B) { 9 | b.StopTimer() 10 | h := New(10) 11 | b.StartTimer() 12 | for i := 0; i < b.N; i++ { 13 | f := rand.ExpFloat64() 14 | h.Insert(f) 15 | } 16 | } 17 | 18 | func BenchmarkInsert100Bins(b *testing.B) { 19 | b.StopTimer() 20 | h := New(100) 21 | b.StartTimer() 22 | for i := 0; i < b.N; i++ { 23 | f := rand.ExpFloat64() 24 | h.Insert(f) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/beorn7/perks/histogram/histogram_test.go: -------------------------------------------------------------------------------- 1 | package histogram 2 | 3 | import ( 4 | "math/rand" 5 | "testing" 6 | ) 7 | 8 | func TestHistogram(t *testing.T) { 9 | const numPoints = 1e6 10 | const maxBins = 3 11 | 12 | h := New(maxBins) 13 | for i := 0; i < numPoints; i++ { 14 | f := rand.ExpFloat64() 15 | h.Insert(f) 16 | } 17 | 18 | bins := h.Bins() 19 | if g := len(bins); g > maxBins { 20 | t.Fatalf("got %d bins, wanted <= %d", g, maxBins) 21 | } 22 | 23 | for _, b := range bins { 24 | t.Logf("%+v", b) 25 | } 26 | 27 | if g := count(h.Bins()); g != numPoints { 28 | t.Fatalf("binned %d points, wanted %d", g, numPoints) 29 | } 30 | } 31 | 32 | func count(bins Bins) int { 33 | binCounts := 0 34 | for _, b := range bins { 35 | binCounts += b.Count 36 | } 37 | return binCounts 38 | } 39 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/beorn7/perks/quantile/bench_test.go: -------------------------------------------------------------------------------- 1 | package quantile 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func BenchmarkInsertTargeted(b *testing.B) { 8 | b.ReportAllocs() 9 | 10 | s := NewTargeted(Targets) 11 | b.ResetTimer() 12 | for i := float64(0); i < float64(b.N); i++ { 13 | s.Insert(i) 14 | } 15 | } 16 | 17 | func BenchmarkInsertTargetedSmallEpsilon(b *testing.B) { 18 | s := NewTargeted(TargetsSmallEpsilon) 19 | b.ResetTimer() 20 | for i := float64(0); i < float64(b.N); i++ { 21 | s.Insert(i) 22 | } 23 | } 24 | 25 | func BenchmarkInsertBiased(b *testing.B) { 26 | s := NewLowBiased(0.01) 27 | b.ResetTimer() 28 | for i := float64(0); i < float64(b.N); i++ { 29 | s.Insert(i) 30 | } 31 | } 32 | 33 | func BenchmarkInsertBiasedSmallEpsilon(b *testing.B) { 34 | s := NewLowBiased(0.0001) 35 | b.ResetTimer() 36 | for i := float64(0); i < float64(b.N); i++ { 37 | s.Insert(i) 38 | } 39 | } 40 | 41 | func BenchmarkQuery(b *testing.B) { 42 | s := NewTargeted(Targets) 43 | for i := float64(0); i < 1e6; i++ { 44 | s.Insert(i) 45 | } 46 | b.ResetTimer() 47 | n := float64(b.N) 48 | for i := float64(0); i < n; i++ { 49 | s.Query(i / n) 50 | } 51 | } 52 | 53 | func BenchmarkQuerySmallEpsilon(b *testing.B) { 54 | s := NewTargeted(TargetsSmallEpsilon) 55 | for i := float64(0); i < 1e6; i++ { 56 | s.Insert(i) 57 | } 58 | b.ResetTimer() 59 | n := float64(b.N) 60 | for i := float64(0); i < n; i++ { 61 | s.Query(i / n) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/beorn7/perks/topk/topk_test.go: -------------------------------------------------------------------------------- 1 | package topk 2 | 3 | import ( 4 | "fmt" 5 | "math/rand" 6 | "sort" 7 | "testing" 8 | ) 9 | 10 | func TestTopK(t *testing.T) { 11 | stream := New(10) 12 | ss := []*Stream{New(10), New(10), New(10)} 13 | m := make(map[string]int) 14 | for _, s := range ss { 15 | for i := 0; i < 1e6; i++ { 16 | v := fmt.Sprintf("%x", int8(rand.ExpFloat64())) 17 | s.Insert(v) 18 | m[v]++ 19 | } 20 | stream.Merge(s.Query()) 21 | } 22 | 23 | var sm Samples 24 | for x, s := range m { 25 | sm = append(sm, &Element{x, s}) 26 | } 27 | sort.Sort(sort.Reverse(sm)) 28 | 29 | g := stream.Query() 30 | if len(g) != 10 { 31 | t.Fatalf("got %d, want 10", len(g)) 32 | } 33 | for i, e := range g { 34 | if sm[i].Value != e.Value { 35 | t.Errorf("at %d: want %q, got %q", i, sm[i].Value, e.Value) 36 | } 37 | } 38 | } 39 | 40 | func TestQuery(t *testing.T) { 41 | queryTests := []struct { 42 | value string 43 | expected int 44 | }{ 45 | {"a", 1}, 46 | {"b", 2}, 47 | {"c", 2}, 48 | } 49 | 50 | stream := New(2) 51 | for _, tt := range queryTests { 52 | stream.Insert(tt.value) 53 | if n := len(stream.Query()); n != tt.expected { 54 | t.Errorf("want %d, got %d", tt.expected, n) 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/dchest/siphash/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.1 5 | - 1.2 6 | - 1.3 7 | - tip 8 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/dchest/siphash/hash_asm.go: -------------------------------------------------------------------------------- 1 | // +build amd64,!appengine 2 | 3 | // Written in 2012 by Dmitry Chestnykh. 4 | // 5 | // To the extent possible under law, the author have dedicated all copyright 6 | // and related and neighboring rights to this software to the public domain 7 | // worldwide. This software is distributed without any warranty. 8 | // http://creativecommons.org/publicdomain/zero/1.0/ 9 | 10 | // This file contains a function definition for use with assembly implementations of Hash() 11 | 12 | package siphash 13 | 14 | // Hash returns the 64-bit SipHash-2-4 of the given byte slice with two 64-bit 15 | // parts of 128-bit key: k0 and k1. 16 | func Hash(k0, k1 uint64, b []byte) uint64 17 | 18 | // Hash128 returns the 128-bit SipHash-2-4 of the given byte slice with two 19 | // 64-bit parts of 128-bit key: k0 and k1. 20 | func Hash128(k0, k1 uint64, b []byte) (uint64, uint64) 21 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/dgryski/go-identicon/README.md: -------------------------------------------------------------------------------- 1 | ## identicon 2 | 3 | This program implements a simple [identicon](https://en.wikipedia.org/wiki/Identicon) library, similar to [Github's](https://github.com/blog/1586-identicons). 4 | 5 | There is a demo webservice included. Try: 6 | 7 | go run demo/main.go 8 | 9 | and then visit http://localhost:8080/dgryski.png 10 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/dgryski/go-identicon/bench_test.go: -------------------------------------------------------------------------------- 1 | package identicon 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func BenchmarkIdenticon(b *testing.B) { 8 | 9 | for i := 0; i < b.N; i++ { 10 | item := "dgryski" 11 | key := []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} 12 | icon := New7x7(key) 13 | data := []byte(item) 14 | icon.Render(data) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/dgryski/go-identicon/demo/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/dgryski/go-identicon" 5 | "log" 6 | "net/http" 7 | "os" 8 | "strings" 9 | ) 10 | 11 | func handler(w http.ResponseWriter, r *http.Request) { 12 | 13 | args := strings.Split(r.URL.Path, "/") 14 | args = args[1:] 15 | 16 | if len(args) != 1 { 17 | http.Error(w, "", http.StatusBadRequest) 18 | return 19 | } 20 | 21 | item := args[0] 22 | 23 | // support jpg too? 24 | if !strings.HasSuffix(item, ".png") { 25 | http.Error(w, "", http.StatusBadRequest) 26 | return 27 | } 28 | 29 | item = strings.TrimSuffix(item, ".png") 30 | 31 | key := []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} 32 | icon := identicon.New7x7(key) 33 | 34 | log.Printf("creating identicon for '%s'\n", item) 35 | 36 | data := []byte(item) 37 | pngdata := icon.Render(data) 38 | 39 | w.Header().Set("Content-Type", "image/png") 40 | w.Write(pngdata) 41 | 42 | return 43 | } 44 | 45 | func main() { 46 | port := ":8080" 47 | if p := os.Getenv("PORT"); p != "" { 48 | port = ":" + p 49 | } 50 | log.Println("Listening on port", port) 51 | 52 | http.HandleFunc("/", handler) 53 | log.Fatal(http.ListenAndServe(port, nil)) 54 | } 55 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/golang/protobuf/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.[568ao] 3 | *.ao 4 | *.so 5 | *.pyc 6 | ._* 7 | .nfs.* 8 | [568a].out 9 | *~ 10 | *.orig 11 | core 12 | _obj 13 | _test 14 | _testmain.go 15 | protoc-gen-go/testdata/multi/*.pb.go 16 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Go support for Protocol Buffers - Google's data interchange format 2 | 3 | Copyright 2010 The Go Authors. All rights reserved. 4 | https://github.com/golang/protobuf 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following disclaimer 14 | in the documentation and/or other materials provided with the 15 | distribution. 16 | * Neither the name of Google Inc. nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.5 5 | - 1.6 6 | - tip 7 | 8 | script: make -f Makefile.TRAVIS 9 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/Makefile.TRAVIS: -------------------------------------------------------------------------------- 1 | all: build cover test vet 2 | 3 | build: 4 | go build -v ./... 5 | 6 | cover: test 7 | $(MAKE) -C pbutil cover 8 | 9 | test: build 10 | go test -v ./... 11 | 12 | vet: build 13 | go vet -v ./... 14 | 15 | .PHONY: build cover test vet 16 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Matt T. Proud (matt.proud@gmail.com) 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | This repository provides various Protocol Buffer extensions for the Go 3 | language (golang), namely support for record length-delimited message 4 | streaming. 5 | 6 | | Java | Go | 7 | | ------------------------------ | --------------------- | 8 | | MessageLite#parseDelimitedFrom | pbutil.ReadDelimited | 9 | | MessageLite#writeDelimitedTo | pbutil.WriteDelimited | 10 | 11 | Because [Code Review 9102043](https://codereview.appspot.com/9102043/) is 12 | destined to never be merged into mainline (i.e., never be promoted to formal 13 | [goprotobuf features](https://github.com/golang/protobuf)), this repository 14 | will live here in the wild. 15 | 16 | # Documentation 17 | We have [generated Go Doc documentation](http://godoc.org/github.com/matttproud/golang_protobuf_extensions/pbutil) here. 18 | 19 | # Testing 20 | [![Build Status](https://travis-ci.org/matttproud/golang_protobuf_extensions.png?branch=master)](https://travis-ci.org/matttproud/golang_protobuf_extensions) 21 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/ext/moved.go: -------------------------------------------------------------------------------- 1 | // Package ext moved to a new location: github.com/matttproud/golang_protobuf_extensions/pbutil. 2 | package ext 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/pbtest/deleted.go: -------------------------------------------------------------------------------- 1 | // Package pbtest is deleted for the time being, because upstream Protocol Buffer 3 may have rendered quick.Value-based blackbox generation impossible. 2 | package pbtest 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore: -------------------------------------------------------------------------------- 1 | cover.dat 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | 3 | cover: 4 | go test -cover -v -coverprofile=cover.dat ./... 5 | go tool cover -func cover.dat 6 | 7 | .PHONY: cover 8 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Matt T. Proud 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package pbutil provides record length-delimited Protocol Buffer streaming. 16 | package pbutil 17 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/matttproud/golang_protobuf_extensions/testdata/README.THIRD_PARTY: -------------------------------------------------------------------------------- 1 | test.pb.go and test.proto are third-party data. 2 | 3 | SOURCE: https://github.com/golang/protobuf 4 | REVISION: bf531ff1a004f24ee53329dfd5ce0b41bfdc17df 5 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | *~ 25 | *# 26 | .build 27 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | go: 5 | - 1.4 6 | 7 | script: 8 | - go test -short ./... 9 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/AUTHORS.md: -------------------------------------------------------------------------------- 1 | The Prometheus project was started by Matt T. Proud (emeritus) and 2 | Julius Volz in 2012. 3 | 4 | Maintainers of this repository: 5 | 6 | * Björn Rabenstein 7 | 8 | The following individuals have contributed code to this repository 9 | (listed in alphabetical order): 10 | 11 | * Bernerd Schaefer 12 | * Björn Rabenstein 13 | * Daniel Bornkessel 14 | * Jeff Younker 15 | * Julius Volz 16 | * Matt T. Proud 17 | * Tobias Schmidt 18 | 19 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Prometheus uses GitHub to manage reviews of pull requests. 4 | 5 | * If you have a trivial fix or improvement, go ahead and create a pull 6 | request, addressing (with `@...`) one or more of the maintainers 7 | (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request. 8 | 9 | * If you plan to do something more involved, first discuss your ideas 10 | on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 11 | This will avoid unnecessary work and surely give you and us a good deal 12 | of inspiration. 13 | 14 | * Relevant coding style guidelines are the [Go Code Review 15 | Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) 16 | and the _Formatting and style_ section of Peter Bourgon's [Go: Best 17 | Practices for Production 18 | Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). 19 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/NOTICE: -------------------------------------------------------------------------------- 1 | Prometheus instrumentation library for Go applications 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | 7 | 8 | The following components are included in this product: 9 | 10 | goautoneg 11 | http://bitbucket.org/ww/goautoneg 12 | Copyright 2011, Open Knowledge Foundation Ltd. 13 | See README.txt for license details. 14 | 15 | perks - a fork of https://github.com/bmizerany/perks 16 | https://github.com/beorn7/perks 17 | Copyright 2013-2015 Blake Mizerany, Björn Rabenstein 18 | See https://github.com/beorn7/perks/blob/master/README.md for license details. 19 | 20 | Go support for Protocol Buffers - Google's data interchange format 21 | http://github.com/golang/protobuf/ 22 | Copyright 2010 The Go Authors 23 | See source code for license details. 24 | 25 | Support for streaming Protocol Buffer messages for the Go language (golang). 26 | https://github.com/matttproud/golang_protobuf_extensions 27 | Copyright 2013 Matt T. Proud 28 | Licensed under the Apache License, Version 2.0 29 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/VERSION: -------------------------------------------------------------------------------- 1 | 0.7.0 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/examples/simple/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // A minimal example of how to include Prometheus instrumentation. 15 | package main 16 | 17 | import ( 18 | "flag" 19 | "net/http" 20 | 21 | "github.com/prometheus/client_golang/prometheus" 22 | ) 23 | 24 | var addr = flag.String("listen-address", ":8080", "The address to listen on for HTTP requests.") 25 | 26 | func main() { 27 | flag.Parse() 28 | http.Handle("/metrics", prometheus.Handler()) 29 | http.ListenAndServe(*addr, nil) 30 | } 31 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/prometheus/.gitignore: -------------------------------------------------------------------------------- 1 | command-line-arguments.test 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/prometheus/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | This is the [Prometheus](http://www.prometheus.io) telemetric 3 | instrumentation client [Go](http://golang.org) client library. It 4 | enable authors to define process-space metrics for their servers and 5 | expose them through a web service interface for extraction, 6 | aggregation, and a whole slew of other post processing techniques. 7 | 8 | # Installing 9 | $ go get github.com/prometheus/client_golang/prometheus 10 | 11 | # Example 12 | ```go 13 | package main 14 | 15 | import ( 16 | "net/http" 17 | 18 | "github.com/prometheus/client_golang/prometheus" 19 | ) 20 | 21 | var ( 22 | indexed = prometheus.NewCounter(prometheus.CounterOpts{ 23 | Namespace: "my_company", 24 | Subsystem: "indexer", 25 | Name: "documents_indexed", 26 | Help: "The number of documents indexed.", 27 | }) 28 | size = prometheus.NewGauge(prometheus.GaugeOpts{ 29 | Namespace: "my_company", 30 | Subsystem: "storage", 31 | Name: "documents_total_size_bytes", 32 | Help: "The total size of all documents in the storage.", 33 | }) 34 | ) 35 | 36 | func main() { 37 | http.Handle("/metrics", prometheus.Handler()) 38 | 39 | indexed.Inc() 40 | size.Set(5) 41 | 42 | http.ListenAndServe(":8080", nil) 43 | } 44 | 45 | func init() { 46 | prometheus.MustRegister(indexed) 47 | prometheus.MustRegister(size) 48 | } 49 | ``` 50 | 51 | # Documentation 52 | 53 | [![GoDoc](https://godoc.org/github.com/prometheus/client_golang?status.png)](https://godoc.org/github.com/prometheus/client_golang) 54 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/prometheus/fnv.go: -------------------------------------------------------------------------------- 1 | package prometheus 2 | 3 | // Inline and byte-free variant of hash/fnv's fnv64a. 4 | 5 | const ( 6 | offset64 = 14695981039346656037 7 | prime64 = 1099511628211 8 | ) 9 | 10 | // hashNew initializies a new fnv64a hash value. 11 | func hashNew() uint64 { 12 | return offset64 13 | } 14 | 15 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 16 | func hashAdd(h uint64, s string) uint64 { 17 | for i := 0; i < len(s); i++ { 18 | h ^= uint64(s[i]) 19 | h *= prime64 20 | } 21 | return h 22 | } 23 | 24 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 25 | func hashAddByte(h uint64, b byte) uint64 { 26 | h ^= uint64(b) 27 | h *= prime64 28 | return h 29 | } 30 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_golang/prometheus/metric_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package prometheus 15 | 16 | import "testing" 17 | 18 | func TestBuildFQName(t *testing.T) { 19 | scenarios := []struct{ namespace, subsystem, name, result string }{ 20 | {"a", "b", "c", "a_b_c"}, 21 | {"", "b", "c", "b_c"}, 22 | {"a", "", "c", "a_c"}, 23 | {"", "", "c", "c"}, 24 | {"a", "b", "", ""}, 25 | {"a", "", "", ""}, 26 | {"", "b", "", ""}, 27 | {" ", "", "", ""}, 28 | } 29 | 30 | for i, s := range scenarios { 31 | if want, got := s.result, BuildFQName(s.namespace, s.subsystem, s.name); want != got { 32 | t.Errorf("%d. want %s, got %s", i, want, got) 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/AUTHORS.md: -------------------------------------------------------------------------------- 1 | The Prometheus project was started by Matt T. Proud (emeritus) and 2 | Julius Volz in 2012. 3 | 4 | Maintainers of this repository: 5 | 6 | * Björn Rabenstein 7 | 8 | The following individuals have contributed code to this repository 9 | (listed in alphabetical order): 10 | 11 | * Björn Rabenstein 12 | * Matt T. Proud 13 | * Tobias Schmidt 14 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Prometheus uses GitHub to manage reviews of pull requests. 4 | 5 | * If you have a trivial fix or improvement, go ahead and create a pull 6 | request, addressing (with `@...`) one or more of the maintainers 7 | (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request. 8 | 9 | * If you plan to do something more involved, first discuss your ideas 10 | on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 11 | This will avoid unnecessary work and surely give you and us a good deal 12 | of inspiration. 13 | 14 | * Relevant coding style guidelines for the Go parts are the [Go Code Review 15 | Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) 16 | and the _Formatting and style_ section of Peter Bourgon's [Go: Best 17 | Practices for Production 18 | Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). 19 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/NOTICE: -------------------------------------------------------------------------------- 1 | Data model artifacts for Prometheus. 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/README.md: -------------------------------------------------------------------------------- 1 | # Background 2 | Under most circumstances, manually downloading this repository should never 3 | be required. 4 | 5 | # Prerequisites 6 | # Base 7 | * [Google Protocol Buffers](https://developers.google.com/protocol-buffers) 8 | 9 | ## Java 10 | * [Apache Maven](http://maven.apache.org) 11 | * [Prometheus Maven Repository](https://github.com/prometheus/io.prometheus-maven-repository) checked out into ../io.prometheus-maven-repository 12 | 13 | ## Go 14 | * [Go](http://golang.org) 15 | * [goprotobuf](https://code.google.com/p/goprotobuf) 16 | 17 | ## Ruby 18 | * [Ruby](https://www.ruby-lang.org) 19 | * [bundler](https://rubygems.org/gems/bundler) 20 | 21 | # Building 22 | $ make 23 | 24 | # Getting Started 25 | * The Go source code is periodically indexed: [Go Protocol Buffer Model](http://godoc.org/github.com/prometheus/client_model/go). 26 | * All of the core developers are accessible via the [Prometheus Developers Mailinglist](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 27 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/python/prometheus/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Prometheus Team 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/python/prometheus/client/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Prometheus Team 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/python/prometheus/client/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Prometheus Team 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | __all__ = ['metrics_pb2'] 15 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | .bundle 3 | Gemfile.lock 4 | pkg 5 | vendor/bundle 6 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in prometheus-client-model.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/Makefile: -------------------------------------------------------------------------------- 1 | VENDOR_BUNDLE = vendor/bundle 2 | 3 | build: $(VENDOR_BUNDLE)/.bundled 4 | BEEFCAKE_NAMESPACE=Prometheus::Client protoc --beefcake_out lib/prometheus/client/model -I .. ../metrics.proto 5 | 6 | $(VENDOR_BUNDLE): 7 | mkdir -p $@ 8 | 9 | $(VENDOR_BUNDLE)/.bundled: $(VENDOR_BUNDLE) Gemfile 10 | bundle install --quiet --path $< 11 | @touch $@ 12 | 13 | clean: 14 | -rm -f lib/prometheus/client/model/metrics.pb.rb 15 | -rm -rf $(VENDOR_BUNDLE) 16 | 17 | .PHONY: build clean 18 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/README.md: -------------------------------------------------------------------------------- 1 | # Prometheus Ruby client model 2 | 3 | Data model artifacts for the [Prometheus Ruby client][1]. 4 | 5 | ## Installation 6 | 7 | gem install prometheus-client-model 8 | 9 | ## Usage 10 | 11 | Build the artifacts from the protobuf specification: 12 | 13 | make build 14 | 15 | While this Gem's main purpose is to define the Prometheus data types for the 16 | [client][1], it's possible to use it without the client to decode a stream of 17 | delimited protobuf messages: 18 | 19 | ```ruby 20 | require 'open-uri' 21 | require 'prometheus/client/model' 22 | 23 | CONTENT_TYPE = 'application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited' 24 | 25 | stream = open('http://localhost:9090/metrics', 'Accept' => CONTENT_TYPE).read 26 | while family = Prometheus::Client::MetricFamily.read_delimited(stream) 27 | puts family 28 | end 29 | ``` 30 | 31 | [1]: https://github.com/prometheus/client_ruby 32 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/lib/prometheus/client/model.rb: -------------------------------------------------------------------------------- 1 | require 'prometheus/client/model/metrics.pb' 2 | require 'prometheus/client/model/version' 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/lib/prometheus/client/model/version.rb: -------------------------------------------------------------------------------- 1 | module Prometheus 2 | module Client 3 | module Model 4 | VERSION = '0.1.0' 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/ruby/prometheus-client-model.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'prometheus/client/model/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = 'prometheus-client-model' 8 | spec.version = Prometheus::Client::Model::VERSION 9 | spec.authors = ['Tobias Schmidt'] 10 | spec.email = ['tobidt@gmail.com'] 11 | spec.summary = 'Data model artifacts for the Prometheus Ruby client' 12 | spec.homepage = 'https://github.com/prometheus/client_model/tree/master/ruby' 13 | spec.license = 'Apache 2.0' 14 | 15 | spec.files = %w[README.md LICENSE] + Dir.glob('{lib/**/*}') 16 | spec.require_paths = ['lib'] 17 | 18 | spec.add_dependency 'beefcake', '>= 0.4.0' 19 | 20 | spec.add_development_dependency 'bundler', '~> 1.3' 21 | spec.add_development_dependency 'rake' 22 | end 23 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/client_model/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from setuptools import setup 4 | 5 | setup( 6 | name = 'prometheus_client_model', 7 | version = '0.0.1', 8 | author = 'Matt T. Proud', 9 | author_email = 'matt.proud@gmail.com', 10 | description = 'Data model artifacts for the Prometheus client.', 11 | license = 'Apache License 2.0', 12 | url = 'http://github.com/prometheus/client_model', 13 | packages = ['prometheus', 'prometheus/client', 'prometheus/client/model'], 14 | package_dir = {'': 'python'}, 15 | requires = ['protobuf(==2.4.1)'], 16 | platforms = 'Platform Independent', 17 | classifiers = ['Development Status :: 3 - Alpha', 18 | 'Intended Audience :: Developers', 19 | 'Intended Audience :: System Administrators', 20 | 'License :: OSI Approved :: Apache Software License', 21 | 'Operating System :: OS Independent', 22 | 'Topic :: Software Development :: Testing', 23 | 'Topic :: System :: Monitoring']) 24 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | go: 5 | - 1.5.4 6 | - 1.6.2 7 | - tip 8 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/AUTHORS.md: -------------------------------------------------------------------------------- 1 | Maintainers of this repository: 2 | 3 | * Fabian Reinartz 4 | 5 | The following individuals have contributed code to this repository 6 | (listed in alphabetical order): 7 | 8 | * Björn Rabenstein 9 | * Fabian Reinartz 10 | * Julius Volz 11 | * Miguel Molina 12 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Prometheus uses GitHub to manage reviews of pull requests. 4 | 5 | * If you have a trivial fix or improvement, go ahead and create a pull 6 | request, addressing (with `@...`) one or more of the maintainers 7 | (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request. 8 | 9 | * If you plan to do something more involved, first discuss your ideas 10 | on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 11 | This will avoid unnecessary work and surely give you and us a good deal 12 | of inspiration. 13 | 14 | * Relevant coding style guidelines are the [Go Code Review 15 | Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) 16 | and the _Formatting and style_ section of Peter Bourgon's [Go: Best 17 | Practices for Production 18 | Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). 19 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/NOTICE: -------------------------------------------------------------------------------- 1 | Common libraries shared by Prometheus Go components. 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/README.md: -------------------------------------------------------------------------------- 1 | # Common 2 | [![Build Status](https://travis-ci.org/prometheus/common.svg)](https://travis-ci.org/prometheus/common) 3 | 4 | This repository contains Go libraries that are shared across Prometheus 5 | components and libraries. 6 | 7 | * **config**: Common configuration structures 8 | * **expfmt**: Decoding and encoding for the exposition format 9 | * **log**: A logging wrapper around [logrus](https://github.com/Sirupsen/logrus) 10 | * **model**: Shared data structures 11 | * **route**: A routing wrapper around [httprouter](https://github.com/julienschmidt/httprouter) using `context.Context` 12 | * **version**: Version informations and metric 13 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/config/config.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package config 15 | 16 | import ( 17 | "fmt" 18 | "strings" 19 | ) 20 | 21 | func checkOverflow(m map[string]interface{}, ctx string) error { 22 | if len(m) > 0 { 23 | var keys []string 24 | for k := range m { 25 | keys = append(keys, k) 26 | } 27 | return fmt.Errorf("unknown fields in %s: %s", ctx, strings.Join(keys, ", ")) 28 | } 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/config/testdata/tls_config.cert_no_key.bad.yml: -------------------------------------------------------------------------------- 1 | cert_file: somefile 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/config/testdata/tls_config.empty.good.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/common/config/testdata/tls_config.empty.good.yml -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/config/testdata/tls_config.insecure.good.yml: -------------------------------------------------------------------------------- 1 | insecure_skip_verify: true 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/config/testdata/tls_config.invalid_field.bad.yml: -------------------------------------------------------------------------------- 1 | something_invalid: true 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/config/testdata/tls_config.key_no_cert.bad.yml: -------------------------------------------------------------------------------- 1 | key_file: somefile 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/expfmt.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package expfmt contains tools for reading and writing Prometheus metrics. 15 | package expfmt 16 | 17 | // Format specifies the HTTP content type of the different wire protocols. 18 | type Format string 19 | 20 | // Constants to assemble the Content-Type values for the different wire protocols. 21 | const ( 22 | TextVersion = "0.0.4" 23 | ProtoType = `application/vnd.google.protobuf` 24 | ProtoProtocol = `io.prometheus.client.MetricFamily` 25 | ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";" 26 | 27 | // The Content-Type values for the different wire protocols. 28 | FmtUnknown Format = `` 29 | FmtText Format = `text/plain; version=` + TextVersion 30 | FmtProtoDelim Format = ProtoFmt + ` encoding=delimited` 31 | FmtProtoText Format = ProtoFmt + ` encoding=text` 32 | FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text` 33 | ) 34 | 35 | const ( 36 | hdrContentType = "Content-Type" 37 | hdrAccept = "Accept" 38 | ) 39 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Build only when actually fuzzing 15 | // +build gofuzz 16 | 17 | package expfmt 18 | 19 | import "bytes" 20 | 21 | // Fuzz text metric parser with with github.com/dvyukov/go-fuzz: 22 | // 23 | // go-fuzz-build github.com/prometheus/common/expfmt 24 | // go-fuzz -bin expfmt-fuzz.zip -workdir fuzz 25 | // 26 | // Further input samples should go in the folder fuzz/corpus. 27 | func Fuzz(in []byte) int { 28 | parser := TextParser{} 29 | _, err := parser.TextToMetricFamilies(bytes.NewReader(in)) 30 | 31 | if err != nil { 32 | return 0 33 | } 34 | 35 | return 1 36 | } 37 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1: -------------------------------------------------------------------------------- 1 | 2 | minimal_metric 1.234 3 | another_metric -3e3 103948 4 | # Even that: 5 | no_labels{} 3 6 | # HELP line for non-existing metric will be ignored. 7 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2: -------------------------------------------------------------------------------- 1 | 2 | # A normal comment. 3 | # 4 | # TYPE name counter 5 | name{labelname="val1",basename="basevalue"} NaN 6 | name {labelname="val2",basename="base\"v\\al\nue"} 0.23 1234567890 7 | # HELP name two-line\n doc str\\ing 8 | 9 | # HELP name2 doc str"ing 2 10 | # TYPE name2 gauge 11 | name2{labelname="val2" ,basename = "basevalue2" } +Inf 54321 12 | name2{ labelname = "val1" , }-Inf 13 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3: -------------------------------------------------------------------------------- 1 | 2 | # TYPE my_summary summary 3 | my_summary{n1="val1",quantile="0.5"} 110 4 | decoy -1 -2 5 | my_summary{n1="val1",quantile="0.9"} 140 1 6 | my_summary_count{n1="val1"} 42 7 | # Latest timestamp wins in case of a summary. 8 | my_summary_sum{n1="val1"} 4711 2 9 | fake_sum{n1="val1"} 2001 10 | # TYPE another_summary summary 11 | another_summary_count{n2="val2",n1="val1"} 20 12 | my_summary_count{n2="val2",n1="val1"} 5 5 13 | another_summary{n1="val1",n2="val2",quantile=".3"} -1.2 14 | my_summary_sum{n1="val2"} 08 15 15 | my_summary{n1="val3", quantile="0.2"} 4711 16 | my_summary{n1="val1",n2="val2",quantile="-12.34",} NaN 17 | # some 18 | # funny comments 19 | # HELP 20 | # HELP 21 | # HELP my_summary 22 | # HELP my_summary 23 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4: -------------------------------------------------------------------------------- 1 | 2 | # HELP request_duration_microseconds The response latency. 3 | # TYPE request_duration_microseconds histogram 4 | request_duration_microseconds_bucket{le="100"} 123 5 | request_duration_microseconds_bucket{le="120"} 412 6 | request_duration_microseconds_bucket{le="144"} 592 7 | request_duration_microseconds_bucket{le="172.8"} 1524 8 | request_duration_microseconds_bucket{le="+Inf"} 2693 9 | request_duration_microseconds_sum 1.7560473e+06 10 | request_duration_microseconds_count 2693 11 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0: -------------------------------------------------------------------------------- 1 | bla 3.14 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1: -------------------------------------------------------------------------------- 1 | metric{label="\t"} 3.14 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10: -------------------------------------------------------------------------------- 1 | metric{label="bla"} 3.14 2 3 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11: -------------------------------------------------------------------------------- 1 | metric{label="bla"} blubb 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12: -------------------------------------------------------------------------------- 1 | 2 | # HELP metric one 3 | # HELP metric two 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13: -------------------------------------------------------------------------------- 1 | 2 | # TYPE metric counter 3 | # TYPE metric untyped 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14: -------------------------------------------------------------------------------- 1 | 2 | metric 4.12 3 | # TYPE metric counter 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15: -------------------------------------------------------------------------------- 1 | 2 | # TYPE metric bla 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16: -------------------------------------------------------------------------------- 1 | 2 | # TYPE met-ric 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17: -------------------------------------------------------------------------------- 1 | @invalidmetric{label="bla"} 3.14 2 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18: -------------------------------------------------------------------------------- 1 | {label="bla"} 3.14 2 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19: -------------------------------------------------------------------------------- 1 | 2 | # TYPE metric histogram 3 | metric_bucket{le="bla"} 3.14 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2: -------------------------------------------------------------------------------- 1 | 2 | metric{label="new 3 | line"} 3.14 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3: -------------------------------------------------------------------------------- 1 | metric{@="bla"} 3.14 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4: -------------------------------------------------------------------------------- 1 | metric{__name__="bla"} 3.14 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5: -------------------------------------------------------------------------------- 1 | metric{label+="bla"} 3.14 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6: -------------------------------------------------------------------------------- 1 | metric{label=bla} 3.14 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7: -------------------------------------------------------------------------------- 1 | 2 | # TYPE metric summary 3 | metric{quantile="bla"} 3.14 4 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8: -------------------------------------------------------------------------------- 1 | metric{label="bla"+} 3.14 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9: -------------------------------------------------------------------------------- 1 | metric{label="bla"} 3.14 2.72 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/minimal: -------------------------------------------------------------------------------- 1 | m{} 0 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/testdata/json2: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "baseLabels": { 4 | "__name__": "rpc_calls_total", 5 | "job": "batch_job" 6 | }, 7 | "docstring": "RPC calls.", 8 | "metric": { 9 | "type": "counter", 10 | "value": [ 11 | { 12 | "labels": { 13 | "service": "zed" 14 | }, 15 | "value": 25 16 | }, 17 | { 18 | "labels": { 19 | "service": "bar" 20 | }, 21 | "value": 24 22 | } 23 | ] 24 | } 25 | }, 26 | { 27 | "baseLabels": { 28 | "__name__": "rpc_latency_microseconds" 29 | }, 30 | "docstring": "RPC latency.", 31 | "metric": { 32 | "type": "histogram", 33 | "value": [ 34 | { 35 | "labels": { 36 | "service": "foo" 37 | }, 38 | "value": { 39 | "0.010000": 15, 40 | "0.990000": 17 41 | } 42 | } 43 | ] 44 | } 45 | } 46 | ] 47 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/testdata/json2_bad: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "baseLabels": { 4 | "__name__": "rpc_calls_total", 5 | "job": "batch_job" 6 | }, 7 | "docstring": "RPC calls.", 8 | "metric": { 9 | "type": "counter", 10 | "value": [ 11 | { 12 | "labels": { 13 | "servic|e": "zed" 14 | }, 15 | "value": 25 16 | }, 17 | { 18 | "labels": { 19 | "service": "bar" 20 | }, 21 | "value": 24 22 | } 23 | ] 24 | } 25 | }, 26 | { 27 | "baseLabels": { 28 | "__name__": "rpc_latency_microseconds" 29 | }, 30 | "docstring": "RPC latency.", 31 | "metric": { 32 | "type": "histogram", 33 | "value": [ 34 | { 35 | "labels": { 36 | "service": "foo" 37 | }, 38 | "value": { 39 | "0.010000": 15, 40 | "0.990000": 17 41 | } 42 | } 43 | ] 44 | } 45 | } 46 | ] 47 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/testdata/protobuf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/common/expfmt/testdata/protobuf -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/testdata/protobuf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/common/expfmt/testdata/protobuf.gz -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/expfmt/testdata/text.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/common/expfmt/testdata/text.gz -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg_test.go: -------------------------------------------------------------------------------- 1 | package goautoneg 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | var chrome = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" 8 | 9 | func TestParseAccept(t *testing.T) { 10 | alternatives := []string{"text/html", "image/png"} 11 | content_type := Negotiate(chrome, alternatives) 12 | if content_type != "image/png" { 13 | t.Errorf("got %s expected image/png", content_type) 14 | } 15 | 16 | alternatives = []string{"text/html", "text/plain", "text/n3"} 17 | content_type = Negotiate(chrome, alternatives) 18 | if content_type != "text/html" { 19 | t.Errorf("got %s expected text/html", content_type) 20 | } 21 | 22 | alternatives = []string{"text/n3", "text/plain"} 23 | content_type = Negotiate(chrome, alternatives) 24 | if content_type != "text/plain" { 25 | t.Errorf("got %s expected text/plain", content_type) 26 | } 27 | 28 | alternatives = []string{"text/n3", "application/rdf+xml"} 29 | content_type = Negotiate(chrome, alternatives) 30 | if content_type != "text/n3" { 31 | t.Errorf("got %s expected text/n3", content_type) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/log/log_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package log 15 | 16 | import ( 17 | "bytes" 18 | "regexp" 19 | "testing" 20 | 21 | "github.com/Sirupsen/logrus" 22 | ) 23 | 24 | func TestFileLineLogging(t *testing.T) { 25 | var buf bytes.Buffer 26 | origLogger.Out = &buf 27 | origLogger.Formatter = &logrus.TextFormatter{ 28 | DisableColors: true, 29 | } 30 | 31 | // The default logging level should be "info". 32 | Debug("This debug-level line should not show up in the output.") 33 | Infof("This %s-level line should show up in the output.", "info") 34 | 35 | re := `^time=".*" level=info msg="This info-level line should show up in the output." source="log_test.go:33" \n$` 36 | if !regexp.MustCompile(re).Match(buf.Bytes()) { 37 | t.Fatalf("%q did not match expected regex %q", buf.String(), re) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/model/fnv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package model 15 | 16 | // Inline and byte-free variant of hash/fnv's fnv64a. 17 | 18 | const ( 19 | offset64 = 14695981039346656037 20 | prime64 = 1099511628211 21 | ) 22 | 23 | // hashNew initializies a new fnv64a hash value. 24 | func hashNew() uint64 { 25 | return offset64 26 | } 27 | 28 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 29 | func hashAdd(h uint64, s string) uint64 { 30 | for i := 0; i < len(s); i++ { 31 | h ^= uint64(s[i]) 32 | h *= prime64 33 | } 34 | return h 35 | } 36 | 37 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 38 | func hashAddByte(h uint64, b byte) uint64 { 39 | h ^= uint64(b) 40 | h *= prime64 41 | return h 42 | } 43 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/common/model/model.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package model contains common data structures that are shared across 15 | // Prometheus components and libraries. 16 | package model 17 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.6.4 5 | - 1.7.4 6 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/AUTHORS.md: -------------------------------------------------------------------------------- 1 | The Prometheus project was started by Matt T. Proud (emeritus) and 2 | Julius Volz in 2012. 3 | 4 | Maintainers of this repository: 5 | 6 | * Tobias Schmidt 7 | 8 | The following individuals have contributed code to this repository 9 | (listed in alphabetical order): 10 | 11 | * Armen Baghumian 12 | * Bjoern Rabenstein 13 | * David Cournapeau 14 | * Ji-Hoon, Seol 15 | * Jonas Große Sundrup 16 | * Julius Volz 17 | * Matt Layher 18 | * Matthias Rampke 19 | * Nicky Gerritsen 20 | * Rémi Audebert 21 | * Tobias Schmidt 22 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Prometheus uses GitHub to manage reviews of pull requests. 4 | 5 | * If you have a trivial fix or improvement, go ahead and create a pull 6 | request, addressing (with `@...`) one or more of the maintainers 7 | (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request. 8 | 9 | * If you plan to do something more involved, first discuss your ideas 10 | on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 11 | This will avoid unnecessary work and surely give you and us a good deal 12 | of inspiration. 13 | 14 | * Relevant coding style guidelines are the [Go Code Review 15 | Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) 16 | and the _Formatting and style_ section of Peter Bourgon's [Go: Best 17 | Practices for Production 18 | Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). 19 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/Makefile: -------------------------------------------------------------------------------- 1 | ci: 2 | ! gofmt -l *.go | read nothing 3 | go vet 4 | go test -v ./... 5 | go get github.com/golang/lint/golint 6 | golint *.go 7 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/NOTICE: -------------------------------------------------------------------------------- 1 | procfs provides functions to retrieve system, kernel and process 2 | metrics from the pseudo-filesystem proc. 3 | 4 | Copyright 2014-2015 The Prometheus Authors 5 | 6 | This product includes software developed at 7 | SoundCloud Ltd. (http://soundcloud.com/). 8 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/README.md: -------------------------------------------------------------------------------- 1 | # procfs 2 | 3 | This procfs package provides functions to retrieve system, kernel and process 4 | metrics from the pseudo-filesystem proc. 5 | 6 | *WARNING*: This package is a work in progress. Its API may still break in 7 | backwards-incompatible ways without warnings. Use it at your own risk. 8 | 9 | [![GoDoc](https://godoc.org/github.com/prometheus/procfs?status.png)](https://godoc.org/github.com/prometheus/procfs) 10 | [![Build Status](https://travis-ci.org/prometheus/procfs.svg?branch=master)](https://travis-ci.org/prometheus/procfs) 11 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Prometheus Team 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package procfs provides functions to retrieve system, kernel and process 15 | // metrics from the pseudo-filesystem proc. 16 | // 17 | // Example: 18 | // 19 | // package main 20 | // 21 | // import ( 22 | // "fmt" 23 | // "log" 24 | // 25 | // "github.com/prometheus/procfs" 26 | // ) 27 | // 28 | // func main() { 29 | // p, err := procfs.Self() 30 | // if err != nil { 31 | // log.Fatalf("could not get process: %s", err) 32 | // } 33 | // 34 | // stat, err := p.NewStat() 35 | // if err != nil { 36 | // log.Fatalf("could not get process stat: %s", err) 37 | // } 38 | // 39 | // fmt.Printf("command: %s\n", stat.Comm) 40 | // fmt.Printf("cpu time: %fs\n", stat.CPUTime()) 41 | // fmt.Printf("vsize: %dB\n", stat.VirtualMemory()) 42 | // fmt.Printf("rss: %dB\n", stat.ResidentMemory()) 43 | // } 44 | // 45 | package procfs 46 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/cmdline: -------------------------------------------------------------------------------- 1 | vimtest.go+10 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/comm: -------------------------------------------------------------------------------- 1 | vim 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/exe: -------------------------------------------------------------------------------- 1 | /usr/bin/vim -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/fd/0: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/abc -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/fd/1: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/def -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/fd/10: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/xyz -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/fd/2: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/ghi -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/fd/3: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/uvw -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/io: -------------------------------------------------------------------------------- 1 | rchar: 750339 2 | wchar: 818609 3 | syscr: 7405 4 | syscw: 5245 5 | read_bytes: 1024 6 | write_bytes: 2048 7 | cancelled_write_bytes: -1024 8 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/limits: -------------------------------------------------------------------------------- 1 | Limit Soft Limit Hard Limit Units 2 | Max cpu time unlimited unlimited seconds 3 | Max file size unlimited unlimited bytes 4 | Max data size unlimited unlimited bytes 5 | Max stack size 8388608 unlimited bytes 6 | Max core file size 0 unlimited bytes 7 | Max resident set unlimited unlimited bytes 8 | Max processes 62898 62898 processes 9 | Max open files 2048 4096 files 10 | Max locked memory 65536 65536 bytes 11 | Max address space unlimited unlimited bytes 12 | Max file locks unlimited unlimited locks 13 | Max pending signals 62898 62898 signals 14 | Max msgqueue size 819200 819200 bytes 15 | Max nice priority 0 0 16 | Max realtime priority 0 0 17 | Max realtime timeout unlimited unlimited us 18 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/mountstats: -------------------------------------------------------------------------------- 1 | device rootfs mounted on / with fstype rootfs 2 | device sysfs mounted on /sys with fstype sysfs 3 | device proc mounted on /proc with fstype proc 4 | device /dev/sda1 mounted on / with fstype ext4 5 | device 192.168.1.1:/srv/test mounted on /mnt/nfs/test with fstype nfs4 statvers=1.1 6 | opts: rw,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.5,local_lock=none 7 | age: 13968 8 | caps: caps=0xfff7,wtmult=512,dtsize=32768,bsize=0,namlen=255 9 | nfsv4: bm0=0xfdffafff,bm1=0xf9be3e,bm2=0x0,acl=0x0,pnfs=not configured 10 | sec: flavor=1,pseudoflavor=1 11 | events: 52 226 0 0 1 13 398 0 0 331 0 47 0 0 77 0 0 77 0 0 0 0 0 0 0 0 0 12 | bytes: 1207640230 0 0 0 1210214218 0 295483 0 13 | RPC iostats version: 1.0 p/v: 100003/4 (nfs) 14 | xprt: tcp 832 0 1 0 11 6428 6428 0 12154 0 24 26 5726 15 | per-op statistics 16 | NULL: 0 0 0 0 0 0 0 0 17 | READ: 1298 1298 0 207680 1210292152 6 79386 79407 18 | WRITE: 0 0 0 0 0 0 0 0 19 | 20 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26231/stat: -------------------------------------------------------------------------------- 1 | 26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/cmdline: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/procfs/fixtures/26232/cmdline -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/comm: -------------------------------------------------------------------------------- 1 | ata_sff 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/fd/0: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/abc -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/fd/1: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/def -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/fd/2: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/ghi -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/fd/3: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/uvw -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/fd/4: -------------------------------------------------------------------------------- 1 | ../../symlinktargets/xyz -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/limits: -------------------------------------------------------------------------------- 1 | Limit Soft Limit Hard Limit Units 2 | Max cpu time unlimited unlimited seconds 3 | Max file size unlimited unlimited bytes 4 | Max data size unlimited unlimited bytes 5 | Max stack size 8388608 unlimited bytes 6 | Max core file size 0 unlimited bytes 7 | Max resident set unlimited unlimited bytes 8 | Max processes 29436 29436 processes 9 | Max open files 1024 4096 files 10 | Max locked memory 65536 65536 bytes 11 | Max address space unlimited unlimited bytes 12 | Max file locks unlimited unlimited locks 13 | Max pending signals 29436 29436 signals 14 | Max msgqueue size 819200 819200 bytes 15 | Max nice priority 0 0 16 | Max realtime priority 0 0 17 | Max realtime timeout unlimited unlimited us 18 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/26232/stat: -------------------------------------------------------------------------------- 1 | 33 (ata_sff) S 2 0 0 0 -1 69238880 0 0 0 0 0 0 0 0 0 -20 1 0 5 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 18446744073709551615 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/584/stat: -------------------------------------------------------------------------------- 1 | 1020 ((a b ) ( c d) ) R 28378 1020 28378 34842 1020 4218880 286 0 0 0 0 0 0 0 20 0 1 0 10839175 10395648 155 18446744073709551615 4194304 4238788 140736466511168 140736466511168 140609271124624 0 0 0 0 0 0 0 17 5 0 0 0 0 0 6336016 6337300 25579520 140736466515030 140736466515061 140736466515061 140736466518002 0 2 | #!/bin/cat /proc/self/stat 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/mdstat: -------------------------------------------------------------------------------- 1 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 2 | md3 : active raid6 sda1[8] sdh1[7] sdg1[6] sdf1[5] sde1[11] sdd1[3] sdc1[10] sdb1[9] 3 | 5853468288 blocks super 1.2 level 6, 64k chunk, algorithm 2 [8/8] [UUUUUUUU] 4 | 5 | md127 : active raid1 sdi2[0] sdj2[1] 6 | 312319552 blocks [2/2] [UU] 7 | 8 | md0 : active raid1 sdk[2](S) sdi1[0] sdj1[1] 9 | 248896 blocks [2/2] [UU] 10 | 11 | md4 : inactive raid1 sda3[0] sdb3[1] 12 | 4883648 blocks [2/2] [UU] 13 | 14 | md6 : active raid1 sdb2[2] sda2[0] 15 | 195310144 blocks [2/1] [U_] 16 | [=>...................] recovery = 8.5% (16775552/195310144) finish=17.0min speed=259783K/sec 17 | 18 | md8 : active raid1 sdb1[1] sda1[0] 19 | 195310144 blocks [2/2] [UU] 20 | [=>...................] resync = 8.5% (16775552/195310144) finish=17.0min speed=259783K/sec 21 | 22 | md7 : active raid6 sdb1[0] sde1[3] sdd1[2] sdc1[1] 23 | 7813735424 blocks super 1.2 level 6, 512k chunk, algorithm 2 [4/3] [U_UU] 24 | bitmap: 0/30 pages [0KB], 65536KB chunk 25 | 26 | unused devices: 27 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/net/ip_vs: -------------------------------------------------------------------------------- 1 | IP Virtual Server version 1.2.1 (size=4096) 2 | Prot LocalAddress:Port Scheduler Flags 3 | -> RemoteAddress:Port Forward Weight ActiveConn InActConn 4 | TCP C0A80016:0CEA wlc 5 | -> C0A85216:0CEA Tunnel 100 248 2 6 | -> C0A85318:0CEA Tunnel 100 248 2 7 | -> C0A85315:0CEA Tunnel 100 248 1 8 | TCP C0A80039:0CEA wlc 9 | -> C0A85416:0CEA Tunnel 0 0 0 10 | -> C0A85215:0CEA Tunnel 100 1499 0 11 | -> C0A83215:0CEA Tunnel 100 1498 0 12 | TCP C0A80037:0CEA wlc 13 | -> C0A8321A:0CEA Tunnel 0 0 0 14 | -> C0A83120:0CEA Tunnel 100 0 0 15 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/net/ip_vs_stats: -------------------------------------------------------------------------------- 1 | Total Incoming Outgoing Incoming Outgoing 2 | Conns Packets Packets Bytes Bytes 3 | 16AA370 E33656E5 0 51D8C8883AB3 0 4 | 5 | Conns/s Pkts/s Pkts/s Bytes/s Bytes/s 6 | 4 1FB3C 0 1282A8F 0 7 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/self: -------------------------------------------------------------------------------- 1 | 26231 -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/README: -------------------------------------------------------------------------------- 1 | This directory contains some empty files that are the symlinks the files in the "fd" directory point to. 2 | They are otherwise ignored by the tests 3 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/abc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/abc -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/def: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/def -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/ghi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/ghi -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/uvw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/uvw -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/xyz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/host-info/vendor/github.com/prometheus/procfs/fixtures/symlinktargets/xyz -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fs.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | ) 8 | 9 | // FS represents the pseudo-filesystem proc, which provides an interface to 10 | // kernel data structures. 11 | type FS string 12 | 13 | // DefaultMountPoint is the common mount point of the proc filesystem. 14 | const DefaultMountPoint = "/proc" 15 | 16 | // NewFS returns a new FS mounted under the given mountPoint. It will error 17 | // if the mount point can't be read. 18 | func NewFS(mountPoint string) (FS, error) { 19 | info, err := os.Stat(mountPoint) 20 | if err != nil { 21 | return "", fmt.Errorf("could not read %s: %s", mountPoint, err) 22 | } 23 | if !info.IsDir() { 24 | return "", fmt.Errorf("mount point %s is not a directory", mountPoint) 25 | } 26 | 27 | return FS(mountPoint), nil 28 | } 29 | 30 | // Path returns the path of the given subsystem relative to the procfs root. 31 | func (fs FS) Path(p ...string) string { 32 | return path.Join(append([]string{string(fs)}, p...)...) 33 | } 34 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/fs_test.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import "testing" 4 | 5 | func TestNewFS(t *testing.T) { 6 | if _, err := NewFS("foobar"); err == nil { 7 | t.Error("want NewFS to fail for non-existing mount point") 8 | } 9 | 10 | if _, err := NewFS("procfs.go"); err == nil { 11 | t.Error("want NewFS to fail if mount point is not a directory") 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/mdstat_test.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestMDStat(t *testing.T) { 8 | mdStates, err := FS("fixtures").ParseMDStat() 9 | if err != nil { 10 | t.Fatalf("parsing of reference-file failed entirely: %s", err) 11 | } 12 | 13 | refs := map[string]MDStat{ 14 | "md3": MDStat{"md3", "active", 8, 8, 5853468288, 5853468288}, 15 | "md127": MDStat{"md127", "active", 2, 2, 312319552, 312319552}, 16 | "md0": MDStat{"md0", "active", 2, 2, 248896, 248896}, 17 | "md4": MDStat{"md4", "inactive", 2, 2, 4883648, 4883648}, 18 | "md6": MDStat{"md6", "active", 1, 2, 195310144, 16775552}, 19 | "md8": MDStat{"md8", "active", 2, 2, 195310144, 16775552}, 20 | "md7": MDStat{"md7", "active", 3, 4, 7813735424, 7813735424}, 21 | } 22 | 23 | if want, have := len(refs), len(mdStates); want != have { 24 | t.Errorf("want %d parsed md-devices, have %d", want, have) 25 | } 26 | for _, md := range mdStates { 27 | if want, have := refs[md.Name], md; want != have { 28 | t.Errorf("%s: want %v, have %v", md.Name, want, have) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/proc_io.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | ) 8 | 9 | // ProcIO models the content of /proc//io. 10 | type ProcIO struct { 11 | // Chars read. 12 | RChar uint64 13 | // Chars written. 14 | WChar uint64 15 | // Read syscalls. 16 | SyscR uint64 17 | // Write syscalls. 18 | SyscW uint64 19 | // Bytes read. 20 | ReadBytes uint64 21 | // Bytes written. 22 | WriteBytes uint64 23 | // Bytes written, but taking into account truncation. See 24 | // Documentation/filesystems/proc.txt in the kernel sources for 25 | // detailed explanation. 26 | CancelledWriteBytes int64 27 | } 28 | 29 | // NewIO creates a new ProcIO instance from a given Proc instance. 30 | func (p Proc) NewIO() (ProcIO, error) { 31 | pio := ProcIO{} 32 | 33 | f, err := os.Open(p.path("io")) 34 | if err != nil { 35 | return pio, err 36 | } 37 | defer f.Close() 38 | 39 | data, err := ioutil.ReadAll(f) 40 | if err != nil { 41 | return pio, err 42 | } 43 | 44 | ioFormat := "rchar: %d\nwchar: %d\nsyscr: %d\nsyscw: %d\n" + 45 | "read_bytes: %d\nwrite_bytes: %d\n" + 46 | "cancelled_write_bytes: %d\n" 47 | 48 | _, err = fmt.Sscanf(string(data), ioFormat, &pio.RChar, &pio.WChar, &pio.SyscR, 49 | &pio.SyscW, &pio.ReadBytes, &pio.WriteBytes, &pio.CancelledWriteBytes) 50 | if err != nil { 51 | return pio, err 52 | } 53 | 54 | return pio, nil 55 | } 56 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/proc_io_test.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import "testing" 4 | 5 | func TestProcIO(t *testing.T) { 6 | p, err := FS("fixtures").NewProc(26231) 7 | if err != nil { 8 | t.Fatal(err) 9 | } 10 | 11 | s, err := p.NewIO() 12 | if err != nil { 13 | t.Fatal(err) 14 | } 15 | 16 | for _, test := range []struct { 17 | name string 18 | want int64 19 | have int64 20 | }{ 21 | {name: "RChar", want: 750339, have: int64(s.RChar)}, 22 | {name: "WChar", want: 818609, have: int64(s.WChar)}, 23 | {name: "SyscR", want: 7405, have: int64(s.SyscR)}, 24 | {name: "SyscW", want: 5245, have: int64(s.SyscW)}, 25 | {name: "ReadBytes", want: 1024, have: int64(s.ReadBytes)}, 26 | {name: "WriteBytes", want: 2048, have: int64(s.WriteBytes)}, 27 | {name: "CancelledWriteBytes", want: -1024, have: s.CancelledWriteBytes}, 28 | } { 29 | if test.want != test.have { 30 | t.Errorf("want %s %d, have %d", test.name, test.want, test.have) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/proc_limits_test.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import "testing" 4 | 5 | func TestNewLimits(t *testing.T) { 6 | p, err := FS("fixtures").NewProc(26231) 7 | if err != nil { 8 | t.Fatal(err) 9 | } 10 | 11 | l, err := p.NewLimits() 12 | if err != nil { 13 | t.Fatal(err) 14 | } 15 | 16 | for _, test := range []struct { 17 | name string 18 | want int 19 | have int 20 | }{ 21 | {name: "cpu time", want: -1, have: l.CPUTime}, 22 | {name: "open files", want: 2048, have: l.OpenFiles}, 23 | {name: "msgqueue size", want: 819200, have: l.MsqqueueSize}, 24 | {name: "nice priority", want: 0, have: l.NicePriority}, 25 | {name: "address space", want: -1, have: l.AddressSpace}, 26 | } { 27 | if test.want != test.have { 28 | t.Errorf("want %s %d, have %d", test.name, test.want, test.have) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/stat.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "os" 7 | "strconv" 8 | "strings" 9 | ) 10 | 11 | // Stat represents kernel/system statistics. 12 | type Stat struct { 13 | // Boot time in seconds since the Epoch. 14 | BootTime int64 15 | } 16 | 17 | // NewStat returns kernel/system statistics read from /proc/stat. 18 | func NewStat() (Stat, error) { 19 | fs, err := NewFS(DefaultMountPoint) 20 | if err != nil { 21 | return Stat{}, err 22 | } 23 | 24 | return fs.NewStat() 25 | } 26 | 27 | // NewStat returns an information about current kernel/system statistics. 28 | func (fs FS) NewStat() (Stat, error) { 29 | f, err := os.Open(fs.Path("stat")) 30 | if err != nil { 31 | return Stat{}, err 32 | } 33 | defer f.Close() 34 | 35 | s := bufio.NewScanner(f) 36 | for s.Scan() { 37 | line := s.Text() 38 | if !strings.HasPrefix(line, "btime") { 39 | continue 40 | } 41 | fields := strings.Fields(line) 42 | if len(fields) != 2 { 43 | return Stat{}, fmt.Errorf("couldn't parse %s line %s", f.Name(), line) 44 | } 45 | i, err := strconv.ParseInt(fields[1], 10, 32) 46 | if err != nil { 47 | return Stat{}, fmt.Errorf("couldn't parse %s: %s", fields[1], err) 48 | } 49 | return Stat{BootTime: i}, nil 50 | } 51 | if err := s.Err(); err != nil { 52 | return Stat{}, fmt.Errorf("couldn't parse %s: %s", f.Name(), err) 53 | } 54 | 55 | return Stat{}, fmt.Errorf("couldn't parse %s, missing btime", f.Name()) 56 | } 57 | -------------------------------------------------------------------------------- /host-info/vendor/github.com/prometheus/procfs/stat_test.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import "testing" 4 | 5 | func TestStat(t *testing.T) { 6 | s, err := FS("fixtures").NewStat() 7 | if err != nil { 8 | t.Fatal(err) 9 | } 10 | 11 | if want, have := int64(1418183276), s.BootTime; want != have { 12 | t.Errorf("want boot time %d, have %d", want, have) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /http-hello/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func main() { 9 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 10 | log.Printf("request from %v\n", r.RemoteAddr) 11 | w.Write([]byte("hello\n")) 12 | }) 13 | log.Fatal(http.ListenAndServe(":5000", nil)) 14 | } 15 | -------------------------------------------------------------------------------- /jwt-auth/auth_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "net/http" 7 | "net/http/httptest" 8 | "testing" 9 | ) 10 | 11 | 12 | func newRequest(method, url string) *http.Request { 13 | req, err := http.NewRequest(method, url, nil) 14 | if err != nil { 15 | panic(err) 16 | } 17 | return req 18 | } 19 | 20 | func TestAuth(t *testing.T) { 21 | tests := []struct { 22 | Method string 23 | Path string 24 | StatusCode int 25 | }{ 26 | {"PUT", "/accessible/baz", 200}, 27 | {"PUT", "/inaccessible", 403}, 28 | {"GET", "/accessible", 200}, 29 | {"GET", "/inaccessible", 403}, 30 | } 31 | 32 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 33 | fmt.Fprintln(w, "Hello, client") 34 | })) 35 | defer ts.Close() 36 | 37 | client := &http.Client{} 38 | 39 | for i, test := range tests { 40 | req := newRequest(test.Method, ts.URL+test.Path) 41 | resp, err := client.Do(req) 42 | resp.Body.Close() 43 | if err != nil { 44 | log.Fatal(err) 45 | } 46 | if resp.StatusCode != test.StatusCode { 47 | t.Fatalf("%d: wrong code, got %d want %d", i, resp.StatusCode, test.StatusCode) 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /neomatrix-coreos/README.md: -------------------------------------------------------------------------------- 1 | ## CoreOS Neomatrix Logo 2 | 3 | Arduino project to print the CoreOS logo onto a Neomatrix display. Thanks to Twilio for the [hackpack](https://www.twilio.com/blog/2015/05/light-up-your-hackpack-with-the-adafruit-neomatrix-library.html). 4 | 5 | 6 | ``` 7 | go run png2rgb.go coreos.png | pbcopy 8 | ``` 9 | 10 | 11 | TODO 12 | 13 | - Use templates to build the ino file instead of pbcopy 14 | - Animation! 15 | 16 | ![](coreos.png) 17 | ![](working.png) 18 | -------------------------------------------------------------------------------- /neomatrix-coreos/coreos.piko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/neomatrix-coreos/coreos.piko -------------------------------------------------------------------------------- /neomatrix-coreos/coreos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/neomatrix-coreos/coreos.png -------------------------------------------------------------------------------- /neomatrix-coreos/png2rgb.go: -------------------------------------------------------------------------------- 1 | // This example demonstrates decoding a JPEG image and examining its pixels. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "image" 7 | "log" 8 | "os" 9 | 10 | _ "image/png" 11 | 12 | "github.com/lucasb-eyer/go-colorful" 13 | ) 14 | 15 | func main() { 16 | // Decode the JPEG data. If reading from file, create a reader with 17 | // 18 | reader, err := os.Open(os.Args[1]) 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | defer reader.Close() 23 | m, _, err := image.Decode(reader) 24 | if err != nil { 25 | log.Fatal(err) 26 | } 27 | bounds := m.Bounds() 28 | 29 | for y := bounds.Min.Y; y < bounds.Max.Y; y++ { 30 | for x := bounds.Min.X; x < bounds.Max.X; x++ { 31 | ra, ga, ba, _ := m.At(x, y).RGBA() 32 | c := colorful.Color{float64(ra) / 65536.0, float64(ga) / 65536.0, float64(ba) / 65536.0} 33 | r, g, b := c.RGB255() 34 | if r == 0 && b == 0 && g == 0 { 35 | r = 255 36 | g = 255 37 | b = 255 38 | } 39 | fmt.Printf("matrix.drawPixel(%d, %x, matrix.Color(0x%x, 0x%x, 0x%x));\n", x, y, r, g, b) 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /neomatrix-coreos/working.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/neomatrix-coreos/working.png -------------------------------------------------------------------------------- /nslookup/main_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestFind(t *testing.T) { 8 | tests := []struct { 9 | name string 10 | wfound bool 11 | }{ 12 | {"invalid-always.coreos.com.", false}, 13 | {"www.coreos.com.", true}, 14 | } 15 | 16 | for i, tt := range tests { 17 | msg, _, found := find(tt.name) 18 | if tt.wfound != found { 19 | t.Errorf("#%d: name = %s, msg = %s, want %b", i, tt.name, msg, tt.wfound) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pagetoken/pagetoken.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "encoding/base64" 6 | "encoding/binary" 7 | "fmt" 8 | ) 9 | 10 | type Token struct { 11 | Limit uint8 12 | Page uint16 13 | } 14 | 15 | func main() { 16 | // Encode 17 | buf := new(bytes.Buffer) 18 | tok := Token{100, 4} 19 | binary.Write(buf, binary.LittleEndian, tok) 20 | enc := base64.URLEncoding.EncodeToString(buf.Bytes()) 21 | println(enc) 22 | 23 | it := &Token{} 24 | dec, _ := base64.URLEncoding.DecodeString(enc) 25 | db := bytes.NewBuffer(dec) 26 | binary.Read(db, binary.LittleEndian, it) 27 | fmt.Printf("%v", it) 28 | } 29 | -------------------------------------------------------------------------------- /rkt-k8s/README.md: -------------------------------------------------------------------------------- 1 | ## Build a Container 2 | 3 | Make the binary 4 | 5 | ``` 6 | mkdir -p example.com/host-info/rootfs 7 | GOOS=linux go build -o example.com/host-info/rootfs/host-info github.com/philips/hacks/host-info 8 | ``` 9 | 10 | Build the ACI 11 | 12 | ``` 13 | actool build --overwrite example.com/host-info www-data/host-info-latest-linux-amd64.aci 14 | ``` 15 | 16 | Sign the ACI 17 | 18 | ``` 19 | gpg --sign --armor --detach www-data/host-info-latest-linux-amd64.aci 20 | ``` 21 | 22 | ## Build up the index.html 23 | 24 | ``` 25 | cat www-data/index.html 26 | 27 | 28 | 29 | 30 | 31 |

welcome to example.com

32 | ``` 33 | 34 | Export pubkeys 35 | 36 | ``` 37 | gpg --export --armor brandon.philips@coreos.com > www-data/pubkey.gpg 38 | mv www-data/host-info-latest-linux-amd64.aci.sig www-data/host-info-latest-linux-amd64.aci.asc 39 | ``` 40 | 41 | ## Start an HTTP server 42 | 43 | ``` 44 | cd www-data 45 | sudo python -m SimpleHTTPServer 80 46 | ``` 47 | 48 | ## Try it all out 49 | 50 | Trust the public key 51 | 52 | ``` 53 | sudo ./rkt trust --insecure-allow-http --prefix example.com/host-info 54 | ``` 55 | 56 | Fetch the image 57 | 58 | ``` 59 | sudo ./rkt fetch example.com/host-info 60 | ``` 61 | 62 | 63 | ``` 64 | sudo ./rkt run example.com/host-info 65 | ``` 66 | 67 | Visit host-info 68 | 69 | http://192.168.168.134:5483/ 70 | -------------------------------------------------------------------------------- /rkt-k8s/example.com/host-info/manifest: -------------------------------------------------------------------------------- 1 | { 2 | "acKind": "ImageManifest", 3 | "acVersion": "0.7.0", 4 | "app": { 5 | "exec": [ 6 | "/host-info" 7 | ], 8 | "group": "0", 9 | "user": "0", 10 | "ports": [ 11 | { 12 | "name": "www", 13 | "port": 5483, 14 | "protocol": "tcp" 15 | } 16 | ] 17 | }, 18 | "labels": [ 19 | { 20 | "name": "git", 21 | "value": "e4a790f7c8d37752f48972ee65d863ea3ba348bd" 22 | } 23 | ], 24 | "name": "example.com/host-info" 25 | } 26 | -------------------------------------------------------------------------------- /rkt-k8s/www-data/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

welcome to example.com

7 | -------------------------------------------------------------------------------- /ssh-agent-tool/.gitignore: -------------------------------------------------------------------------------- 1 | ssh-agent-tool 2 | -------------------------------------------------------------------------------- /ssh-agent-tool/README.md: -------------------------------------------------------------------------------- 1 | # ssh-agent OAUTH 2.0 bridge 2 | 3 | Nearly everyone who does server infrastructure has an ssh key. This is a strong 4 | public-key based identity. Not only that but it is often the only identity that 5 | is available when people remote into a host via ssh thanks to "ssh-agent 6 | forwarding". 7 | 8 | This tool acts a bridge so that people can use their ssh-identity to back 9 | another identity, initially an identity backed by dex, an OAUTH 2.0 / OIDC 10 | provider. 11 | 12 | ## Manual 13 | 14 | ### List Public Keys 15 | 16 | ``` 17 | $ ssh-agent-tool list-keys 18 | 00: ssh-rsa AAAAB3NzaC1yc2EAAAA...y+1EoNzsPkY2aw== /Users/philips/.ssh/id_rsa 19 | 01: ssh-rsa AAAAB3NzaC1yc2EAAAA...oYVfmKAMjmKkV /Users/philips/.ssh/id_rsa_old 20 | ``` 21 | 22 | ### Sign 23 | 24 | ``` 25 | $ ssh-agent-tool sign $(echo foobar | base64) 26 | 00: ssh-rsa fStlJeCQW8...Glu5ZHNuc= 27 | 01: ssh-rsa gtLeSrdor...rgQb9Qp/SDw== 28 | ``` 29 | 30 | ### Challenge Verify 31 | 32 | ``` 33 | $ ./ssh-agent-tool verify $(echo foobar | base64) ssh-rsa fStlJeCQW8...Glu5ZHNuc= 34 | 00: verified: true 35 | 01: verified: false 36 | $ ./ssh-agent-tool verify $(echo foobar | base64) ssh-rsa gtLeSrdor...rgQb9Qp/SDw== 37 | 00: verified: false 38 | 01: verified: true 39 | ``` 40 | -------------------------------------------------------------------------------- /timeline/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /timeline/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d3-timeline", 3 | "version": "0.0.1", 4 | "main": "src/d3-timeline.js", 5 | "ignore": [ 6 | "examples", 7 | "lib", 8 | ".bowerrc", 9 | ".gitignore", 10 | ".git", 11 | ".jshintrc", 12 | "gruntfile.js", 13 | "package.json", 14 | "README.md" 15 | ], 16 | "dependencies": { 17 | "d3": ">=3.4.3" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /timeline/bower_components/d3/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d3", 3 | "version": "3.5.5", 4 | "main": "d3.js", 5 | "scripts": [ 6 | "d3.js" 7 | ], 8 | "ignore": [ 9 | ".DS_Store", 10 | ".git", 11 | ".gitignore", 12 | ".npmignore", 13 | ".spmignore", 14 | ".travis.yml", 15 | "Makefile", 16 | "bin", 17 | "component.json", 18 | "composer.json", 19 | "index.js", 20 | "lib", 21 | "node_modules", 22 | "package.json", 23 | "src", 24 | "test" 25 | ], 26 | "homepage": "https://github.com/mbostock/d3", 27 | "_release": "3.5.5", 28 | "_resolution": { 29 | "type": "version", 30 | "tag": "v3.5.5", 31 | "commit": "9628a923cb9df82058a4a2fcc8d415e45b6d5d2f" 32 | }, 33 | "_source": "git://github.com/mbostock/d3.git", 34 | "_target": ">=3.4.3", 35 | "_originalSource": "d3" 36 | } -------------------------------------------------------------------------------- /timeline/bower_components/d3/.gitattributes: -------------------------------------------------------------------------------- 1 | bower.json -diff merge=ours 2 | component.json -diff merge=ours 3 | d3.js -diff merge=ours 4 | d3.min.js -diff merge=ours 5 | package.js -diff merge=ours 6 | -------------------------------------------------------------------------------- /timeline/bower_components/d3/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2015, Michael Bostock 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * The name Michael Bostock may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /timeline/bower_components/d3/README.md: -------------------------------------------------------------------------------- 1 | # Data-Driven Documents 2 | 3 | 4 | 5 | **D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation. 6 | 7 | Want to learn more? [See the wiki.](https://github.com/mbostock/d3/wiki) 8 | 9 | For examples, [see the gallery](https://github.com/mbostock/d3/wiki/Gallery) and [mbostock’s bl.ocks](http://bl.ocks.org/mbostock). 10 | -------------------------------------------------------------------------------- /timeline/bower_components/d3/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d3", 3 | "version": "3.5.5", 4 | "main": "d3.js", 5 | "scripts": [ 6 | "d3.js" 7 | ], 8 | "ignore": [ 9 | ".DS_Store", 10 | ".git", 11 | ".gitignore", 12 | ".npmignore", 13 | ".spmignore", 14 | ".travis.yml", 15 | "Makefile", 16 | "bin", 17 | "component.json", 18 | "composer.json", 19 | "index.js", 20 | "lib", 21 | "node_modules", 22 | "package.json", 23 | "src", 24 | "test" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /timeline/bower_components/d3/package.js: -------------------------------------------------------------------------------- 1 | // Package metadata for Meteor.js. 2 | 3 | Package.describe({ 4 | name: "d3js:d3", // http://atmospherejs.com/d3js/d3 5 | summary: "D3 (official): A JavaScript visualization library for HTML and SVG.", 6 | version: "3.5.5", 7 | git: "https://github.com/mbostock/d3.git" 8 | }); 9 | 10 | Package.onUse(function(api) { 11 | api.versionsFrom(["METEOR@1.0"]); 12 | api.addFiles("d3.js", "client"); 13 | }); 14 | -------------------------------------------------------------------------------- /timeline/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d3-timeline", 3 | "version": "0.0.1", 4 | "main": "src/d3-timeline.js", 5 | "repository": "https://github.com/jiahuang/d3-timeline.git", 6 | "license" : "MIT", 7 | "dependencies": { 8 | "d3": ">=3.4.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /timeline/root/app.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | var width = 1200; 3 | var chart, svg; 4 | var data = []; 5 | function poll() { 6 | function reqListener () { 7 | console.log(this.responseText); 8 | data = JSON.parse(this.responseText); 9 | d3.select("#timeline svg").remove(); 10 | draw(); 11 | } 12 | 13 | var oReq = new XMLHttpRequest(); 14 | oReq.onload = reqListener; 15 | oReq.open("get", "/api", true); 16 | oReq.send(); 17 | } 18 | 19 | function update() { 20 | svg.selectAll("rect") 21 | .data([data]) 22 | .transition(); 23 | } 24 | 25 | function draw() { 26 | chart = d3.timeline() 27 | .stack() 28 | .tickFormat({format: d3.time.format("%H:%M:%S"), 29 | tickTime: d3.time.seconds, 30 | tickInterval: 10, 31 | tickSize: 10}); 32 | 33 | svg = d3.select("#timeline").append("svg").attr("width", width) 34 | .data([data]) 35 | .call(chart); 36 | } 37 | 38 | poll(); 39 | window.setInterval(poll, 50000); 40 | } 41 | -------------------------------------------------------------------------------- /timeline/root/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 28 | 30 | 31 | 32 |
33 |
34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /timeline/root/jackie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/jackie.png -------------------------------------------------------------------------------- /timeline/root/timeline1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/timeline1.png -------------------------------------------------------------------------------- /timeline/root/timeline2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/timeline2.png -------------------------------------------------------------------------------- /timeline/root/timeline3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/timeline3.png -------------------------------------------------------------------------------- /timeline/root/timeline4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/timeline4.png -------------------------------------------------------------------------------- /timeline/root/timeline5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/timeline5.png -------------------------------------------------------------------------------- /timeline/root/timeline6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/timeline6.png -------------------------------------------------------------------------------- /timeline/root/troll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/troll.png -------------------------------------------------------------------------------- /timeline/root/wat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philips/hacks/4f8e904c7bf922cd65dea866a0012789dfe5a524/timeline/root/wat.png -------------------------------------------------------------------------------- /whois-exp/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/likexian/whois-parser-go" 6 | 7 | "github.com/likexian/whois-go" 8 | ) 9 | 10 | func main() { 11 | domains := []string{"google.com"} 12 | 13 | for _, domain := range domains { 14 | result, err := whois.Whois(domain) 15 | if err != nil { 16 | fmt.Println(err) 17 | continue 18 | } 19 | 20 | out, err := whois_parser.Parser(result) 21 | if err != nil { 22 | fmt.Println(err) 23 | continue 24 | } 25 | 26 | // Print the domain expiration date 27 | fmt.Printf("%s: %v\n", domain, out.Registrar.ExpirationDate) 28 | } 29 | } 30 | --------------------------------------------------------------------------------