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

阅读全文

chrome with novnc in docker

1
sudo docker run --name chrome-novnc -p 8080:8080 -e VNC_PASS=meiyoumima vital987/chrome-novnc:latest

阅读全文

portainer重置密码

docker跑起来以后,portainer就不怎么登录了,久了就忘了密码。。。

portainer官方提供了一个helper用来重置密码:

1
docker run --rm -v portainer_data:/data portainer/helper-reset-password

portainer_data 也可以直接用 portainer.key文件所在的路径,可以通过全局搜索来找到(一般在 /var/lib/docker/volumes/... 下面)。

运行成功后,会在终端打印用户名和重置后的新密码,用新密码登录后再修改密码即可。

阅读全文

nextcloud登录提示“网络请求过多”

本身是nextcloud防暴破登录的一个机制, 好像是因为用了Nginx反代导致登录的时候被误判了(?)

解决办法是到数据库里清除防暴的表:oc_bruteforce_attempts

1
2
3
mysql -u root -p
use nextcloud
delete from oc_bruteforce_attempts;

阅读全文

Oracle VPS端口和防火墙设置

开放端口

1
2
3
4
Instances >> Instance Details 
>> Attached VNICs >> Subnet or VLAN
>> Subnet - subnet-YYYYMMDD-HHMM >> Security Lists
>> add rules for TCP/UDP/ICMP ...

Ubuntu防火墙设置:

1
2
3
4
5
6
7
8
9
10
sudo iptables -L
sudo apt remove iptables-persistent
sudo apt purge netfilter-persistent
sudo iptables -L
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -L
sudo iptables -F
sudo reboot

阅读全文

apt临时使用socks5代理

有些时候,一些没有mirror的apt源访问起来有点痛苦,比梯子还慢。。。所以让apt走梯子:

1
apt -o Acquire::http::proxy="socks5h://127.0.0.1:1080/"   原来的指令

注意是 socks5h

参考: https://askubuntu.com/a/1117259/1121096

阅读全文

老毛子(padavan)路由器IPv6防火墙设置

转发到内网机器:

1
2
ip6tables -A FORWARD -d 域名 -j ACCEPT
ip6tables -P OUTPUT ACCEPT

只转发指定端口:

1
2
ip6tables -A FORWARD -p tcp -m multiport --dport 21,9090,10000 -d 域名 -j ACCEPT
ip6tables -P OUTPUT ACCEPT

域名可以改成内网机器的IPv6地址,但是这个应该不是固定的,所以还是用域名方便。需要配合DDNS。

80,443等端口依然被运营商屏蔽了。

阅读全文

使用Github Actions做自动发布

之前一直用家里的NAS设置cron job来定时拉去issues生成博客, 这样做有一些缺陷:

  1. 要求NAS一直在线(断电、断网就熄火了)
  2. 定时pull有一定的延迟,而且长时间没更新issue的情况下,定时pull很浪费资源
  3. 之前用blog-hugo来维护模板,跟 issue的仓库分离,不方便一起维护

抽时间弄了 github actions, 利用github支持的事件触发actions,实现自动生成和更新博客, nice!

顺便把hugo的模板和博客放在一个仓库里,all in one了。简单方便。

阅读全文

引进评论系统:utterances

https://utteranc.es/

和github issue完美结合!

之前只能把评论爬下来显示在静态博客里,现在直接嫁接到静态博客里了,不用跑回github来写评论了,完美!

阅读全文