v2er119 最近的时间轴更新
v2er119

v2er119

V2EX 第 665530 号会员,加入于 2023-12-04 02:53:32 +08:00
今日活跃度排名 1088
v2er119 最近回复了
4 小时 37 分钟前
回复了 Kinnikuman 创建的主题 问与答 如何评价 B 站户晨风这个直播连麦的博主?
手机上从来装短视频 APP, 但也知道这些 都是生意而已,在国内只能说些能说的吧,能输出价值观的不可以存活。
4 小时 42 分钟前
回复了 ma46 创建的主题 程序员 想开发一款 HTTPS 抓包工具,求大佬们指点!🚀
非专业人士,问一下,在模拟器里使用主机的代理网络,使用主机的 makecert 的证书 。主机根证书导入后,应该也可以解密代理请求吧。
4 小时 53 分钟前
回复了 atfeel 创建的主题 程序员 内网穿透,大家是怎么解决的?
AI 写脚本,监控+提醒+certbot 自动申请
https://maifeipin.com/archives/zi-dong-bu-shu-xi-tong-jian-kong-jiao-ben
只需替换你的邮箱和 tencentcloud.ini (对应的域名 API key ) 就行了


···
#!/bin/bash

THRESHOLD=7
CREDENTIALS="/etc/letsencrypt/tencentcloud.ini"
EMAIL="yourmail@qq.com"
EMAIL_ARG="--email $EMAIL"
# EMAIL_ARG="--register-unsafely-without-email"

nginx_conf_dirs=(
"/etc/nginx/nginx.conf"
"/etc/nginx/conf.d/"
"/etc/nginx/sites-enabled/"
"/etc/nginx/sites-available/"
"/usr/local/nginx/conf/"
)

nginx_cert_files=$(mktemp)
for conf_dir in "${nginx_conf_dirs[@]}"; do
if [ -d "$conf_dir" ]; then
find "$conf_dir" -type f -name "*.conf" 2>/dev/null | while read -r file; do
grep -E '^\s*ssl_certificate\s+' "$file" | awk '{print $2}' | sed "s/['\";]//g" >> "$nginx_cert_files"
done
elif [ -f "$conf_dir" ]; then
grep -E '^\s*ssl_certificate\s+' "$conf_dir" | awk '{print $2}' | sed "s/['\";]//g" >> "$nginx_cert_files"
fi
done

sort -u "$nginx_cert_files" -o "$nginx_cert_files"

while read -r cert_path; do
if [ -z "$cert_path" ]; then continue; fi
if [ ! -f "$cert_path" ]; then
echo "证书文件: $cert_path (未找到!)"
echo "-----------------------------"
continue
fi

expiry_date=$(openssl x509 -noout -enddate -in "$cert_path" 2>/dev/null | cut -d= -f2)
expiry_epoch=$(date -d "$expiry_date" +%s)
now_epoch=$(date +%s)
days_left=$(( (expiry_epoch - now_epoch) / 86400 ))

all_domains=$(openssl x509 -noout -text -in "$cert_path" 2>/dev/null | grep "DNS:" | sed 's/.*DNS://;s/, /\n/g' | tr '\n' ' ')

if [ $days_left -le $THRESHOLD ]; then
main_domain=$(echo "$all_domains" | awk '{print $1}')
echo "证书文件: $cert_path"
echo " 包含域名: $all_domains"
echo " 过期时间: $expiry_date (剩余 $days_left 天)"
echo " 证书即将过期或已过期,自动续期..."

certbot certonly \
-a dns-tencentcloud \
--dns-tencentcloud-credentials "$CREDENTIALS" \
-d $all_domains \
$EMAIL_ARG \
--non-interactive --agree-tos \
--keep-until-expiring

if [ $? -eq 0 ]; then
echo " 证书续期成功"
# 自动覆盖 Nginx 实际用的证书
src_cert="/etc/letsencrypt/live/$main_domain/fullchain.pem"
src_key="/etc/letsencrypt/live/$main_domain/privkey.pem"
if [ -f "$src_cert" ] && [ -f "$src_key" ]; then
# 只在 Nginx 用的路径和 Let’s Encrypt 路径不一致时覆盖
if [ "$cert_path" != "$src_cert" ]; then
cp -f "$src_cert" "$cert_path"
echo " 已覆盖 Nginx 用的证书: $cert_path"
fi
# 查找 key 路径
key_path=$(grep -E '^\s*ssl_certificate_key\s+' /etc/nginx/nginx.conf /etc/nginx/conf.d/*.conf /etc/nginx/sites-enabled/* /etc/nginx/sites-available/* /usr/local/nginx/conf/*.conf 2>/dev/null | grep "$main_domain" | awk '{print $2}' | sed "s/['\";]//g" | head -n1)
if [ -n "$key_path" ] && [ "$key_path" != "$src_key" ]; then
cp -f "$src_key" "$key_path"
echo " 已覆盖 Nginx 用的私钥: $key_path"
fi
fi
systemctl reload nginx
else
echo " 证书续期失败"
fi
else
echo "证书文件: $cert_path"
echo " 包含域名: $all_domains"
echo " 过期时间: $expiry_date (剩余 $days_left 天)"
fi
echo "-----------------------------"
done < "$nginx_cert_files"

rm -f "$nginx_cert_files"

···
各有各的烦,媳妇没有公公婆婆,天天抱怨没有人带孩子,二个孩子从小自己带到大。现在大宝上高中还要 30 公里外租房陪读,一人带一个,自己还要长期加班,分身乏术。
作为做过 RSS 的人来说,一直在思考过个问题,但最热门还是人性的、情感类的贴子回复最多,v2 也不例外。非技术论坛更是如此,看头条,微博,百度风去榜,全是八卦或者突发,标题党等垃圾内容。唯一的办法就是去专业的编辑的网站。谁解决了这个问题,谁就是掌握了未来算法的人。 AIGC 最开始一定是教科书上题库或论文库,官方 API 文档,即使这样用起来还是有幻觉,
25 天前
回复了 mythjava 创建的主题 问与答 请教电子邮件的问题
cf 家的泛域名邮箱很好使,理论上无限个。会帮你转发到指定的邮箱里。
哪有什么好代码,代码为业务服务,极致的体验,最好的代码是机器语言。可读,可维护与极致性能大多场景下是冲突的。
25 天前
回复了 cobainlu 创建的主题 问与答 2025 年有什么可以长期持有的海外手机号
GV 保活有好用的 API 的方案吗?我能想到是定制鼠标工作流,模拟器调试。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2710 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 07:00 · PVG 15:00 · LAX 00:00 · JFK 03:00
Developed with CodeLauncher
♥ Do have faith in what you're doing.