Home avatar

Lixp 的 Blog

部署aria2 Pro服务

docker run -d \
    --name aria2-pro \
    --restart unless-stopped \
    --log-opt max-size=50m \
    --network host \
    -e RPC_SECRET="密码" \
    -e RPC_PORT=6800 \
    -e LISTEN_PORT=6888 \
    -v $PWD/aria2/config:/config \
    -v $PWD/aria2/downloads:/downloads \
    p3terx/aria2-pro

Windows拼音添加小鹤双拼

将以下内容报错为add_xiaohe.reg, 然后执行:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\InputMethod\Settings\CHS]
"Enable Cloud Candidate"=dword:00000000
"Enable Dynamic Candidate Ranking"=dword:00000001
"EnableExtraDomainType"=dword:00000001
"Enable self-learning"=dword:00000001
"EnableSmartSelfLearning"=dword:00000001
"EnableLiveSticker"=dword:00000000
"Enable EUDP"=dword:00000001
"Enable Double Pinyin"=dword:00000001
"UserDefinedDoublePinyinScheme0"="小鹤双拼*2*^*iuvdjhcwfg^xmlnpbksqszxkrltvyovt"
"DoublePinyinScheme"=dword:0000000a

Python允许pip全局下载

python3.11以后默认不允许全局pip下载, 需要使用配置开启

pip config set global.break-system-packages true

或者可以用venv/poetry等虚拟环境工具创建环境, 不推荐直接pip下载到全局环境

Zerotier安装

# 安装
curl -s https://install.zerotier.com | sudo bash

# 设置 zerotier 开机自启
systemctl enable zerotier-one.service

# 启动 zerotier 服务
systemctl start zerotier-one.service

# 加入网络
zerotier-cli join xxxxx

# 加入中继
zerotier-cli orbit xxxx xxxx

首先:

Systemd管理服务

# 启动服务
sudo systemctl start docker

# 停止服务
sudo systemctl stop docker  

# 开机启动服务
sudo systemctl enable docker

# 禁止开机启动服务
sudo systemctl disable docker
[Unit]
Description=my_server # 服务名称
After=network.target

[Service]
Type=simple
User=ubuntu # 用户
Group=ubuntu # 用户组
WorkingDirectory=/home/ubuntu # 工作目录
ExecStart=/home/ubuntu/start.sh # 启动命令
Restart=on-failure # 异常重启机制 on-failure: 异常退出重启, always: 退出后总是重启

[Install]
WantedBy=multi-user.target

Netcat传输文件

# 接受端
nc -l -p 1234 > file.tar.gz

# 发送端
nc 192.168.1.1 1234 < file.tar.gz

适用于scp/rsync不能用的情况