V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  v2er119  ›  全部回复第 1 页 / 共 4 页
回复总数  68
1  2  3  4  
14 天前
回复了 weiwenhao 创建的主题 程序员 我写了一个编程语言,受 golang 启发
看文档,好熟悉的代码风格, 支持自动 GC.

近日,多家外媒报道,美国网络安全和基础设施安全局( CISA )和联邦调查局( FBI )宣布将说服软件制造商放弃 C 和 C++ 等“内存不安全”的编程语言
非专业人士,问一下,在模拟器里使用主机的代理网络,使用主机的 makecert 的证书 。主机根证书导入后,应该也可以解密代理请求吧。
19 天前
回复了 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 文档,即使这样用起来还是有幻觉,
43 天前
回复了 mythjava 创建的主题 问与答 请教电子邮件的问题
cf 家的泛域名邮箱很好使,理论上无限个。会帮你转发到指定的邮箱里。
哪有什么好代码,代码为业务服务,极致的体验,最好的代码是机器语言。可读,可维护与极致性能大多场景下是冲突的。
44 天前
回复了 cobainlu 创建的主题 问与答 2025 年有什么可以长期持有的海外手机号
GV 保活有好用的 API 的方案吗?我能想到是定制鼠标工作流,模拟器调试。
双网关,需要科学的设备才走 op.不需要科学的走另一个网关。op 负责 dhcp ,通过 dhcp 选项功能给设备动态分配网关
很受启发,我的简阅 rss 项目,有了更大的想象空间,太赞了!
45 天前
回复了 rookie 创建的主题 Windows 给微软跪了,升级完 22h4 电脑都用不成了。
24H2 的远程桌面也换了,但是就是时间一长,被远程的电脑桌面就动不了了。没升级前是没有问题的
45 天前
回复了 liuzhiyong 创建的主题 职场话题 大龄程序员的一些工作上的感受
这网站纯手工撸的,可以以此为起点,加油!作为 80 后,眼里还有光的人说明还是有干劲的,加油!
作为大龄码农,非常理解,我的网站一样没有一张图片,也是负优化,顺便域名待售。https://maifeipin.com
46 天前
回复了 michaelhyperhit 创建的主题 职场话题 如何能认识更多优秀的程序员?
同在合肥,看薪资水平,吊打我们啊,虽然对运维比较感兴趣的,但年纪大了。创业公司,还是要有朝气的年轻人比较好。
47 天前
回复了 JustDoIt221 创建的主题 学点什么 花 5.5W 报了个两年的英语培训
还是退了吧,纯心理作用,会的自己肯定能学会,随便一个 AI 都比培训班的老师有耐心。
47 天前
回复了 oom 创建的主题 Go 编程语言 分享一款流量分析工具 [GO-FLOW]
看上去不错,要是加个主流系统的二进制版本,用的人就方便多了。现在:No releases published 。当然也可以在 Readme 加上编译过程。
如果不用网线。蓝牙,红外也不是不行。
1  2  3  4  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3826 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 58ms · UTC 05:24 · PVG 13:24 · LAX 22:24 · JFK 01:24
Developed with CodeLauncher
♥ Do have faith in what you're doing.