Skip to content

Instantly share code, notes, and snippets.

View bshi's full-sized avatar

Bo Shi bshi

  • Google, Inc.
  • San Francisco, CA
View GitHub Profile
@bshi
bshi / gke_kubeconfig.sh
Created April 22, 2021 05:02
gke_kubeconfig
#/usr/bin/env bash
#
# Create a kubeconfig file suitable for use with the kubecfg() macro. The
# resulting config contains no secret material and are suitable to check into
# version control directly (certificate data embedded in the configurations are
# not private keys).
set -euxo pipefail
# Set "container/use_application_default_credentials" property via environment
# variable since we don't want to mutate the user's settings silently.
@bshi
bshi / cgo_library_fixup.patch
Last active July 24, 2016 07:52
pre-glaze-pkg.py
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/system/BUILD b/vendor/github.com/opencontainers/runc/libcontainer/system/BUILD
index 45a0368..a8fdfab 100644
--- a/vendor/github.com/opencontainers/runc/libcontainer/system/BUILD
+++ b/vendor/github.com/opencontainers/runc/libcontainer/system/BUILD
@@ -2,7 +2,12 @@ package(
default_visibility = ["//visibility:public"],
)
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "cgo_library")
@bshi
bshi / cloudtrail.yml
Created November 14, 2015 02:59
cloudtrail configuration through cloudformatoin
AWSTemplateFormatVersion: '2010-09-09'
Description: Security settings.
Parameters:
CloudTrailLogBucket:
Description: Bucket
Type: String
SlackWebhookUrl:
Description: Slack Integration URL
@bshi
bshi / json.info_0000000000
Last active October 13, 2015 21:45
mesos zookeeper state
Path /mesos/json.info_0000000000
Stat czxid: 3, mzxid: 3, ctime: 1444686539042, mtime: 1444686539042, version: 0, cversion: 0, aversion: 0, ephemeralOwner: 94678970914242560, dataLength: 272, numChildren: 0, pzxid: 3
Data Bytes 7b 22 61 64 64 72 65 73 73 22 3a 7b 22 68 6f 73 74 6e 61 6d 65 22 3a 22 69 70 2d 31 30 2d 30 2d 32 2d 32 33 31 2e 75 73 2d 77 65 73 74 2d 32 2e 63 6f 6d 70 75 74 65 2e 69 6e 74 65 72 6e 61 6c 22 2c 22 69 70 22 3a 22 31 30 2e 30 2e 32 2e 32 33 31 22 2c 22 70 6f 72 74 22 3a 35 30 35 30 7d 2c 22 68 6f 73 74 6e 61 6d 65 22 3a 22 69 70 2d 31 30 2d 30 2d 32 2d 32 33 31 2e 75 73 2d 77 65 73 74 2d 32 2e 63 6f 6d 70 75 74 65 2e 69 6e 74 65 72 6e 61 6c 22 2c 22 69 64 22 3a 22 32 30 31 35 31 30 31 32 2d 32 31 34 38 35 39 2d 33 38 37 35 36 36 37 39 37 38 2d 35 30 35 30 2d 34 35 30 22 2c 22 69 70 22 3a 33 38 37 35 36 36 37 39 37 38 2c 22 70 69 64 22 3a 22 6d 61 73 74 65 72 40 31 30 2e 30 2e 32 2e 32 33 31 3a 35 30 35 30 22 2c 22 70 6f 72 74 22 3a 35 30 35 30 2c 22 76 65 72 73 69 6f 6e 22 3a 22 30 2
@bshi
bshi / graph
Created July 22, 2015 02:33
scalax graph-core
vagrant@jessie:/vagrant$ mvn scala:console
...
Welcome to Scala version 2.11.4 (OpenJDK 64-Bit Server VM, Java 1.7.0_79).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scalax.collection.Graph
import scalax.collection.Graph
scala> import scalax.collection.GraphEdge.DiEdge

Keybase proof

I hereby claim:

  • I am bshi on github.
  • I am bshi (https://keybase.io/bshi) on keybase.
  • I have a public key whose fingerprint is BDA5 66F8 C57F 10D8 9763 E2FF B991 6DB0 7F9A 4F3A

To claim this, I am signing this object:

Dec 04 00:52:52 bb-master-a.c.internal docker[28222]: 2014-12-03 16:52:52-0800 [-] acquireLocks(slave <LatentGceBuildSlave 'bb-slave-22'>, locks [])
Dec 04 00:52:52 bb-master-a.c.internal docker[28222]: 2014-12-03 16:52:52-0800 [-] substantiating slave <LatentSlaveBuilder builder='opsconfig-ci' slave='bb-slave-22'>
Dec 04 00:52:52 bb-master-a.c.internal docker[28222]: 2014-12-03 16:52:52-0800 [-] starting build <Build opsconfig-ci>.. pinging the slave <LatentSlaveBuilder builder='opsconfig-ci' slave='bb-slave-22'>
Dec 04 00:52:52 bb-master-a.c.internal docker[28222]: 2014-12-03 16:52:52-0800 [-] sending ping
Dec 04 00:52:52 bb-master-a.c.internal docker[28222]: 2014-12-03 16:52:52-0800 [-] while pinging slave before build:
Dec 04 00:52:52 bb-master-a.c.internal docker[28222]: Traceback (most recent call last):
Dec 04 00:52:52 bb-master-a.c.internal docker[28222]: File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1099, in _inlineCallbacks
Dec 04 00:52:52 bb-master-a.c.internal docke
@bshi
bshi / gist:7f408509cc0793378fdf
Created August 18, 2014 21:57
xmlrpclib.Fault: <Fault 1: 'UNKNOWN_METHOD'>
Traceback (most recent call last):
File "/usr/local/bin/memmon", line 9, in <module>
load_entry_point('superlance==0.11', 'console_scripts', 'memmon')()
File "/usr/local/lib/python2.7/dist-packages/superlance/memmon.py", line 402, in main
memmon.runforever()
File "/usr/local/lib/python2.7/dist-packages/superlance/memmon.py", line 147, in runforever
infos = self.rpc.supervisor.getAllProcessInfo()
File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
@bshi
bshi / gist:f102b70cfbaf0c6bd037
Created July 18, 2014 18:59
/run/systemd/network/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.
nameserver 169.254.169.254
nameserver 10.99.0.1
nameserver 8.8.8.8
@bshi
bshi / gist:cfc255d121b6ad161a71
Created July 18, 2014 18:13
latest coreos alpha gce name resolution
localhost opt # ping docker-repository.c.my-project.internal
PING docker-repository.c.my-project.internal (10.99.230.128) 56(84) bytes of data.
64 bytes from docker-repository.c.my-project.internal (10.99.230.128): icmp_seq=1 ttl=64 time=0.821 ms
64 bytes from docker-repository.c.my-project.internal (10.99.230.128): icmp_seq=2 ttl=64 time=0.687 ms
^C
--- docker-repository.c.my-project.internal ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.687/0.754/0.821/0.067 ms
localhost opt # ping docker-repository
ping: unknown host docker-repository