椰子的笔记 - coconut
type: channel
link: https://iscoconut.com/author/1/
description: coconut
items: 使用Cloudflare API + ddclient 实现DDNS动态更新域名解析
items: 哪吒探针LXC容器频繁离线的原因与临时解决方案
items: WAWO LXC Debian 尝鲜手册
items: WAP CN LXC 食用指南
items: PVE防火墙实现禁止国内入向流量和国际出向流量
items: Debian11 一键更换国内阿里云源
items: Proxmox VE 8 国内源【清华大学源】
items: Debian 开启IPv4优先
items: IPv6访问GitHub

使用Cloudflare API + ddclient 实现DDNS动态更新域名解析
type: item
date: 2024-09-21T15:51:53+08:00
description: 创建Cloudflare APICloudflare创建区域DNS API 提高安全性，进入“我的个人资料-API令牌-创建令牌-选择编辑区域DNS模板-选择需要的域名-继续以显示摘要”会获得一个api令牌，只会显示一次，安全保存安装ddclinet客户端下载客户端wget https://github.com/ddclient/ddclient/archive/refs/tags/v3.11.2.tar.gz *建议前往项目下载最新客户端 https://github.com/ddclient/ddclient/releases解压程序，并进入解压后的目录tar xvfa v3.11.2.tar.gz cd ddclient-3.11.2 安装autoconfapt-get install autoconf -y apt-get install build-essential -y 安装Perl (这一步可能不需要？)cpan HTTP::Daemon HTTP::Daemon::SSL HTTP::Message::PSGI HTTP::Request HTTP::Response Test::MockModule Test::TCP Test::Warnings URI 编译安装./autogen ./configure \ --prefix=/usr \ --sysconfdir=/etc/ddclient \ --localstatedir=/var make make VERBOSE=1 check sudo make install编辑 /etc/ddclient/ddclient.conf 可以参考下面的配置###################################################################### ## ## 全局配置 ## ###################################################################### daemon=60 # 每60秒检查一次IP更新 syslog=yes # 将更新日志写入系统日志 mail=root # 将所有消息发送到root用户 mail-failure=root # 将失败的更新消息发送到root用户 pid=/var/run/ddclient.pid # PID文件路径 ssl=yes # 使用SSL支持 ###################################################################### ## ## 获取公网 IP 的配置（通过 Web 服务） ## ###################################################################### use=web # 使用Web服务获取IP web=https://ipinfo.io/ip # 获取外部IP的Web服务 ###################################################################### ## ## Cloudflare 区域 API Token 配置 ## ###################################################################### protocol=cloudflare # 使用Cloudflare协议 zone=your-domain.com # 替换为你的主域名 login=token # 使用API Token进行登录 password=your-api-token # 替换为你的API Token your-domain.com,subdomain.your-domain.com # 替换为你的主域名和子域名 复制systemd文件cp sample-etc_systemd.service /etc/systemd/system/ddclient.service 启动并设置开机自启systemctl enable ddclient.service systemctl start ddclient.service 参考资料：ChatGPTddclinet项目地址： https://github.com/ddclient/ddclient

哪吒探针LXC容器频繁离线的原因与临时解决方案
type: item
date: 2024-03-19T22:59:28+08:00
description: 掉线原因LXC为容器虚拟化，不完全隔离，小鸡会共用母鸡内核和一些系统文件小鸡会频繁读取/proc目录，当读取下面的一些目录时会卡顿这些目录由基于fuse的lxcfs接管，存在性能瓶颈/proc/cpuinfo /proc/diskstats /proc/meminfo /proc/stat /proc/swaps /proc/uptime /proc/slabinfo /sys/devices/system/cpu/online 反映到具体行为就是卡顿+探针显示离线临时解决方案关闭连接数和进程数监控flag.BoolVar(&agentCliParam.SkipConnectionCount, "skip-conn", false, "不监控连接数") flag.BoolVar(&agentCliParam.SkipProcsCount, "skip-procs", false, "不监控进程数") 参考文档链接： https://nezha.wiki/guide/q7.html

WAWO LXC Debian 尝鲜手册
type: item
date: 2024-01-30T15:56:00+08:00
description: 内容授权: CC-BY-NC-SA 4.0已测试 AlmaLinux 8，目标 Debian 11 /12替换系统可能会失联，请自行考虑是否接受风险后继续1.更新系统并安装依赖# 请看提示输入 Y dnf update --nogpgcheck # 请再次看提示输入 Y dnf install tar xz virt-what nano 2.下载 OsMutation 脚本wget -qO OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutation.sh && chmod u+x OsMutation.sh 3.手动修复脚本 Bug建议但不是必须，不修改建议祈祷使用编辑器nano OsMutation.sh 按 Alt+N 显示行号定位到 86 行，并将以下内容path="$(echo $path | grep -v arm64)" 修改为# 注意引号位置 path=$(echo "$path" | grep -v arm64) 4.替换系统运行./OsMutation.sh 选择 debian-bullseye 或 debian-bookworm5.设置网络不要重启，非常重要！不要重启！否则会失联5.1 使用 ip a 命令查看自己的IP地址IPv4: 以 10.10 开头，复制保存IPv6: 以 2400 开头，/64 结尾，复制保存5.2 安装编辑器apt update && apt install nano -y 5.3 编辑网络配置强制关机重启网络配置会被覆盖，但建议正确配置避免意外失联nano /etc/network/interface 参照模板填写并完整替换内容# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 你的IPv4地址/24 gateway 10.10.24.1 iface eth0 inet6 static address 你的IPv6地址/64 gateway 2400:c620:12::1 6.再次设置密码非常重要，否则会失联passwd 请分别输入两次密码并按回车7.关机并手动开机7.1 输入 shutdown now 命令立即关机7.2 在面板选择 "拔 VPS 电源"7.3 开机参考资料： TG: @Riiinahttps://t.me/c/2007588547/17014

WAP CN LXC 食用指南
type: item
date: 2024-01-22T23:22:00+08:00
description: 将apt源更换为清华大学源(国内源)这款产品屏蔽了中国方向出和国际方向入，所以正常使用自带的debian镜像源是没问题的。只要你能忍受他的速度如果你不能忍受，可以使用清华大学源(在白名单)以Debian11为例，一键命令echo "# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free " >/etc/apt/sources.list其他Debian版本去清华大学镜像站找 https://mirrors.tuna.tsinghua.edu.cn/help/debian/当然Ubuntu版本也有 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/使用IPv6代理访问Githubcat >> /etc/hosts << EOF # https://danwin1210.de/github-ipv6-proxy.php 2a01:4f8:c010:d56::2 github.com 2a01:4f8:c010:d56::3 api.github.com 2a01:4f8:c010:d56::4 codeload.github.com 2a01:4f8:c010:d56::5 objects.githubusercontent.com 2a01:4f8:c010:d56::6 ghcr.io 2a01:4f8:c010:d56::7 pkg.github.com npm.pkg.github.com maven.pkg.github.com nuget.pkg.github.com rubygems.pkg.github.com EOF 更多可跳转 https://iscoconut.com/archives/3/ 查看在VNC上进行复制粘贴在控制台找到这个： Xterm.js Console 使用他就可以进行复制粘贴了。现在可以升级和安装软件了，他的用途是什么？或许可以考虑把他连接到你的 WAP HK LXC 或者 WAP KP LXC，延迟在50ms左右。然后在HK或者KP上安装对应的代理软件，在CN上转发过去就可以轻松使用 https://wap.ac/store/hk-e5-lxc-ipv6也可以连接到 ByteVirt家的SG 延迟80ms https://bytevirt.com/store/nat-lxcsocat转发快速参考， 感谢群友 @Riiina香港端 sing-box 入站设置参考考虑到备案检测等不稳定隐私，不建议进行 TLS 转发不建议在国内存储审计日志不建议在国内对公网开放面板 HTTP 访问{ "inbounds": [ { "type": "shadowsocks", "tag": "inbound-shadowsocks", "listen": "::", "listen_port": 3775, "sniff": true, "sniff_override_destination": t…

PVE防火墙实现禁止国内入向流量和国际出向流量
type: item
date: 2024-01-22T22:15:00+08:00
description: 简述禁止国内出向流量，但是放开部分白名单：清华大学/北京大学镜像站，阿里云DNS6服务器 2400:3200::1创建数据中心防火墙，并使用脚本让小鸡自动加入数据中心安全组实操数据中心防火墙设置： /etc/pve/firewall/cluster.fw[OPTIONS] enable: 1 policy_in: ACCEPT [IPSET chnroute] 2001:250:2000::/35 2001:250:4000::/34 2001:250:8000::/33 2001:250::/35 2001:251::/32 2001:252::/32 2001:253::/32 2001:254::/32 2001:255::/32 2001:256::/32 2001:4438::/32 2001:4510::/29 2001:7fa:10::/48 2001:7fa:5::/48 2001:c68::/32 2001:cc0::/32 2001:da8::/32 2001:da9::/32 2001:daa::/32 2001:dc7::/32 2001:dd8:1::/48 2001:dd8:1a::/48 2001:dd8:5::/48 2001:dd9::/48 2001:df0:1bc0::/48 2001:df0:25c0::/48 2001:df0:26c0::/48 2001:df0:27e::/48 2001:df0:2e00::/48 2001:df0:2e80::/48 2001:df0:423::/48 2001:df0:59c0::/48 2001:df0:85c0::/48 2001:df0:8d40::/48 2001:df0:9c0::/48 2001:df0:9d40::/48 2001:df0:ac40::/48 2001:df0:b180::/48 2001:df0:bf80::/48 2001:df0:d880::/48 2001:df0:f8c0::/48 2001:df1:2b40::/48 2001:df1:4580::/48 2001:df1:5280::/48 2001:df1:5b80::/48 2001:df1:5fc0::/48 2001:df1:6180::/48 2001:df1:61c0::/48 2001:df1:6b80::/48 2001:df1:a100::/48 2001:df1:bd80::/48 2001:df1:c80::/48 2001:df1:c900::/48 2001:df1:d180::/48 2001:df1:da00::/48 2001:df1:f480::/48 2001:df1:f580::/48 2001:df1:fd80::/48 2001:df2:180::/48 2001:df2:5780::/48 2001:df2:80::/48 2001:df2:8bc0::/48 2001:df2:a580::/48 2001:df2:c240::/48 2001:df2:d4c0::/48 2001:df3:1480::/48 2001:df3:15c0::/48 2001:df3:2a80::/48 2001:df3:3a80::/48 2001:df3:a680::/48 2001:df3:b380::/48 2001:df3:c380::/48 2001:df3:c680::/48 2001:df3:d880::/48 2001:df3:ed80::/48 2001:df3:ef80::/48 2001:df4:1280::/48 2001:df4:1500::/48 2001:df4:1880::/48 2001:df4:2780::/48 2001:df4:2e80::/48 2001:df4:3d80::/48 2001:df4:4b80::/48 2001:df4:4d80::/48 2001:df4:880::/48 2001:df4:a680::/48 2001:df4:a980::/48 2001:df4:c180::/48 2001:df4:c580::/48 2001:df4:c780::/48 2001:df4:cf00::/48 2001:df4:d80::/48 2001:df4:de80::/48 2001:df5:2080::/48 2001:df5:5f80::/48 2001:df5:7800::/48 2001:df6:100::/48 2001:df6:3d00::/48 2001:df6:5d00::/48 2001:df6:6800::/48 2001:df6:9e80::/48 …

Debian11 一键更换国内阿里云源
type: item
date: 2024-01-22T13:43:18+08:00
description: 直接替换，需要详细资料见参考资料echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib deb https://mirrors.aliyun.com/debian-security/ bullseye-security main deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >/etc/apt/sources.list 参考资料： https://www.cnblogs.com/liuguanglin/p/debian11_repo.html

Proxmox VE 8 国内源【清华大学源】
type: item
date: 2024-01-22T12:45:14+08:00
description: 下面给出的都是一件命令，如需详细信息请打开参考资料将debian12源替换为清华大学源echo " # 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware # deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware "> /etc/apt/sources.list 将pve源替换为清华大学源echo " deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve bookworm pve-no-subscription " > /etc/apt/sources.list.d/pve-enterprise.list 参考资料：https://mirrors.tuna.tsinghua.edu.cn/help/debian/https://mirrors.tuna.tsinghua.edu.cn/help/proxmox/

Debian 开启IPv4优先
type: item
date: 2024-01-21T22:50:00+08:00
description: 修改 /etc/gai.conf找到下面这一行#precedence ::ffff:0:0/96 100当然也可能是#precedence ::ffff:0:0/96 10取消注释，修改为：precedence ::ffff:0:0/96 100 一句话命令：#鬼知道你这个是结尾10还是100，所以都执行。不过你最好手动去改 sed -i 's/#precedence ::ffff:0:0\/96 100/precedence ::ffff:0:0\/96 100/' /etc/gai.conf sed -i 's/#precedence ::ffff:0:0\/96 10/precedence ::ffff:0:0\/96 100/' /etc/gai.conf 参考资料： https://u.sb/debian-prefer-ipv4/

IPv6访问GitHub
type: item
date: 2024-01-19T21:00:45+08:00
description: GitHub仍不支持IPv6，但是可以使用指定host到代理服务器实现cat >> /etc/hosts << EOF # https://danwin1210.de/github-ipv6-proxy.php 2a01:4f8:c010:d56::2 github.com 2a01:4f8:c010:d56::3 api.github.com 2a01:4f8:c010:d56::4 codeload.github.com 2a01:4f8:c010:d56::5 objects.githubusercontent.com 2a01:4f8:c010:d56::6 ghcr.io 2a01:4f8:c010:d56::7 pkg.github.com npm.pkg.github.com maven.pkg.github.com nuget.pkg.github.com rubygems.pkg.github.com EOF 参考资料： https://danwin1210.de/github-ipv6-proxy.phphttps://www.nodeseek.com/post-57839-1