serv00 是一个简洁的系统重置脚本,旨在通过 SSH 轻松初始化服务器。它提供了基本的清理和系统重置功能,并内置了防止意外数据丢失的安全措施。
- 简单的 SSH 界面
- 彩色输出,提高可读性
- 操作确认提示,防止误操作
- 可选择保留用户配置
- 全面的清理任务:
- 清除 cron 任务
- 终止用户进程
- 清理用户主目录
- 下载脚本:
curl -O https://raw.githubusercontent.com/SamueruTokeisou/serv00/main/system-cleanup-script.sh
- 添加执行权限:
chmod +x system-cleanup-script.sh
- 运行脚本:
./system-cleanup-script.sh
为方便访问:
sudo mv system-cleanup-script.sh /usr/local/bin/serv00-reset
或创建别名:
echo "alias serv00-reset='~/path/to/system-cleanup-script.sh'" >> ~/.bashrc
source ~/.bashrc
serv00 is a streamlined system reset script designed for easy server initialization via SSH. It offers essential cleanup and system reset functionalities with built-in safeguards against accidental data loss.
- Simple SSH-based interface
- Color-coded output for enhanced readability
- Confirmation prompts to prevent unintended actions
- Option to preserve user configurations
- Comprehensive cleanup tasks:
- Cron job clearance
- User process termination
- Home directory cleanup
- Download the script:
curl -O https://raw.githubusercontent.com/SamueruTokeisou/serv00/main/system-cleanup-script.sh
- Make it executable:
chmod +x system-cleanup-script.sh
- Run the script:
./system-cleanup-script.sh
For easier access:
sudo mv system-cleanup-script.sh /usr/local/bin/serv00-reset
Or create an alias:
echo "alias serv00-reset='~/path/to/system-cleanup-script.sh'" >> ~/.bashrc
source ~/.bashrc
This script deletes user data. Always backup important information before use.
- 打开终端,确保你在主目录或其他合适的目录中。
- 使用以下命令创建脚本:
cat << 'EOF' > ~/upgrade_go.sh
#!/bin/bash
# 创建安装目录
mkdir -p ~/local/soft && cd ~/local/soft
# 下载编译好的 go1.22 的程序包
wget https://dl.google.com/go/go1.22.0.freebsd-amd64.tar.gz
# 解压
tar -xzvf go1.22.0.freebsd-amd64.tar.gz
# 删除压缩文件
rm go1.22.0.freebsd-amd64.tar.gz
# 修改 .profile 文件
echo 'export PATH=~/local/soft/go/bin:$PATH' >> ~/.profile
# 使 .profile 的修改生效
source ~/.profile
# 检查 go 版本
go version
echo "Go 语言环境升级完成!"
EOF
- 赋予执行权限:
chmod +x ~/upgrade_go.sh
- 运行脚本:
~/upgrade_go.sh
确保没有错误消息。如果一切顺利,你应该能看到 Go 语言环境被成功升级的消息。