Archive of

ubuntu 20.04 手工生成通配符ssl证书

其实很简单,但因为网上有流传很广的教程并不适用于最新的 ubuntu 20.04,造成我也走了一点弯路。 certbot-auto 官方已停止维护,但网上广为流传的教程仍然推荐使用 certbot-auto 来生成证书。这是问题的根源。正确的姿势是这样的

sudo apt install certbot
sudo certbot certonly --manual -d *.yourdomain.com -d youdomain.com --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory

照提示一步一步来就好了。是不是超级简单?

A guide for git status change

状态标识

标志含义
nul文件已提交到版本库未做修改
??untracked 新文件尚未 git add
Astaged 已经 git add 但尚未提交
AMstaged 未提交又做限新的修改,新修改尚未staged
MM一些修改staged之后又做了新的修改,新修改尚未staged

状态转换指南

状态A -> 状态B需要的操作
nul -> M修改文件
MM -> nulgit checkout HEAD file(s) OR git checkout -- file(s)
A -> ??git rm --cached file(s)
M -> Mgit add file(s)
A -> AMgit reset file(s)
A -> nulgit reset file(s)
?? -> Agit add file(s)
A -> ??git rm --cached file(s)
A -> AMgit add 之后再修改文件
AM -> Agit checkout -- file(s)

switch case in bash script

, change the first letter of the value of the variable to lowercase, ,, change the value of the whole variable to lower case.

$ test='HELLO'
$ echo $test
HELLO
$ echo ${test,}
hELLO
$ echo ${test,,}
hello
$ test=${test,,}
$ echo ${test^}
Hello
$ echo ${test^^}
HELLO