type
status
date
slug
summary
tags
category
icon
password
URL
备份docker
rm /mnt/user/appdata/docker-compose.yml
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose $(docker ps -aq) > /mnt/user/appdata/docker-compose.yml
挂载Alist
#!/bin/bash
web_dir='xiaoya:/'
local_dir='/mnt/user/Plex/temp'
rclone mount $web_dir $local_dir --allow-other --allow-non-empty --attr-timeout 5m --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --vfs-read-chunk-size-limit 100M --buffer-size 100M --daemon
#!/bin/bash
web_dir='xiaoya-new:/'
local_dir='/mnt/user/Plex/xiaoya'
rclone mount $web_dir $local_dir --allow-other --attr-timeout 5m --vfs-cache-mode off --vfs-cache-max-age 24h --vfs-read-chunk-size-limit 100M --buffer-size 100M --daemon --header "Referer:"
#!/bin/bash
web_dir='aliyun:/'
local_dir='/mnt/user/Plex/temp'
rclone mount $web_dir $local_dir --allow-other --allow-non-empty --attr-timeout 5m --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --vfs-read-chunk-size-limit 100M --buffer-size 100M --daemon
解挂alist
#!/bin/bash
fusermount -qzu /mnt/user/Plex/temp/
P4显卡休眠
#!/bin/bash
#check for driver
command -v nvidia-smi &> /dev/null || { echo >&2 "nvidia driver is not installed you will need to install this from community applications ... exiting."; exit 1; }
echo "Nvidia drivers are installed"
echo
echo "I can see these Nvidia gpus in your server"
echo
nvidia-smi --list-gpus
echo
echo "-------------------------------------------------------------"
#set persistence mode for gpus ( When persistence mode is enabled the NVIDIA driver remains loaded even when no active processes,
#stops modules being unloaded therefore stops settings changing when modules are reloaded
nvidia-smi --persistence-mode=1
#query power state
gpu_pstate=$(nvidia-smi --query-gpu="pstate" --format=csv,noheader);
#query running processes by pid using gpu
gpupid=$(nvidia-smi --query-compute-apps="pid" --format=csv,noheader);
#check if pstate is zero and no processes are running by checking if any pid is in string
if [ "$gpu_pstate" == "P0" ] && [ -z "$gpupid" ]; then
echo "No pid in string so no processes are running"
fuser -kv /dev/nvidia*
echo "Power state is"
echo "$gpu_pstate" # show what power state is
else
echo "Power state is"
echo "$gpu_pstate" # show what power state is
fi
echo
echo "-------------------------------------------------------------"
echo
echo "Power draw is now"
#Check current power draw of GPU
nvidia-smi --query-gpu=power.draw --format=csv
exit
商店挂梯子
#!/bin/bash
cd /mnt/user/appdata/proxy
chmod -R 777 proxy.sh
./proxy.sh on
开机加载虚拟机图标
#!/bin/bash
#this script works with icon_banner downloader
#It syncs the vm icon store on icon store folder on array with /usr/local/emhttp/plugins/dynamix.vm.manager/templates/images
#set location on server for download of icons same location as icon_banner downloader else script will not work
downloadlocation="/boot/ico"
#do not change anything below this line
dirstore=$downloadlocation""
#check if above location exist
if [ ! -d $dirstore ] ; then
echo "$dirtemp does not exist please check you have icon_banner downloader script installed and run at least once and downloadlocation is set in this script the same "
else
echo "Ok evrything looks how it should. Syncing vm icon store with dynamix.vm.manager "
fi
rsync -a $dirstore/* /usr/local/emhttp/plugins/dynamix.vm.manager/templates/images
sleep 5
exit
- 作者:Wilson Zeng
- 链接:https://wilsonzeng.com/article/f042a907-60ca-4f0d-b7e4-e9d1a5af7812
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。