Sun Nov 21今天的 Leetcode 练习是:把罗马数字转化成整数,很有趣的一个小练习(也许是简单容易理解才觉得有趣哈哈)。然后我对 Go 还不熟悉,还不知道 Go 里面也有类似 Json 的数据结构。最后看了solution。发现别人的解题思路很棒,很直接。最后采用了她的思路。

Sat Nov 20

今天打算开始每天一个 Leetcode。试着做了一个递归小函数,这种在以前初学编程的时候感觉好难好难,在 Leetcode 上居然是 easy 级别。程序员真厉害。https://github.com/hawken-im/GoLeetCode

https://github.com/hawken-im/GoLeetCode

Sat Nov 19

先是在 xue.cn 上找了书但是发现有bug,然后在github上找到了该repo的地址就干脆在 github 里学习了吧。https://github.com/danicat/pacgo/

https://github.com/danicat/pacgo/

函数中有个叫“defer”的东西,后来去研究了,是一个很方便的语句,可以记录当前的状态但是延迟到函数结束再执行。

然后还学了ansi escape code,一个很奇怪的控制命令行窗口的代码……掌握这个奇怪的知识有啥用吗,还是说这个知识点背后还有点别的有连续性的知识体系,暂时没有继续研究下去。

I followed these two instructions:

Remember to config “sites-available” seperately, try not to config the global config file, for two reasons:

  1. It’ll be easier to maintain.
  2. Certbot is not that clever, so we want to leave the global config file to Certbot.

Follow the official instructions to install Certbot correctly.Then we need to choose a command to call a plugin to get CA.After I finished reading, I found out many unofficial instructions online are outdated.If we install Certbot correctly, we only need to use command:

Then Certbot can do all for you. Even can create a cron job to renew certificate automatically.

Try to get into the shawdowsocks container created by docker.

Found this command:

docker exec -it bash

It didn’t work. And I found this:

https://mkyong.com/docker/docker-exec-bash-executable-file-not-found-in-path/

https://mkyong.com/docker/docker-exec-bash-executable-file-not-found-in-path/

Noticed not every image is using the bash shell.

Then tried this:

docker exec -it sh

It actually worked.

之前每次都要输入export locale=en-US.UTF-8

网上的教程也没有讲清楚zsh启动的配置文件到底在哪里。

我这次找到了。

在/etc/zshrc

在这个文件后面加入

export locale=en-US.UTF-8

就好了。

当然这个文件权限是readonly,要在vim前面加个sudo,这个也是教程没有提到的。

0%