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…
Autoreload uWSGI when any changes made in Django project
There is a monitor.py can be used in Apache + mod_wsgi deployment, which can be used to auto reload wsgi processes when there is any change under Django project directory. I s…
Hugo where “contains” operator implementation
(1) Background To fix following issue: Add "contains" operator in where function to support list pages in nested subdir I implemented a new contains operator in Hugo…
Create Django deployment env in CentOS7 from scratch
Here we will create a cloud based virtual server from scratch, following things need to be done to prepare develop and deployment env for django1.7+. Background Personally I p…
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…