前言

请输入图片描述

Debian系统简单安装qbittorrent-nox

qbittorrent因其高效的上传速率而深得广大PT玩家的喜爱,小白个人认为最简单的使用方法是直接docker-compose运行,正好最近有docker用不溜的老哥问能不能直接安装,当然可以,今天我来看看Debian系统如何安装qbittorrent-nox。

apt安装qbittorrent-nox

apt update -y
apt install qbittorrent-nox -y

配置qbittorrent-nox进程守护

作为小白,这里我们粗暴的使用root用户运行,大佬勿喷……

复制以下代码块的全部内容并一次性粘贴至 SSH 窗口:

cat << EOF > /etc/systemd/system/qbittorrent-nox.service
[Unit]
Description=qBittorrent Command Line Client
After=network.target

[Service]
Type=forking
User=root
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
ExecStop=/usr/bin/kill -w qbittorrent-nox
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

此处8080端口自定义即可。然后:

更新配置
systemctl daemon-reload
启动服务
systemctl start qbittorrent-nox
开机自启
systemctl enable qbittorrent-nox
查看状态
systemctl status qbittorrent-nox

至此,在浏览器中输入服务器的IP和qbittorrent-nox的端口就可以进入了,用户名是admin,用户密码:adminadmin。强烈建议进去之后,立马修改用户名和用户密码。

后续

用户问题

刚刚我们说了,小白直接粗暴地使用root用户,但是安全意识强的老哥肯定不会这样,而是使用相关用户来运行qb,这里就又设计的用户和用户组权限的问题了,我们大概看下吧:

  1. 添加专属的qbittorrent-nox用户组

    adduser --system --group qbittorrent-nox # Debian 11及旧版本
    adduser --home /home/qbittorrent-nox --system --group qbittorrent-nox # Debian 12新版本
  2. 将当前用户添加进qbittorrent-nox用户组中,注意: “your-username”是你当前用户的名字,比如root账户就是root,ubuntu账户就是ubuntu,可以通过命令whoami获取。

    adduser your-username qbittorrent-nox
  3. 与之相对应的进程守护文件也要稍微修改下:

    cat << EOF > /etc/systemd/system/qbittorrent-nox.service
    [Unit]
    Description=qBittorrent Command Line Client
    After=network.target
    
    [Service]
    Type=forking
    User=qbittorrent-nox 
    Group=qbittorrent-nox
    ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
    ExecStop=/usr/bin/kill -w qbittorrent-nox
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    EOF

qbittorrent-nox-static

apt源的qb版本不是最新的,我们也可以通过开源项目qbittorrent-nox-static来安装新版的qb,项目地址如下:https://github.com/userdocs/qbittorrent-nox-static’]qbittorrent-nox-static

  1. 下载:

我们可前往项目主页下载最新版本,最新版本为qbittorrent 4.6.2 libtorrent 2.0.9,我们直接下载:

# 下载qbittorrent-nox二进制文件,并放到/usr/local/bin目录下面
wget -qO /usr/local/bin/qbittorrent-nox https://github.com/userdocs/qbittorrent-nox-static/releases/download/release-4.6.2_v2.0.9/$(uname -m)-qbittorrent-nox
# 二进制文件700权限
chmod 700 /usr/local/bin/qbittorrent-nox
  1. 添加进程守护:
cat << EOF > /etc/systemd/system/qbittorrent-nox.service
[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
Type=forking
User=root
ExecStart=/usr/local/bin/qbittorrent-nox -d --webui-port=8080
ExecStop=/usr/bin/kill -w qbittorrent-nox
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF

一键安装clouddrive2

curl -fsSL "//https://raw.githubusercontent.com/cshczh/clouddrive2/main/cd2.sh" | bash -s install

感谢蝈蝈大佬开发的 mtk_uartboot 工具,这样就可以随便刷砖了
适用系列:MediaTek MT7622、MT7981、MT7986、MT7988 SoC

1.下载工具

地址:https://github.com/981213/mtk_uartboot/releases
Windows 用户选择 mtk_uartboot-x86_64-pc-windows-msvc.zip
Linux 用户选择 mtk_uartboot-x86_64-unknown-linux-gnu.tar.gz

手动编译(Linux)

不打算自己构建工具请忽略此节
首先自行安装 rust 编译环境,我这里用的是 ubuntu

sudo apt install aptitudesudo aptitude install rust-all

开始构建(以在 x86 上运行为例):

git clone https://github.com/981213/mtk_uartboot && cd mtk_uartbootcargo build --verbose --locked --release --target x86_64-unknown-linux-gnu

目标文件:target/x86_64-unknown-linux-gnu/release/mtk_uartboot

2. 编译 ATF (RAM Boot)

不打算自己编译 bl2 请忽略此节

手动编译(Linux)

git clone -b mtksoc --single-branch https://github.com/mtk-openwrt/arm-trusted-firmware
cd arm-trusted-firmware

开启RAM Boot需要打个小补丁:

--- a/plat/mediatek/apsoc_common/bl2/Config-uart_dl.in
+++ b/plat/mediatek/apsoc_common/bl2/Config-uart_dl.in
@@ -10,7 +10,7 @@ config _RAM_BOOT_RAM_BOOT_UART_DL     bool "Enable RAM boot UART download support"
     depends on _BOOT_DEVICE_RAM     depends on !_RAM_BOOT_DEBUGGER_HOOK
-    depends on _INTERNAL
+    # depends on _INTERNAL
     default n  # Makefile options

然后就可以选择构建目标了(以MT7981 DDR3内存为例):

Advanced boot device configuration里面
选中Enable RAM boot UART download support

注意:MT7981B需要在Advanced DRAM configurations里面选择
内存封装为BGA,默认是QFN,不改此项刷入 bl2 必砖

开始构建:make CROSS_COMPILE=aarch64-linux-gnu-
目标文件:build/mt7981/release/bl2.bin

3.开始救砖

我这里提供一份预先构建的 bl2:https://www.lanzouw.com/ioTYu1pvi23g
涵盖 MT7622、MT7981、MT7986 DDR3/4MT7988 没试过,不知道
MT7981 DDR3内存为例开始救砖:

Linux 上:

注意:此时不能有其它程序访问/dev/ttyUSB0
其中fip.bin为某个机子的 uboot,/dev/ttyUSB0为连接至路由器 UART 的串口

sudo ./mtk_uartboot -s /dev/ttyUSB0 -p mt7981/mt7981-ddr3-bl2.bin -a -f fip.bin --brom-load-baudrate 921600 --bl2-load-baudrate 1500000

如果你的串口承受不了 1500000 的波特率,那么请将--brom-load-baudrate--bl2-load-baudrate设置成 115200

sudo ./mtk_uartboot -s /dev/ttyUSB0 -p mt7981/mt7981-ddr3-bl2.bin -a -f fip.bin --brom-load-baudrate 115200 --bl2-load-baudrate 115200


打印Received FIP后使用串口工具访问串口,此时会打印Hit any key to stop autoboot
操作上下键分别选择Upgrade ATF BL2Upgrade ATF FIP即可完成救砖

Windows 上:

注意:此时不能有其它程序访问COM4
其中fip.bin为某个机子的 uboot,COM4为连接至路由器 UART 的串口

.\mtk_uartboot.exe -s COM4 -p .\mt7981\mt7981-ddr3-bl2.bin -a -f fip.bin --brom-load-baudrate 921600 --bl2-load-baudrate 1500000

如果你的串口承受不了 1500000 的波特率,那么请将--brom-load-baudrate--bl2-load-baudrate设置成 115200

.\mtk_uartboot.exe -s COM4 -p .\mt7981\mt7981-ddr3-bl2.bin -a -f fip.bin --brom-load-baudrate 115200 --bl2-load-baudrate 115200

打印Received FIP后使用串口工具访问串口,操作上下键进入Boot Menu完成救砖

转载至:暗云

Docker-compose的官方库

首先安装docker

一键安装docker

curl -fsSL https://get.docker.com | bash -s docker

安装docker-compose


sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

安装完成后,你可以通过运行以下命令来验证安装是否成功:

docker-compose --version

然后就可以愉快的使用docker-compose了

在Linux上挂载WebDAV,您可以使用davfs2工具来实现。以下是具体的步骤:

安装davfs2工具:
在终端中运行以下命令来安装davfs2工具:

sudo apt-get install davfs2

配置davfs2:
在终端中运行以下命令来编辑davfs2的配置文件:

sudo nano /etc/davfs2/davfs2.conf

确保配置文件中有以下配置项并取消注释:

# Uncomment the following line if you want to enable caching
use_locks       0

创建本地挂载点:
在终端中运行以下命令来创建一个本地挂载点:

sudo mkdir /mnt/webdav

挂载WebDAV:
在终端中运行以下命令来挂载WebDAV:

sudo mount -t davfs http://webdav_server_address /mnt/webdav

在执行以上命令时,将http://webdav_server_address替换为您要连接的WebDAV服务器的地址。

输入用户名和密码:
当提示输入用户名和密码时,请输入您的WebDAV服务器的用户名和密码。

挂载成功后,您可以通过/mnt/webdav目录来访问和管理WebDAV服务器上的文件。如果您想要卸载WebDAV,可以使用以下命令:

sudo umount /mnt/webdav

转载至:亿速云

太烦了,之前去开 lightsail 的机器,每次都不能使用密码登陆,然后在网上翻来翻去找到了这篇来自萌咖的文章。

将下面代码中的第一句中的 Vicer 改为自己将要设置的密码.
否则默认root密码为Vicer.
创建instance时,点击add launch script,将下列代码复制进去(注意更改 root 密码)如下图所示.

echo root:Vicer |sudo chpasswd root
sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo reboot

对于 EC2,GCE 等机器也可以使用.

如果是甲骨文的机器,只能使用 root + 密码登录 SSH,root + SSH 密匙登录仍然提示:Please login as the user “opc” rather than the user “root”.
无意中发现玄机其实在 /root/.ssh/authorized_keys 里面。打开这个文件,里面是这样子:

no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"opc\" rather than the user \"root\".';echo;sleep 10" ssh-rsa ooxxxxxx55524242442……此处省略 1024 万字 ……
ssh-ras XXX 为初始化实例时添加的 SSH 公钥,亲测,把 authorized_keys 多余的代码:

no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"opc\" rather than the user \"root\".';echo;sleep 10"
去掉,就可以愉快的使用 root + SSH 密匙登录。

P.S 如果不使用秘钥登录或者后面会使用秘钥登录,直接把 authorized_keys 全部删掉也是可以的

不能添加代码的机器,可以登录进 ssh,再执行上面的代码.
也可以开启 root 登陆.
以上代码在 Debian/Ubuntu 上通过测试.
其他发行版自行测试.