Sugar for kubectl - Some aliases to make life easier
I will only pick a very limited selection of the shortcuts which I need to use most frequenlty and the shortcuts are flexible enough.
Build SSL certificate auto-renewal for Jenkins
So I try to build an auto-renewal flow to relief myself. The approach is pretty straightforward: use acme.sh to auto-renew the SSL cert periodically, and an in-house script update_cert_for_jenkins.py to do the jobs after SSL cert renewed (if any).
Compare commits between 2 branches
IMO, the ideal tool showing the different commits between 2 branches need to
- list all the different commits E, D, B;
- mark the direction (which branch has the commit);
- have the output format which is highly readable and is even customizable.
TIL - Config .yarnrc to ensure the registry to use
If npm has configured its own registry in
.npmrc
,yarn install
will use it instead of the yarn configured one. Set expected registry in .yarnrc under current project to enforce.
Git push in automation
Configure
ssh
to proceedgit push
successfully on dispensable automation servers.
Quick rename in shell
If you do not have
rename
command in shell, here is some quick alternative cmds.
Run shell cmd with double asterisks(**) in Python2
Background
Double asterisks wildcard is super useful in shell command for lazy programmers.
Useful commands when process stdout
-E option in grep
, zgrep
, sed
Although -e
could work in most cases when regex in search phase, -E
could help to save some escape backslash.
In complex regex, bunch of backslashes will bring troubles.