Docker Cheatsheet
Delete all images $ for i in `docker images | awk 'NR>1{print $1":"$2}'`;do docker rmi $i;done Aliyun docker accelerator(/etc/docker/daemon.json) {"registry-mirrors": ["ht…
kubernetes cheatsheet
Obtain node join token$ kubeadm token list | awk 'NR==2{print $1}' Get master hostname$ kubectl get nodes -l node-role.kubernetes.io/master -o jsonpath="{.items[*].metadata.na…
How to use crash to analyze vmcore
It is very important to check the vmcore file when the server gets hang there or crash for unknown reason, following tips give some help on how to check the vmcore, hope it he…
Golang tips
How to write customized error with optional error struct passed type Y2HError struct { errMsg string errDetail error } func (e *Y2HError) Error() string { if e.errDetail != ni…
Golang OOP
How to simiuate super.init() in Python type Baser interface { Init(name string) Do() } type BaseClass struct { name string } func (cls *BaseClass) Init(name string) { cls.name…