硬盘扩容, PVE, Archlinux

硬盘扩容 pve ext4 根分区磁盘扩容 虚拟机关机 在 pve 里给硬盘扩容: vm>hardware> Hard Disk> Disk Action> resize: 填写新增的容量 挂载 archlinux iso, 修改引导顺序, 让虚拟机从 iso 启动 启动虚拟机 1 2 3 4 5 6

nerdctl

nerdctl 1 2 3 4 # nerdctl update 命令来修改容器的配置,包括重启策略。 sudo nerdctl update --restart unless-stopped kafka # 验证 sudo nerdctl inspect kafka | grep -A 5 restart.policy

wireguard

wireguard wireguard default port: 51820 install archlinux archlinux 新版本的内核已经集成了 wireguard,不需要单独安装. archlinux 集成了 wireguard 但是默认没加载, 需要配置一下启动的时候加载 wireguard 内核模块. 1

linux 目录

linux 目录, Filesystem Hierarchy Standard (FHS) / 根目录,一般根目录下只存放目录,不要存放文件,/etc、/bin、/dev、/lib、/sbin 应该和根目录放置在一个分区

python set

python set 线上的某一个业务模块常规的执行时间大概是这样的 📊 总体统计: 完成的 xxx 总数: 379 最短耗时: 0.190 秒 最长耗时: 2815.415 秒 平均耗时: 67.626 秒 中位数耗时: 9.585 秒 标准

python signal pause

python signal.pause() vs time.sleep() signal.pause() 系统调用实现, 直接向内核发起系统调用, 让当前线程进入休眠状态, 直到接收到信号为止. 内核将进程状态从 RUNNING → INTERRUPTIBLE_SLEEP 进程从CPU运行队列(CP

windows wsl

windows wsl WSL: windows subsystem for Linux 微软的官方安装文档 https://learn.microsoft.com/zh-cn/windows/wsl/install wsl 文档 https://learn.microsoft.com/en-us/windows/wsl/ https://learn.microsoft.com/zh-cn/windows/wsl/ command 管理员 模式下打开 PowerShell 或 cmd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

MCP

MCP https://code.visualstudio.com/docs/copilot/chat/mcp-servers https://modelcontextprotocol.io/introduction https://code.visualstudio.com/mcp vscode> extension>search @mcp install memory mcp

stat command

stat command stat 命令,查看某个文件的 inode 信息, 除了文件名以外的所有文件信息,都存在inode之中。 stat, linux 查看文件创建时间, 修改时间 1 stat file_0.txt atime, mtime, ctime 简名 全名 中文

linux apps

linux apps kitty, terminal Go 1 go install github.com/jesseduffield/lazygit@latest Ubuntu apt package gnome-shell-pomodoro: Pomodoro, https://gnomepomodoro.org/ pavucontrol, chrome audio output, https://askubuntu.com/questions/457978/no-sound-from-chrome-sound-works-fine-in-firefox-etc-13-10 baobab, 硬盘占用分析工具 indicator-sysmonitor, 任务栏里的系统资源监控 thunderbird, 邮件客户端, email client flameshot, 截图工具 pacman ncdu, 磁盘空间占用分析/清理 bitwarden, password

wsl native docker windows vscode hack

wsl native docker windows vscode hack wsl archlinux install containerd nerdctl nerdctl 和 containerd 使用 Unix socket一般在 /run/containerd/containerd.sock 在 WSL 里启动 socat 监听 containerd.socket,转发到 Windows 命名管道 1 2 3 4 sudo mkdir -p /mnt/wsl/shared-containerd sudo

ca-certificates 导入CA证书

ca-certificates 导入 CA 证书 macos 导入自签名证书 在 Spotlight 里搜索 “钥匙串访问” 或者 Keychain Access, 在左侧栏里选择 System, 点击菜单栏 File> import items, 导入 自签名的 ca 证书 然后在 系统证书里面找名字是 *.wiloon.com 的

Openssl 生成自签名证书, self-signed cert

自签名证书, self-signed cert 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 sudo pacman -S openssl # 查看默认的 OpenSSL 配置目录 openssl version -d # Create two directories for all certs and root private key that you will generate mkdir certs private # list all available curves openssl ecparam

kong

kong run postgresql 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 docker network create kong-net # 创建 postgresql, 并创建一个实例 kong-db

ldd 查看程序依赖 动态链接库

ldd 查看程序依赖 动态链接库 ldd(List Dynamic Dependencies) 命令可以用于分析可执行文件所依赖的共享库(动态链接库) 1 2 3 4 5 # 检测 动态链接 # 查看 libcups 是否真的链接到了 avahi ldd /usr/lib/libcups.so |

containerd

containerd archlinux install containerd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # archlinux install containerd pacman -S containerd runc nerdctl cni-plugins # containerd config sudo mkdir /etc/containerd containerd config default | sudo tee /etc/containerd/config.toml sudo systemctl daemon-reload sudo systemctl enable --now containerd sudo nerdctl pull hello-world sudo nerdctl run --rm hello-world # 如果需要编译镜像

AI

AI AI IDE Microsoft Copilot Cursor Windsurf augment code AI 编程 之前有一种想法,有些小的修改, 比如只有几行代码的修改不需要用 AI, 因为构思提示词的时间往往比直接写代码的时间要长,但是最

kafka basic, command

kafka basic, command kafka_2.13-3.4.0.tgz scala 版本 2.13 kafka 版本 3.4.0 TLS kafka todo commands 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # list topic bin/kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092 # create topic bin/kafka-topics.sh --create --partitions 1 --replication-factor 1 --topic topic_0 --bootstrap-server 127.0.0.1:9092 # consumer bin/kafka-console-consumer.sh --topic topic_0 --bootstrap-server 127.0.0.1:9092 # producer bin/kafka-console-producer.sh --bootstrap-server 127.0.0.1:9092 --topic topic_0 # list group name

加密分区缩容, LVM on LUKS

加密分区缩容, LVM on LUKS https://linux-blog.anracom.com/2018/11/09/shrinking-an-encrypted-partition-with-lvm-on-luks/ https://wiki.archlinux.org/title/Resizing_LVM-on-LUKS https://wiki.archlinux.org/title/LVM#Resizing_the_logical_volume_and_file_system_in_one_go https://starbeamrainbowlabs.com/blog/article.php?article=posts%2F441-resize-luks-lvm.html Step 1: Get an overview over your block devices 1 lsblk 加密分区在 /dev/nvme0n1p3 上 Step 2: Open the encrypted partition 1 2 3 4 5 cryptsetup open /dev/nvme0n1p3 cr-ext # 打开过程中会要求输入密码 # 检查一下设备映射 ls

enX

enX 开发环境 vscode 本地测试 在 Chrome 里打开 Manage Extensions: chrome://extensions/ Reload enX 在 Chrome 里打开 InfoQ 里任意一篇文章 点击扩展栏里的 enX enX 会标记文章正文部分的英文词 unit test 1 2 cd /Users/wiloon/workspace/projects/enx/chrome-enx npm run test -- infoq.test.js deploy api to local