diff --git a/archived/mspc-quick-conn.sh b/archived/mspc-quick-conn.sh new file mode 100644 index 0000000000000000000000000000000000000000..7147f95c3a4bef6ec75ab8c02c357d5eb478a3b2 --- /dev/null +++ b/archived/mspc-quick-conn.sh @@ -0,0 +1,37 @@ +#!/bin/fish +set ip $argv[1] + +set pool " +4 52.225.221.93 +5 52.225.219.189 +6 68.154.25.86 +7 68.154.24.234 +lb2 40.79.34.210 +lb1 172.176.121.136 + +261 20.252.245.95 +262 20.168.171.4 +263 20.252.220.183 +26l 20.252.233.54 +#26l2 20.1.113.101 +26l2 proxy-cdn.recolic.net:30651 +" + +if not string match "*.*" $ip + if string match "*l*" $ip + set port 8888 # lb default port + else + set port 22 + end + set ip (echo $pool | grep "^$ip " | cut -d ' ' -f 2) + if string match "*:*" $ip + # ip contains port.. split it + set port (echo $ip | cut -d : -f 2) + set ip (echo $ip | cut -d : -f 1) + end + echo ADDR=$ip:$port +end + +echo "ERROR: PASSWORD CENSORED" +sshpass -p ___ ssh -o ServerAliveInterval=3 -p $port r@$ip + diff --git a/fish-config/functions/nupkg-repak.fish b/fish-config/functions/nupkg-repak.fish index 0313f74070b7e155b63820773868fa4eedfe7e30..e8934b3398d2ea07897a78385e5e1799f5f4b28f 100644 --- a/fish-config/functions/nupkg-repak.fish +++ b/fish-config/functions/nupkg-repak.fish @@ -3,7 +3,7 @@ set nu $argv[1] mkdir -p $nu.wd ; cd $nu.wd unzip ../$nu ; or unzip $nu ; or return 1 cd content/Redist -rm remote/*.lib ; rm remote/*.pdb ; cd .. +rm remote/*.lib ; rm remote/*.pdb ; rm -f remote/no-grpc/vfpremoteapi.lib ; cd .. zip -r r.zip Redist ; or return 2 echo "DONE. CHECK r.zip" end diff --git a/storage-server-backup-sh/README.md b/storage-server-backup-sh/README.md index 80c7d1698e2b903651edf7ce43647a0462a7878e..5fa84317903ba1fd581524d81ba6578544cf85bd 100644 --- a/storage-server-backup-sh/README.md +++ b/storage-server-backup-sh/README.md @@ -39,11 +39,11 @@ fish 3.x (to eval variable without `eval`) ## migration guide ``` -Copy the following things to new machine: +# Copy the following things to new machine: /root/.ssh /storage crontab -l -[optional] /etc/ssh (and restart sshd afterward) +# [optional] /etc/ssh (and restart sshd afterward) # If fish version < 3.0, install latest fish 3.x: apt install software-properties-common diff --git a/storage-server-backup-sh/check_extern.fish b/storage-server-backup-sh/check_extern.fish index 60595d1c53027a2f3bfbe87acbfd41a6acc45d11..0eba8246541951d0cbbedaaa7b0f704612ee9102 100644 --- a/storage-server-backup-sh/check_extern.fish +++ b/storage-server-backup-sh/check_extern.fish @@ -1,12 +1,14 @@ #!/bin/fish # check if necessary service for external users are running, and start them if not. -# note: tested 4.2GB (4404019200) file upload, webdav server works. +# note: tested 4.2GB (4404019200B) & 15GB file upload, webdav server works. if ps aux | grep [w]ebdav exit 0 # service already running end set EXTERN_WEBDAV_KEY _PLACEHOLDER_WEBDAV_KEY_ +# set EXTERN_DIR /storage/backups/extern # Not in use yet +set EXTERN_DIR /storage/tmp if not test -f /usr/bin/webdav set HTTP_PREFIX "https://recolic.net/hms.php?/softwares/bin/linux-amd64" @@ -17,7 +19,7 @@ end if not test -f /etc/webdav.yaml echo " -directory: /storage/backups/extern +directory: $EXTERN_DIR users: - username: extern password: $EXTERN_WEBDAV_KEY @@ -26,6 +28,6 @@ users: or exit 1 end -mkdir -p /storage/backups/extern/ +mkdir -p $EXTERN_DIR nohup /usr/bin/webdav --config /etc/webdav.yaml > /var/log/extern-server.log 2>&1 & disown diff --git a/storage-server-backup-sh/daily.fish b/storage-server-backup-sh/daily.fish index e632ddfc86d48a06b21dec6149c2c1ebc67c1b33..5e212db6ebc79a0dac605343d018cddf04fd493e 100755 --- a/storage-server-backup-sh/daily.fish +++ b/storage-server-backup-sh/daily.fish @@ -50,10 +50,10 @@ end ./old-backup-clean.exe /storage/backups # Send warning if running out of harddisk (less than 100GiB left) -# test (df -T | grep /storage | tr -s ' ' | cut -d ' ' -f 3,5 | sed 's/^.* //g') -lt 104857600 -# Modify the filter to make it working on base.lt1.recolic.net. time4vps mount 2TB HDD at / -test (df -T | grep /dev/ploop | tr -s ' ' | cut -d ' ' -f 3,5 | sed 's/^.* //g') -lt 104857600 - and email_notify "Backup system has low disk space. "(df -Th | grep /dev/ploop) +# Modify & test this when moving to new system. +set space_check_df_keyword /dev/mapper/ubuntu--vg-lv--root +test (df -T | grep $space_check_df_keyword | tr -s ' ' | cut -d ' ' -f 3,5 | sed 's/^.* //g') -lt 104857600 + and email_notify "Backup system has low disk space. "(df -Th | grep $space_check_df_keyword) # Not used by any extern user right now... But still worth keep it running. fish check_extern.fish