关机
立即关机且不通知其他用户 shutdown -h now
取消关机 shutdown -c
十分钟后关机且通知其他用户 shutdown -h +10
使用自定义消息 shutdown -h +6 "time to stop working and go outside to play"
定时关闭 格式hh:mm shutdown -h 22:15
重启 shutdown -r
停止系统 不关闭电源 shutdown -H

Halt 正常关机并切断电源
停止服务以及进程并卸载文件系统 不关闭电源
Reboot 正常关机,并重启系统
Poweroff 正常关机并切断电源

挂起模式 systemctl suspend
休眠模式 systemctl hibernate
混合睡眠模式 Systemctl hybrid-sleep
挂起后休眠模式 Systemctl suspend-then-hibernate

P78




步骤:
cd ~

下载官方 1.21.0 稳定版

cd ~

下载官方 1.21.0 稳定版

wget https://github.com/shadowsocks/shadowsocks-rust/releases/download/v1.21.0/shadowsocks-v1.21.0.x86_64-unknown-linux-gnu.tar.xz
解压缩并移动到/usr/local/bin

解压压缩包

tar -xvf shadowsocks-v1.21.0.x86_64-unknown-linux-gnu.tar.xz

将客户端程序 sslocal 移入系统 bin 目录

sudo mv sslocal /usr/local/bin/

赋予执行权限

sudo chmod +x /usr/local/bin/sslocal
创建配置文件
sudo nano /etc/shaowsocks.json

{

"server":"this.example",
"server_port":443,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"你的密码",
"timeout":300,
"method":"chacha20-ietf-poly1305",
"fast_open": true

}
server地址可用域名或ip

配置systemd自动启动
sudo nano /etc/systemd/system/shadowsocks-rust.service

[Unit]
Description=Shadowsocks-rust Client
After=network.target

[Service]
Type=simple
User=root

启动前强制清理潜在冲突进程

ExecStartPre=/usr/bin/pkill -9 sslocal || true
ExecStart=/usr/local/bin/sslocal -c /etc/shadowsocks.json

如果程序意外崩溃,5秒后自动重启

Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

激活运行;
sudo systemctl daemon-reload
sudo systemctl enable shadowsocks-rust
sudo systemctl start shadowsocks-rust
验证启动状态
systemctl status shadowsocks-rust
看到绿色的 active (running)

除错:
系统级别代理配置:

测试系统配置状态

ALL_PROXY=socks5://127.0.0.1:1080 curl -I https://www.google.com

快捷开关:
nano ~/.bashrc
alias proxyon='export http_proxy=socks5h://127.0.0.1:1080 && export https_proxy=socks5h://127.0.0.1:1080'
alias proxyoff='unset http_proxy && unset https_proxy'

apt永久代理:
sudo nano /etc/apt/apt.conf.d/80proxy

Acquire::http::Proxy "socks5h://127.0.0.1:1080";
Acquire::https::Proxy "socks5h://127.0.0.1:1080";


命令行查询方法 (推荐)
使用 curl 命令 (最常用)
curl ifconfig.me:直接返回你的IPv4公网IP。
curl ipinfo.io/ip:返回IP地址。
curl cip.cc:返回IP地址及地理信息。
curl ip.sb:返回IPv4地址。
curl -s -m 2 icanhazip.com:-s 隐藏进度,-m 2 设置最大时间为2秒,适合脚本。
使用 wget 命令
wget -qO- http://icanhazip.com: -q 静默模式,-O- 输出到标准输出。
使用示例
查询纯IP地址 (IPv4):
bash
curl ifconfig.me

或

curl ip.sb
查询IP地址及地理位置:
bash
curl cip.cc
提示
这些命令都需要系统中安装了 curl 或 wget 工具。