AI 摘要

本文介绍了一个个人常用代码的便捷剪贴板,其中包含了多个 Linux 相关的代码段,如更改 DNS 服务器、同步系统时间、允许账号密码 SSH 等,还有一个 ACME 申请 E1 证书的过程,以及 Linux 各类脚本的收集,包括 Trojan 面板、XUI、Warp-go 等。该文章使用的语言是中文。
这是一个个人常用代码的便捷剪切板

linux相关

更改dns服务器

echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
echo 'nameserver 119.29.29.29' >> /etc/resolv.conf

同步系统时间

sudo timedatectl set-timezone 'Asia/Shanghai'
apt-get install -y ntpdate
ntpdate time.apple.com

gcp允许账号密码ssh

#Ubuntu
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
#debian/centos/rhel
sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config

acme申请e1证书

#安装
curl https://get.acme.sh | sh
#设置cfdns
export CF_Token="cf api token"
export CF_Account_ID="cf domain account id"
#设置默认letsencript
acme.sh --set-default-ca --server letsencrypt
#申请一次证书
acme.sh --issue -d "flandre.vip" -d "*.flandre.vip" --dns dns_cf --force --server letsencrypt
#生成acme id
curl https://get.acme.sh | sh
#填写申请e1表格链接
https://docs.google.com/forms/d/e/1FAIpQLScCWnApP2eUk4cA6y5cFOENlm5S2StVedrqYNzeNdTPoArzwA/viewform
#等周四再次申请安装就变成了e1颁发的ecc证书
acme.sh --issue -d "flandre.vip" -d "*.flandre.vip" --dns dns_cf --force --server letsencrypt \ --key-file       /path/privkey.pem \ --fullchain-file /path/fullchain.pem

linux各类脚本收集

trojan面板

#安装/更新
source <(curl -sL https://git.io/trojan-install)
#卸载
source <(curl -sL https://git.io/trojan-install) --remove

x-ui

bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)

warp-go

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/warp-go.sh && bash warp-go.sh

unblock netease music

#安装node19.x.x 
curl -sL https://deb.nodesource.com/setup_19.x | bash -
apt install -y nodejs git
#一键脚本
curl -fsSLO https://raw.githubusercontent.com/UnblockNeteaseMusic/install-scripts/master/server/install.sh && sudo bash install.sh
单推芙兰朵露
最后更新于 2024-07-08