From c96f229f9343592950182c40a0c28595cf2ad38a Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Tue, 12 Sep 2023 13:49:28 +0800 Subject: [PATCH] u --- nixhome-config.sh | 14 ++++++++++++-- nixhome-import.sh | 2 -- rclone-install.sh | 3 --- rclone-starter.sh | 30 ++++++++++++++++++++++++++++++ rclone-web.sh | 3 --- seafile-ignore.txt | 10 ++-------- temp-detect.sh | 7 +++++++ 7 files changed, 51 insertions(+), 18 deletions(-) delete mode 100755 nixhome-import.sh delete mode 100644 rclone-install.sh create mode 100644 rclone-starter.sh delete mode 100644 rclone-web.sh create mode 100644 temp-detect.sh diff --git a/nixhome-config.sh b/nixhome-config.sh index 2916015..950d075 100755 --- a/nixhome-config.sh +++ b/nixhome-config.sh @@ -50,7 +50,7 @@ then homescriptlist=".emacs .emacs.lisp .bashrc .bash_profile .gitignore" echo - echo "=== Copy or link scripts? to link, to copy, to omit:" + echo "=== Copy or link scripts? to link, to copy, to git import, to omit:" read -p ">>> " CopyOrLinkScripts if [ "$CopyOrLinkScripts" == 'l' ] then @@ -67,13 +67,23 @@ then then for homescript in $homescriptlist do - if [ -e "$homescript" ] + if [ -e "$homescript" ] || [ -L "$homescript" ] then mv $homescript $homescript.backup-$(date +%Y%m%dT%H%M%S) fi echo "--- Copying $NIXHOME/$homescript to $HomePath/$homescript ..." cp -r $NIXHOME/$homescript ./ done + elif [ "$CopyOrLinkScripts" == 'g' ] + then + for homescript in $homescriptlist + do + if [ -e "$homescript" ] || [ -L "$homescript" ] + then + mv $homescript $homescript.backup-$(date +%Y%m%dT%H%M%S) + fi + curl -sSLO https://git.faronear.org/npm/sysconfig/raw/branch/main/nixhome/$homescript + done else echo '--- Home scripts not changed.' fi diff --git a/nixhome-import.sh b/nixhome-import.sh deleted file mode 100755 index a39f152..0000000 --- a/nixhome-import.sh +++ /dev/null @@ -1,2 +0,0 @@ -curl -sSL https://git.faronear.org/npm/sysconfig/raw/branch/main/nixhome/.bashrc > ~/.bashrc -curl -sSL https://git.faronear.org/npm/sysconfig/raw/branch/main/nixhome/.emacs > ~/.emacs \ No newline at end of file diff --git a/rclone-install.sh b/rclone-install.sh deleted file mode 100644 index 0de5e93..0000000 --- a/rclone-install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -sudo -v ; curl https://rclone.org/install.sh | sudo bash diff --git a/rclone-starter.sh b/rclone-starter.sh new file mode 100644 index 0000000..f0e10e2 --- /dev/null +++ b/rclone-starter.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +echo "=== rclone to install, to sync, to web gui" +read -p ">>> " ACTION_TYPE +if [ "$ACTION_TYPE" = 'i' ] +then + sudo -v ; curl https://rclone.org/install.sh | sudo bash +elif [ "$ACTION_TYPE" = 's' ] +then + echo "rclone sync from source:" + read -p ">>> " SOURCE_PATH + echo "rclone sync to target:" + read -p ">>> " TARGET_PATH + echo "rclone sync with max-age:" + read -p ">>> " MAX_AGE + + echo + echo "*****************************" + echo "rclone sync $SOURCE_PATH $TARGET_PATH -P -L --create-empty-src-dirs --max-age=$MAX_AGE --exclude=._* --exclude=.DS_Store --exclude=node_modules" + echo "*****************************" + echo "Start cloning? for yes, for quit" + read -p ">>> " YES_OR_NOT + if [ "$YES_OR_NOT" = 'y' ] + then + rclone sync $SOURCE_PATH $TARGET_PATH -P -L --create-empty-src-dirs --max-age=$MAX_AGE --exclude=._* --exclude=.DS_Store --exclude={node_modules/,.deploy_git/,unpackage/} + fi +elif [ "ACTION_TYPE" = 'w' ] +then + rclone rcd --rc-web-gui +fi diff --git a/rclone-web.sh b/rclone-web.sh deleted file mode 100644 index 0c63993..0000000 --- a/rclone-web.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -rclone rcd --rc-web-gui diff --git a/seafile-ignore.txt b/seafile-ignore.txt index 16e5988..748ad87 100644 --- a/seafile-ignore.txt +++ b/seafile-ignore.txt @@ -47,14 +47,8 @@ pages4loader.json5 .deploy_git/ */.deploy_git/ -unpackage/dist/ -*/unpackage/dist/ - -unpackage/release/ -*/unpackage/release/ - -unpackage/cache/ -*/unpackage/cache/ +unpackage/ +*/unpackage/ Icon OneDrive/Icon diff --git a/temp-detect.sh b/temp-detect.sh new file mode 100644 index 0000000..8fbb4e7 --- /dev/null +++ b/temp-detect.sh @@ -0,0 +1,7 @@ +sudo apt install lm-sensors hddtemp psensor -y + +sudo sensors-detect + +sudo sensors + +sudo hddtemp /dev/sdb # run `fdisk -l` to get disk names \ No newline at end of file