每月 Shaarli
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
Combine expressions, clothing, hair styles and colors into billions of different unique characters.
#!/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
}
frp official website
和男朋友吵架吵得不可开交?跟人争论得面红耳赤难分高下?你们需要分歧终端机!说出你们的分歧,让3个AI判官帮你们评评理到底谁对谁错。
首先,安装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 alist