This commit is contained in:
Luk 2024-09-14 12:13:01 +08:00
parent 9992fb331a
commit c23af842fd
6 changed files with 177 additions and 12 deletions

109
.gitignore vendored Normal file
View File

@ -0,0 +1,109 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# how to include another gitignore?
# https://stackoverflow.com/questions/7005142/can-i-include-other-gitignore-file-in-a-gitignore-file-like-include-in-c-li
# https://github.com/github/gitignore
# https://github.com/SlideWave/gitignore-include?tab=readme-ov-file#examples
# https://gitignore.io
### .gitignore.global.txt ###
# Self defined pattern to ignore
?*.gitignore
?*.gitignore/
?*.gitignore.*
?*.gitignore.*/
*.gitomit
*.gitomit/
*.gitomit.*
*.gitomit.*/
# 保留
!.gitignore
!.gitignore.*
!.gitkeep
# 通用
.svn/
.deploy_git/
.idea/
.sass-cache/
.wrangler
/test/unit/coverage/
/test/e2e/reports/
node_modules/
*.aab
*.apk
*.ipa
*.min.js
*.min.css
*.min.html
*.iml
*.njsproj
*.ntvs*
*.sw*
*.sln
*.suo
.gitattributes
.umi
.umi-production
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
selenium-debug.log
Thumbs.db
thumbs.db
_desktop.ini
# vue-cli 项目
/dist/
# 来自 vue-cli 创建项目的 .gitignore
.project
# hexo
/public/
# Hardhat
/artifacts/
/cache/
# seafile 临时文件
._*
.$*
# office 暂存文件
~$*
# 用户shell配置脚本
.bashrc_custom
# 苹果系统临时文件
.DS_Store
# 安卓缓存文件夹
.thumbnails
# local env files
.env.local
.env.*.local
# hexo
/db.json
# wo
# 服务端
/_archive/*
/_datastore/*
/_filestore/*
/_logstore/*
/_webroot/*
/_ssl/*
# uniapp 客户端
/unpackage/*
!/unpackage/res/
package-lock.json
pages4loader.json5
### .gitignore.local.txt ###

View File

@ -24,7 +24,7 @@ sed -i "s|/home/$NewUser:$|/home/$NewUser:/bin/bash|g" /etc/passwd
echo "=== Allow the new user [[$NewUser]] to sudo without password? [y] for yes, [anything else] for no"
read -p ">>> " AllowSudo
if [ "$AllowSudo" == "y" ]
if [ "$AllowSudo" = "y" ]
then
#usermod -a -G sudo $NewUser # Add to sudo group # Option 1: add user to %sudo group
echo "$NewUser ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/${NewUser//./-} # Option 2: add a user file into /etc/sudoers.d/

View File

@ -1,7 +1,7 @@
echo "=== Install formulaes and casks, enter [y] for Yes, [anything else] for No:"
echo
formulaeList=(jq openssl pandoc speedtest-cli yt-dlp)
formulaeList=(jq openssl pandoc rclone speedtest-cli yt-dlp)
for APP in "${formulaeList[@]}"
do
echo "--- brew install $APP"
@ -15,10 +15,10 @@ do
echo
done
caskList=(appcleaner avidemux baidunetdisk cloudflare-warp cursor douyin drawio emacs futubull iina iterm2 lx-music miniconda obs poe qq seafile-client shotcut spacelauncher sqlitestudio telegram-desktop telegram-lite termius thunder warp wechat)
caskList=(appcleaner avidemux baidunetdisk cloudflare-warp cursor discord douyin drawio emacs futubull iina iterm2 lx-music miniconda obs poe qq seafile-client shotcut spacelauncher sqlitestudio telegram-desktop telegram-lite termius thunder warp wechat)
for APP in "${caskList[@]}"
do
echo "--- brew install $APP"
echo "--- brew install $APP --cask"
read -p ">>> " YN
if [ "$YN" = 'y' ]
then

24
npm-registry.sh Normal file
View File

@ -0,0 +1,24 @@
echo 1. npm config set registry https://registry.npmmirror.com
echo 2. 命令行指定: npm --registry https://registry.npmmirror.com info underscore
echo 3. edit ~/.npmrc: registry=https://registry.npmmirror.com
echo 4. 使用 nrm 管理 registry 地址:
echo npm install -g nrm
echo nrm add taobao https://registry.npmmirror.com
echo nrm use taobao
echo nrm ls
echo nrm current
echo
echo "=== npm config get registry ==> $(npm config get registry)"
echo
echo "=== npm config set registry \n [c] China, \n [w] World, [anything else] to quit"
read -p ">>> " TARGET
if [ "$TARGET" = 'c' ]
then
npm config set registry https://registry.npmmirror.com
elif [ "$TARGET" = 'w' ]
then
npm config set registry https://registry.npmjs.org
fi
echo
echo "=== npm config get registry ==> $(npm config get registry)"

View File

@ -9,6 +9,9 @@ else
read -p ">>> " proxySwitch
fi
# to reset port to empty, otherwise the second run of this script will not ask for port.
PORT=
# function proxy() {
if [ "$proxySwitch" == "s" ] || [ "$proxySwitch" == "1" ]; then
echo "=== Proxy server running on [port number] or [leave blank] for default 7897"

View File

@ -1,6 +1,6 @@
#!/bin/bash
echo "=== rclone [i] to install, [s] to sync, [c] to copy, [w] to web gui"
echo "=== rclone [i] to install, [s] to sync, [c] to copy, [w] to web gui, [else] to quit"
read -p ">>> " ACTION_TYPE
if [ "$ACTION_TYPE" = 'i' ]
then
@ -10,26 +10,55 @@ then
if [ "$ACTION_TYPE" = 's' ]
then
RC_CMD='sync'
elif [ ]
elif [ "$ACTION_TYPE" = 'c' ]
then
RC_CMD='copy'
fi
read -p "rclone $RC_CMD from source >>> " SOURCE_PATH
read -p "rclone $RC_CMD into target >>> " TARGET_PATH
# read -p "rclone $RC_CMD with max-age >>> " MAX_AGE ## 发现用了 max-age 并没有提升速度,反而略有下降,即使对大量现有文件和少量更新文件
read -p "rclone $RC_CMD excluding (folders must end with /) >>> " EXCLUDING
echo
echo "=== from source (default ./)"; read -p ">>> " SOURCE_PATH; if [ ! "$SOURCE_PATH" ]; then SOURCE_PATH="./"; fi
echo
while [ ! "$TARGET_PATH" ]
do
echo "=== to target [remote:path]"
read -p ">>> " TARGET_PATH
done
# read -p "rclone $RC_CMD with max-age >>> " MAX_AGE ## 发现用了 max-age 并没有提升速度,反而略有下降,即使对大量现有文件和少量更新文件
echo
echo "excluding files and folders (folders must end with /)"
read -p ">>> " EXCLUDING;
echo
echo "with [number] files in parallel, default 4"
read -p ">>> " TRANSFERS;
if [ ! "$TRANSFERS" ]; then TRANSFERS=4; fi
echo
echo "with [number] threads simultaneously, default 4";
read -p ">>> " THREADS;
if [ ! "$THREADS" ]; then THREADS=4; fi
FULL_CMD="rclone $RC_CMD $SOURCE_PATH $TARGET_PATH -P -L --transfers=$TRANSFERS --multi-thread-streams=$THREADS --create-empty-src-dirs --exclude=._* --exclude=.DS_Store --exclude={node_modules/,.deploy_git/,unpackage/,$EXCLUDING}"
echo
echo "*****************************"
echo "rclone $RC_CMD $SOURCE_PATH $TARGET_PATH -P -L --create-empty-src-dirs --exclude=._* --exclude=.DS_Store --exclude={node_modules/,.deploy_git/,unpackage/,$EXCLUDING}"
echo $FULL_CMD
echo "*****************************"
echo
echo "Starting? [y] for yes, [anything else] for quit"
read -p ">>> " YES_OR_NOT
echo
if [ "$YES_OR_NOT" = 'y' ]
then
echo "****************** [rclone $RC_CMD] Start: `date -u -Iseconds` *****************"
rclone $RC_CMD $SOURCE_PATH $TARGET_PATH -P -L --create-empty-src-dirs --exclude=._* --exclude=.DS_Store --exclude={node_modules/,.deploy_git/,unpackage/,$EXCLUDING}
$FULL_CMD
echo "****************** [rclone $RC_CMD] Start: `date -u -Iseconds` *****************"
echo
rclone ls $TARGET_PATH
fi
elif [ "ACTION_TYPE" = 'w' ]
then