Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
ChimeraCoder / gist:9fdef30e84ab374b612533ae4fd06873
Created Sep 27, 2018
example of a defer that uses named error return params
View gist:9fdef30e84ab374b612533ae4fd06873
func CalculateThing() (result int, err error) {
defer func() {
if err != nil {
monitoringSrv.HandleErr("CalculateThing", err)
}
}()
var a, b int
a, err = doA()
View gist:94ce2c18558862bdfc66f1702f8acf4f
$ GO111MODULE=on go get -u github.com/stripe/veneur@master
go: finding github.com/stripe/veneur master
go: downloading github.com/stripe/veneur v6.0.1-0.20180919203155-b313e01f1871+incompatible
go: finding github.com/satori/go.uuid v1.2.0
go: downloading github.com/satori/go.uuid v1.2.0
go: downloading gopkg.in/stack.v1 v1.8.0
go build gopkg.in/stack.v1: no Go files in
# k8s.io/client-go/pkg/apis/clientauthentication/v1beta1
../../../../pkg/mod/k8s.io/client-go@v8.0.0+incompatible/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go:39:15: scheme.AddGeneratedConversionFuncs undefined (type *runtime.Scheme has no field or method AddGeneratedConversionFuncs)
# k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1
@ChimeraCoder
ChimeraCoder / .bashrc
Created Apr 30, 2018
exit code in bash prompt
View .bashrc
ps1_prompt() {
local ps1_exit=$?
if [ $ps1_exit -eq 0 ]; then
#ps1_status=`echo -e "\[\033[32m\]"'\$'"\[\033[0m\]"`
ps1_status='\$'
else
ps1_status=`echo -e "\[\033[1;31m\]"'\$'"\[\033[0m\]"`
fi
@ChimeraCoder
ChimeraCoder / veneur-prometheus.yaml
Created Apr 5, 2018
veneur-prometheus yaml (excerpt)
View veneur-prometheus.yaml
- name: veneur-prometheus
image: index.docker.io/stripe/veneur:3.0.0
resources:
limits:
cpu: 25m
command: ["veneur-prometheus"]
args: ["-h", “http://localhost:9090/metrics”, “-i”, “10s”, “-s”, “http://veneur-global:8127”]
View veneur-global-service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: veneur-global
name: veneur-global
spec:
ports:
- name: statsd-listen
port: 8126
@ChimeraCoder
ChimeraCoder / veneur-global.yaml
Created Apr 5, 2018
veneur-global deployment yaml
View veneur-global.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: veneur-global
labels:
app: veneur-global
spec:
minReadySeconds: 10
replicas: 1
template:
@ChimeraCoder
ChimeraCoder / veneur-proxy.yaml
Created Apr 5, 2018
veneur-proxy deployment
View veneur-proxy.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: veneur-proxy
labels:
app: veneur-proxy
spec:
minReadySeconds: 10
replicas: 1
template:
View veneur-proxy-service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: veneur-proxy
name: veneur-proxy
spec:
ports:
- name: statsd-listen
port: 8126
@ChimeraCoder
ChimeraCoder / veneur-emit.yaml
Created Apr 5, 2018
Basic veneur-emit example with credentials
View veneur-emit.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: veneur-emit
labels:
app: veneur-emit
spec:
minReadySeconds: 10
replicas: 1
template:
@ChimeraCoder
ChimeraCoder / veneur-emit.yaml
Created Apr 4, 2018
Basic veneur-emit example
View veneur-emit.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: veneur-emit
labels:
app: veneur-emit
spec:
minReadySeconds: 10
replicas: 1
template: