折腾本腾
🗒️UNRAID常用脚本
00 分钟
2023-6-10
2023-6-10
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
 
 

评论
Loading...