改用Hexo了

换个玩玩。

顺便把page的源,从docs/目录改为了直接在Github Actions里上传和发布,简化一下仓库。

另外Hexo比Hugo多一个“分类”的支持,但是Github issue只有Labels,被用来当做“标签”了……空了再看拿哪个字段来当分类。

阅读全文

一些可能有用的东西

tailescale

https://login.tailscale.com

安装

1
2
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up #--auth-key=tskey-abcdef1432341818

阅读全文

记录一次飞牛OS升级后Docker启动失败

升级系统后,web UI显示docker是关闭状态,点击开关提示“未知错误”。

SSH登录看docker服务是正常运行的。

Root Dir也是正确的。但是 container没起来。

尝试升级docker,重启后还是一样。

最后想起配置文件之前加了一个代理,而这个代理是飞牛OS里一个定时任务启动的,把代理配置从/etc/docker/daemon.json里删掉重启OK了。。。

猜测(也许)是因为docker启动时间比代理进程早???

阅读全文

给docker daemon设置代理

修改配置:

sudo vi /etc/docker/daemon.json

1
2
3
4
5
6
7
{
"proxies": {
"http-proxy": "http://127.0.0.1:1080",
"https-proxy": "http://127.0.0.1:1080",
"no-proxy": "*.example.com,localhost,127.0.0.0/8"
}
}

重启服务:

sudo systemctl restart docker

ref: https://docs.docker.com/engine/daemon/proxy/

阅读全文

WSL里的Ubuntu/Debian因为时间不同步报错

报错:

1
2
E: Release file for http://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 2h 1min 40s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 5h 19min 27s). Updates for this repository will not be applied.

同步时间解决:

1
hwclock -s

阅读全文

WSL无法使用ping命令

问题:

1
2
3
4
$ ping github.com
ping: socktype: SOCK_RAW
ping: socket: Operation not permitted
ping: => missing cap_net_raw+p capability or setuid?

解决方法:

1
$ sudo setcap cap_net_raw+p /bin/ping

参考:https://github.com/microsoft/WSL/issues/5109

阅读全文

WSL里docker启动失败

报错:

1
2
failed to start daemon: Error initializing network controller: error obtaining controller instance: unable to add return rule in DOCKER-ISOLATION-STAGE-1 chain:  (iptables failed: iptables --wait -A DOCKER-ISOLATION-STAGE-1 -j RETURN: iptables v1.8.7 (nf_tables):  RULE_APPEND failed (No such file or directory): rule in chain DOCKER-ISOLATION-STAGE-1
(exit status 4))

解决:

1
2
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

参考:https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269

阅读全文

GCC Instrumentation Options

https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

-fsanitize=address, -fsanitize=thread,…

阅读全文

Windows 11家庭版安装WSL

管理员权限打开PowerShell,执行:

1
wsl --install

提示安装成功。但是启动WSL的时候报错:

1
WslRegisterDistribution failed with error: 0x80370114

似乎是家庭版在“启用或关闭Windows功能”里看不到Linux子系统的功能,用命令行:

1
2
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

(第二个应该是在第一步就激活了的)

阅读全文

Where is the core dump?

after setting ulimit -c unlimited, if you still don’t get the core file in the workding dir. try to run this:

1
cat /proc/sys/kernel/core_pattern

to get the path of the core dump files.

test env: Ubuntu 20.04 (WSL), you may get:

1
/mnt/wslg/dumps/core.%e

阅读全文