23 私有链接
数字宝库致力于打造高质量资源百宝箱,为广大用户提供国内外优秀的软件、工具、插件、模板、素材,在这里您能找到涉及各行各业,种类繁多、流行前沿的数字宝藏
配置 DHCP
编辑 /etc/network/interfaces 文件,确保以下内容存在:
auto eth0
iface eth0 inet dhcp
重新启动网络接口:
/etc/init.d/networking restart
或者
ifup eth0
设置固定 IP 地址
编辑 /etc/network/interfaces 文件,添加如下配置:
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 1.1.1.1
重新启动网络接口:
/etc/init.d/networking restart
或者
ifup eth0
或者
rc-service networking restart
验证配置:
ip a以下是如何在 Alpine Linux 上使用 LVM 将您的三个磁盘(sda、sdb、sdc)合并为一个大卷的详细步骤
安装 LVM 工具:
apk add lvm2
为每个磁盘创建一个物理卷(Physical Volume, PV):
清除磁盘上的现有分区
wipefs -a /dev/sda
wipefs -a /dev/sdb
wipefs -a /dev/sdc
创建物理卷:
pvcreate /dev/sda
pvcreate /dev/sdb
pvcreate /dev/sdc
验证物理卷创建:
pvs
创建卷组(Volume Group, VG):
vgcreate vg0 /dev/sda /dev/sdb /dev/sdc
验证卷组创建:
vgs
创建逻辑卷(Logical Volume, LV):
lvcreate -n lv0 -l 100%FREE vg0
验证逻辑卷创建:
lvs
格式化逻辑卷:
mkfs.ext4 /dev/vg0/lv0
挂载逻辑卷:
mkdir /mnt/bigdisk
mount /dev/vg0/lv0 /mnt/bigdisk
验证挂载:
df -h | grep /mnt/bigdisk
自动挂载(可选):
编辑 /etc/fstab 文件并添加以下行:
/dev/vg0/lv0 /mnt/bigdisk ext4 defaults 0 2
可以使用以下命令测试 fstab 配置
mount -a
扩展逻辑卷:
添加新磁盘(假设为 /dev/sdd):
pvcreate /dev/sdd
vgextend vg0 /dev/sdd
扩展逻辑卷:
lvextend -l +100%FREE /dev/vg0/lv0
调整文件系统大小(对于 ext4):
resize2fs /dev/vg0/lv0
创建快照:
lvcreate -L 10G -s -n lv0_snapshot /dev/vg0/lv0
查看 LVM 状态:
vgdisplay
lvdisplay
pvdisplay
查看逻辑卷的使用情况:
df -h | grep /mnt/bigdisk
查看物理卷的使用情况:
使用 pvdisplay 命令查看每个物理卷的详细信息,包括已用空间和可用空间:
pvdisplay
这会显示您所有物理卷的信息,如 Free PE(表示剩余可用的物理扩展区)和 Allocated PE(已分配的物理扩展区)。
查看卷组的使用情况:
vgdisplay
在输出中,关注 Free PE 和 Allocated PE 字段。Free PE 表示剩余的空间,而 Allocated PE 是已经使用的空间。
查看逻辑卷的使用情况:
lvdisplay
这会显示每个逻辑卷的大小和使用情况。您可以查看 Allocated space 和 Free space 来了解已用和剩余空间。
判断磁盘是否已满:
如果 df -h 显示您的挂载点(如 /mnt/bigdisk)接近 100% 使用率,那么磁盘就可能满了。
如果在 pvdisplay、vgdisplay 或 lvdisplay 中看到 Free 空间非常小或为零,也说明磁盘空间接近用尽。
Combine expressions, clothing, hair styles and colors into billions of different unique characters.
和男朋友吵架吵得不可开交?跟人争论得面红耳赤难分高下?你们需要分歧终端机!说出你们的分歧,让3个AI判官帮你们评评理到底谁对谁错。
Bytebeat player with a collection of many formulas from around the internet
https://github.com/aria2/aria2/releases
apk add build-base git autoconf automake libtool pkgconf openssl-dev c-ares-dev libxml2-dev zlib-dev gnutls-dev sqlite-dev nettle-dev gmp-dev expat-dev bash
make clean
./configure \
--enable-libaria2 \
--with-openssl \
--with-sqlite3 \
--with-libxml2 \
--enable-static=yes \
LDFLAGS="-static"
make -j$(nproc)
make install
aria2.conf模板:
# 下载目录
dir=/var/lib/aria2/downloads
# 启用 RPC
enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true
rpc-listen-port=6800
# 保存会话
input-file=/etc/aria2/aria2.session
save-session=/etc/aria2/aria2.session
save-session-interval=60
# 下载设置
max-concurrent-downloads=5
split=16
continue=true
创建会话文件:
touch /etc/aria2/aria2.session
设置下载目录:
mkdir -p /var/lib/aria2/downloads
chown -R nobody:nobody /var/lib/aria2
创建服务文件/etc/init.d/aria2:
#!/sbin/openrc-run
description="Aria2 Daemon"
command="/usr/bin/aria2c"
command_args="--conf-path=/etc/aria2/aria2.conf --daemon=true"
pidfile="/run/aria2.pid"
start_stop_daemon_args="--chuid nobody:nobody"
设置可执行权限并添加到启动项:
chmod +x /etc/init.d/aria2
rc-update add aria2 default
rc-service aria2 start
rc-service aria2 status#!/sbin/openrc-run
command="/service/alist/alist"
command_args="server"
name="alist"
description="AList file server"
directory="/service/alist"
depend() {
need net
}
start() {
ebegin "Starting AList"
# 检查 AList 是否已经在运行,如果运行则不启动
if pgrep -f "$command $command_args" > /dev/null; then
ebegin "AList is already running"
eend 0
else
# 确保在正确的目录下启动 AList
cd "$directory" && $command $command_args &
# 等待进程启动并确认是否启动成功
sleep 2
if pgrep -f "$command $command_args" > /dev/null; then
ebegin "AList is running"
eend 0
else
ebegin "AList failed to start"
tail -n 10 /var/log/messages
eend 1
fi
fi
}
stop() {
ebegin "Stopping AList"
# 使用 pkill 来终止 AList 进程
pkill -f "$command $command_args"
eend $?
}
restart() {
stop
start
}
首先,安装git和pnpm:
https://git-scm.com/downloads/win
https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe
npm install -g pnpm
然后编译Alist的前端:
git clone --recurse-submodules https://github.com/alist-org/alist-web.git
pnpm install && pnpm build
或者直接下载编译好的前端:
https://github.com/AlistGo/alist-web
https://github.com/AlistGo/alist-web/releases/tag/3.41.0
然后下载Alist的源码放进AlpineLinux中编译(记得把前端放入./alist-3.41.0/public/dist/):
https://github.com/AlistGo/alist/releases
https://github.com/AlistGo/alist/archive/refs/tags/v3.41.0.tar.gz
tar -zxvf v3.41.0.tar.gz
cd ./alist-3.41.0/
正常编译命令:
appName="alist"
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
version=$(git describe --long --tags --dirty --always)
webVersion=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
ldflags="\
-w -s \
-X 'github.com/alist-org/alist/v3/internal/conf.BuiltAt=$builtAt' \
-X 'github.com/alist-org/alist/v3/internal/conf.GoVersion=$goVersion' \
-X 'github.com/alist-org/alist/v3/internal/conf.GitAuthor=$gitAuthor' \
-X 'github.com/alist-org/alist/v3/internal/conf.GitCommit=$gitCommit' \
-X 'github.com/alist-org/alist/v3/internal/conf.Version=$version' \
-X 'github.com/alist-org/alist/v3/internal/conf.WebVersion=$webVersion' \
"
go build -ldflags="$ldflags" .
精简编译命令:
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -trimpath
upx alistfrp official website
Parchive tool. Contribute to Yutaka-Sawada/MultiPar development by creating an account on GitHub.
PAR2
中国计算机技术职业资格网,软考入口
域名专场特惠,热门域名1元起