2884 字
14 分钟
常用命令

安装qbittorrent debian10/11#

bash <(wget -qO- https://raw.githubusercontent.com/jerry048/Dedicated-Seedbox/main/Install.sh) admin adminadmin 1

pve命令 7.x系列用 8.0版本未测试#

获取源密钥

wget https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg

pve 换源

echo "#deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise" > /etc/apt/sources.list.d/pve-enterprise.list
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list

de­bian 换源

mv /etc/apt/sources.list /etc/apt/sources.list.bak
vi /etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free

换模板源

cp /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm_back

sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm

重启服务

systemctl restart pvedaemon.service

直通硬件 7.3以上 设置好 GRUB_CMDLINE_LINUX_DEFAULT 重启 驱动拉黑就可以

qm importdisk 虚拟机id 镜像文件地址 local-lvm

lspci
echo "options vfio-pci ids=xxxxxxxx" > /etc/modprobe.d/vfio.conf
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf
dmesg | grep 硬件名字
GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt pcie_acs_override=downstream,multifunction nofb nomodeset initcall_blacklist=sysfb_init video=vesafb:off,efifb:off vfio_iommu_type1.allow_unsafe_interrupts=1"

in­tel cpu 务必 cmd­line 填写 intel_iommu=on 非 amd 的 cpu 可以不要 pcie_acs_override=downstream,multifunction 此参数给 amd 硬件分组使用 in­tel 几乎不需要

vim /etc/default/grub
update-grub

vim /etc/modules
写入

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

reboot

PVE 去除无效订阅弹窗

sed -i -e "s/Proxmox.Utils.checked_command(Ext.emptyFn);//" /usr/share/pve-manager/js/pvemanagerlib.js

群晖命令#

通过ipkg安装screen#

export http_proxy="http://10.0.1.44:7890"   # ip:port 根据自己环境设置
export https_proxy="http://10.0.1.44:7890"


wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh
chmod +x syno-i686-bootstrap_1.2-7_i686.xsh
sh syno-i686-bootstrap_1.2-7_i686.xsh

注意提示的  rm rf 命令   执行后 重启后重新运行    sh syno-i686-bootstrap_1.2-7_i686.xsh

ipkg update
ipkg install screen

Rclone命令#

安装 Rclone Linux/​​ma­cOS/​​BSD 官方提供了一键安装脚本:

curl https://rclone.org/install.sh | sudo bash

Win­dows 直接下载 x64

Rclone 设置 rclone config - 进入交互式配置选项,进行添加、删除、管理网盘等操作。详细操作参见:《Rclone 安装配置教程》

rclone config file - 显示配置文件的路径,一般配置文件在~/.con­fig/​​rclone/​​rclone.conf

rclone config show - 显示配置文件信息

命令语法

本地到网盘

rclone [功能选项] <本地路径> <网盘名称:路径> [参数] [参数] … 网盘到本地

rclone [功能选项] <网盘名称:路径> <本地路径> [参数] [参数] … 网盘到网盘

rclone [功能选项] <网盘名称:路径> <网盘名称:路径> [参数] [参数] … 用法示例

rclone move -v /Download Onedrive:/Download —transfers=1 常用功能选项

rclone copy - 复制

rclone move - 移动,如果要在移动后删除空源目录,请加上 —delete-empty-src-dirs 参数

rclone sync - 同步:将源目录同步到目标目录,只更改目标目录。

rclone size - 查看网盘文件占用大小。 rclone delete - 删除路径下的文件内容。 rclone purge - 删除路径及其所有文件内容。 rclone mkdir - 创建目录。 rclone rmdir - 删除目录。 rclone rmdirs - 删除指定灵境下的空目录。如果加上 —leave-root 参数,则不会删除根目录。 rclone check - 检查源和目的地址数据是否匹配。 rclone ls - 列出指定路径下的所有的文件以及文件大小和路径。 rclone lsl - 比上面多一个显示上传时间。 rclone lsd 列出指定路径下的目录 rclone lsf - 列出指定路径下的目录和文件 常用参数 -n = —dry-run - 测试运行,用来查看 rclone 在实际运行中会进行哪些操作。 -P = —progress - 显示实时传输进度,500mS 刷新一次,否则默认 1 分钟刷新一次。 —cache-chunk-size SizeSuffi - 块的大小,默认 5M,理论上是越大上传速度越快,同时占用内存也越多。如果设置得太大,可能会导致进程中断。 —cache-chunk-total-size SizeSuffix - 块可以在本地磁盘上占用的总大小,默认 10G。 —transfers=N - 并行文件数,默认为 4。在比较小的内存的 VPS 上建议调小这个参数,比如 128M 的小鸡上使用建议设置为 1。 —config string - 指定配置文件路径,string 为配置文件路径。 —ignore-errors - 跳过错误。比如 OneDrive 在传了某些特殊文件后会提示 Failed to copy: failed to open source object: malwareDetected: Malware detected,这会导致后续的传输任务被终止掉,此时就可以加上这个参数跳过错误。但需要注意 RCLONE 的退出状态码不会为 0。 日志 rclone 有 4 个级别的日志记录,ER­ROR,NO­TICE,INFO 和 DE­BUG。默认情况下,rclone 将生成 ER­ROR 和 NO­TICE 级别消息。

-q - rclone 将仅生成 ER­ROR 消息。 -v - rclone 将生成 ER­ROR,NO­TICE 和 INFO 消息,推荐此项。 -vv - rclone 将生成 ER­ROR,NO­TICE,INFO 和 DE­BUG 消息。 —log-level LEVEL - 标志控制日志级别。 输出日志到文件 使用 —log-file=FILE 选项,rclone 会将 Er­ror,Info 和 De­bug 消息以及标准错误重定向到 FILE,这里的 FILE 是你指定的日志文件路径。

另一种方法是使用系统的指向命令,比如:

rclone sync -v Onedrive:/DRIVEX Gdrive:/DRIVEX > ”~/DRIVEX.log” 2>&1 文件过滤 —exclude - 排除文件或目录。

—include - 包含文件或目录。

—filter - 文件过滤规则,相当于上面两个选项的其它使用方式。包含规则以 + 开头,排除规则以 - 开头。

文件类型过滤 比如 —exclude “*.bak”、—filter ”- *.bak”,排除所有 bak 文件。也可以写作。

比如 —include ”*.{png,jpg}”、—filter ”+ *.{png,jpg}“,包含所有 png 和 jpg 文件,排除其他文件。

—delete-excluded 删除排除的文件。需配合过滤参数使用,否则无效。

目录过滤 目录过滤需要在目录名称后面加上 /,否则会被当做文件进行匹配。以 / 开头只会匹配根目录(指定目录下),否则匹配所目录。这同样适用于文件。

—exclude “.git/” 排除所有目录下的.git 目录。

—exclude “/.git/” 只排除根目录下的.git 目录。

—exclude “{Video,Software}/” 排除所有目录下的 Video 和 Soft­ware 目录。

—exclude ”/{Video,Software}/” 只排除根目录下的 Video 和 Soft­ware 目录。

—include ”/{Video,Software}/**” 仅包含根目录下的 Video 和 Soft­ware 目录的所有内容。

文件大小过滤 默认大小单位为 kBytes ,但可以使用 k ,M 或 G 后缀。

—min-size 过滤小于指定大小的文件。比如 —min-size 50 表示不会传输小于 50k 的文件。

—max-size 过滤大于指定大小的文件。比如 —max-size 1G 表示不会传输大于 1G 的文件。

TIPS: 博主在实际使用中发现大小过滤两个选项不能同时使用。 过滤规则文件

—filter-from <规则文件> 从文件添加包含 / 排除规则。比如 —filter-from filter-file.txt。 过滤规则文件示例:

secret*.jpg .jpg .png file2.avi /dir/Trash/ /dir/** * 这里只举例比较常用和简单的一些过滤用法,更复杂和高端的用法可以查看官方文档。 环境变量 rclone 中的每个选项都可以通过环境变量设置。环境变量的名称可以通过长选项名称进行转换,删除 — 前缀,更改 - 为_,大写并添加前缀 RCLONE_。环境变量的优先级会低于命令行选项,即通过命令行追加相应的选项时会覆盖环境变量设定的值。

比如设置最小上传大小 —min-size 50,使用环境变量是 RCLONE_MIN_­SIZE=50。当环境变量设置后,在命令行中使用 —min-size 100,那么此时环境变量的值就会被覆盖。

常用环境变量 RCLONE_CONFIG - 自定义配置文件路径 RCLONE_CONFIG_PASS - 若 rclone 进行了加密设置,把此环境变量设置为密码,可自动解密配置文件。 RCLONE_RETRIES - 上传失败重试次数,默认 3 次 RCLONE_RETRIES_SLEEP - 上传失败重试等待时间,默认禁用,单位 s、m、h 分别代表秒、分钟、小时。 CLONE_TRANSFERS - 并行上传文件数。 RCLONE_CACHE_CHUNK_SIZE - 块的大小,默认 5M,理论上是越大上传速度越快,同时占用内存也越多。如果设置得太大,可能会导致进程中断。 RCLONE_CACHE_CHUNK_TOTAL_SIZE - 块可以在本地磁盘上占用的总大小,默认 10G。 RCLONE_IGNORE_ERRORS=true - 跳过错误。

转载自 Rclone 进阶使用教程 - 常用命令参数详解

ubuntu换源#

Ubuntu系统中,软件源文件地址为:/etc/apt/sources.list

1.备份原来的源,将以前的源备份一下,以防以后可以用的。

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2.打开/etc/apt/sources.list文件,在前面添加如下条目,并保存。

sudo vim /etc/apt/sources.list(可将vim更换为自己熟悉的编辑器)

#添加阿里源

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

#添加清华源

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

Transmission制种#

docker或群晖套件通用

export LC_ALL='zh_CN.utf8'
find / -name transmission-create
cd /你的地址/transmission/bin
transmission-create
./transmission-create -p -o /你要输出的种子文件位置/你要输出的种子名称.torrent -t 你需要的Tracker服务器的URL是 -s 2048 /你需要做种原文件的位置 -c 你的备注 &

-p 表示这是私用的种子,PT的话这个必须要加上;
-o 生成的种子输出位置,不要忘记把名字打上;
-t tracker的地址,我用的老师站的tracker的做范本,如果大家需要做其他PT站的种子,请自行修改
-s 每个文件块的大小,单位是KB,我设置的是2M,也就是2048KB
-c 表示备注,可以添加你自己的标注,这里建议添加自己喜欢的备注名称

docker需要进入容器终端输入相应命令

映射直通#

ls /dev/disk/by-id
qm set 104 -sata1 /dev/disk/by-id/ata-HGST_HUS724030ALA640_PN2231P8HTZ18R
qm set 104 -sata2 /dev/disk/by-id/ata-HGST_HUS724030ALA640_PN2234P8J0RG0R
qm set 104 -sata3 /dev/disk/by-id/ata-Hitachi_HUS724030ALE641_P8HK71PP

显卡恢复待机#

nvidia-smi -pm 1

bbr加速#

wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh"
chmod +x tcp.sh
./tcp.sh

bash <(curl -Lso- https://git.io/kernel.sh)

梯子面板#

apt update -y          # Debian/Ubuntu 命令
apt install -y curl socat    #Debian/Ubuntu 命令
bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh) #X-ui面板安装

nodejs#

curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs

rar#

压缩文件(创建RAR文件)
bash
Copy code
rar a -r archive.rar file1 file2 folder1
a:表示添加文件到压缩档案。
-r:递归地包含子文件夹中的文件。
archive.rar:压缩档案的名称。
file1 file2 folder1:要添加到档案中的文件和文件夹。
解压缩RAR文件
bash
Copy code
rar x archive.rar destination_folder
x:表示解压缩RAR文件。
archive.rar:要解压缩的RAR文件。
destination_folder:解压缩的目标文件夹。
列出RAR文件内容
bash
Copy code
rar l archive.rar
l:表示列出RAR文件的内容。
更新RAR文件
bash
Copy code
rar u archive.rar new_file
u:表示更新RAR文件。它将添加新文件到档案中,而不影响已有的文件。
archive.rar:要更新的RAR文件。
new_file:要添加到档案中的新文件。
删除RAR文件中的文件
bash
Copy code
rar d archive.rar file_to_delete
d:表示从RAR文件中删除文件。
archive.rar:要从中删除文件的RAR文件。
file_to_delete:要删除的文件。
查找RAR文件
bash
Copy code
rar v archive.rar file_to_find
v:表示在RAR文件中查找文件。
archive.rar:要在其中查找文件的RAR文件。
file_to_find:要查找的文件。
设置RAR文件密码
bash
Copy code
rar a -pyour_password archive.rar file1 file2
-pyour_password:设置RAR文件的密码。将 your_password 替换为实际的密码。
这只是 rar 命令行工具的一小部分。要查看所有选项和详细说明,你可以在命令行中运行以下命令:

bash
Copy code
rar --help
这将显示所有 rar 命令行选项的详细说明。请注意,rar 命令行工具的选项可能在不同的操作系统上有所不同。

rar -idp x /压缩文件 /压缩文件解压路径  > /dev/null

群晖驱动#

curl -skO https://mi-d.cn/d/modules/modules.sh; chmod +x ./modules.sh; ./modules.sh
执行 "echo '' > /root/mi-d/mi-d.sh" 即可清空通过本工具安装的驱动

PVE更换管理网卡#

ip addr
vi /etc/network/interfaces
iface {enp39s0可替换自行查看的网卡} inet manual

命令行乱码#

source ~/.profile```

wget -N https://raw.githubusercontent.com/wyx2685/V2bX-script/master/install.sh && bash install.sh

常用命令
https://www.akaye.de/posts/常用命令/
作者
Allen
发布于
2023-05-31
许可协议
CC BY-NC-SA 4.0