Error
1、虚拟机里启用了代理,而且是全局的,但是我外面代理又没让其他设备连接,所以我虚拟机里其实是没有网的,所以也访问不了本机端口,但是 ping 是 ICMP 协议,可以 ping 通。
2、<wsl> config --default-user <username> 解决在默认用户下无法保存的问题
3、ubuntu 版本内核代码,在换源的时候记得换, bionic, focal, jammy
4、C++一些库 sudo apt install --reinstall build-essential apk add build-base
sudo yum groupinstall 'Development Tools'
5、ipv6 问题 maybe:
1. 路由器配置问题(连接,防火墙,DHCP)
2. 机器配置问题,防火墙,注册表,协议
3. 缓存问题

6、设置其他用户允许访问 sudo chown -R $USER <directory_project>
7、gcc -v -E -x c++ - 显示 gcc 包含的库路径
8、rabbitmq-plugins enable rabbitmq_management
9、apk 换源 sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
10、有些被设置了禁止公网访问
11、dns 解析其实很快的,不用等 30min
12、ssh 提示 checkhost,修改文件 StrictHostKeyChecking=no
13、远程传输使用 sshpass,sshpass -p $REMOTE_BACKUP_PASSWORD scp -o StrictHostKeyChecking=no /backup/$BACKUP_FILE $REMOTE_BACKUP_USER@$REMOTE_BACKUP_SERVER:$REMOTE_BACKUP_PATH
apt 换源
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
![[K8S#源]]
奇怪的 NotFoundError
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --config python3
sudo add-apt-repository universe
sudo apt update
sudo apt install python 3
WSL 配置代理
wsl --update --pre-release
修改. wslconfig
[wsl2]
nestedVirtualization=true
ipv6=true
[experimental]
autoMemoryReclaim=gradual # gradual | dropcache | disabled
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

clion对于wsl支持一般,记得使用wsl的使用切换相关工具链与工具路径
WSL2下kernel header的安装
https://blog.csdn.net/qq_53928256/article/details/129737658
小心 cron 等脚本自动修改
gcc -v -E -x c++ -
在 linux 多用户下,注意 sudo 和普通用户的可能不是一个,比如普通用户是 go 1.23,root 是 1.19,并且环境代理也不一样
vscode 预览问题

clangd 问题
记得配置 build 位置,如果不在根路径可能会有问题,要选择 compile_commands. json!
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=True ..
perf 权限
sudo sysctl -w kernel.perf_event_paranoid=-1
临时更改
/etc/sysctl.conf 永久修改
kernel.perf_event_paranoid=-1
perf record ./a.out
Error:
Access to performance monitoring and observability operations is limited.
Consider adjusting /proc/sys/kernel/perf_event_paranoid setting to open
access to performance monitoring and observability operations for processes
without CAP_PERFMON, CAP_SYS_PTRACE or CAP_SYS_ADMIN Linux capability.
More information can be found at 'Perf events and tool security' document:
https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html
perf_event_paranoid setting is 4:
-1: Allow use of (almost) all events by all users
Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK
>= 0: Disallow raw and ftrace function tracepoint access
>= 1: Disallow CPU event access
>= 2: Disallow kernel profiling
To make the adjusted perf_event_paranoid setting permanent preserve it
in /etc/sysctl.conf (e.g. kernel.perf_event_paranoid = <setting>)
code runner 配置
-
打开 VS Code 设置 (
Ctrl + ,或Cmd + ,) -
搜索
code-runner.executorMap→ 点击 "Edit in settings.json" -
修改对应语言的命令模板(以 C++ 为例):
"code-runner. executorMap": {
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && ./$ fileNameWithoutExt"
}
rsync
解决rsync: connection unexpectedly closed
goland 远程构建出现 missing go. sum entry
missing go. sum entry for module providing package k 8 s. io/client-go/kubernetes (imported by server);
可能是本地环境和远程环境不一样,需要本地/远程更新使用同一份 go.mod

浙公网安备 33010602011771号