Personal Notes-2
This is my second personal note. As the title suggests, this is my own personal note (personal-oriented) to record some knowledge points I encounter in daily life that need to be recorded.
All content does not provide explanations, only operations. If needed, read by yourself. The content in personal notes is generally fragmented and messy, please forgive.
systemd-timesyncd Synchronizing Server Time
Installation
apt purge ntp chrony
apt update
apt install systemd-timesyncd
Configuration
nano /etc/systemd/timesyncd.conf
[Time]
NTP=time.cloudflare.com time.apple.com time.windows.com
(If your machine is located in Mainland China)
[Time]
NTP=ntp.ntsc.ac.cn ntp.aliyun.com ntp.tencent.com
Restart the service
systemctl restart systemd-timesyncd
Set RTC to UTC
timedatectl set-local-rtc 0
Set the server to UTC+8
timedatectl set-timezone Asia/Shanghai
Check the running status
timedatectl
Quickly Set Up socks5 with Docker
For installing Docker, you can jump to: Detailed Process and Basic Commands for Installing Docker on Linux
Alternatively:
curl -fsSL https://get.docker.com | bash -s docker
Pull and run the image
docker run -d --name socks5 --restart=unless-stopped -p <PROXY_PORT>:1080 -e PROXY_USER="<PROXY_USER>" -e PROXY_PASSWORD="<PROXY_PASSWORD>" serjs/go-socks5-proxy
<PROXY_PORT>是外部访问端口
<PROXY_USER>是连接用户名
<PROXY_PASSWORD>是连接密码 (设置长一点,推荐16位数字+混合大小写起步)
Realm Port Forwarding
Download the file
wget -O realm.tar.gz https://github.com/zhboner/realm/releases/download/v2.9.3/realm-x86_64-unknown-linux-gnu.tar.gz
Extract and grant execution permissions
tar -xvf realm.tar.gz
chmod +x realm
mv realm /usr/local/bin/
Create configuration file
mkdir -p /etc/realm
nano /etc/realm/config.toml
Write the configuration
[network]
no_tcp = false # 是否关闭 TCP
use_udp = true # 是否开启 UDP
[[endpoints]]
listen = "0.0.0.0:22" # 中转监听端口
remote = "1.1.1.1:22" # 目标服务器 IP:端口
[[endpoints]]
listen = "0.0.0.0:3389" # 中转监听端口
remote = "3.3.3.3:3389" # 目标服务器 IP:端口
...
Configure system service
cat << EOF > /etc/systemd/system/realm.service
[Unit]
Description=Realm Network Relay
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/realm -c /etc/realm/config.toml
Restart=on-failure
RestartSec=5s
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
EOF
Run
systemctl daemon-reload
systemctl enable realm
systemctl start realm
systemctl status realm