Compare commits

..

35 Commits

Author SHA1 Message Date
Luk
15dce0d298 u 2026-04-30 19:43:09 +08:00
Luk
d9beb54904 update nixhome/.ssh/authorized_keys 2026-04-29 09:42:03 +08:00
luk
2ba4bf530e u 2026-04-28 19:56:56 +08:00
luk
e0c2452562 add doomship key 2026-04-28 19:37:38 +08:00
Luk
a94b938ba6 update PS1 2026-04-28 17:10:35 +08:00
Luk
edd6f79702 rotate authorized_keys 2026-04-28 17:09:09 +08:00
Luk
8051d657ad [.bashrc] add newline in PS1 2026-04-28 16:34:45 +08:00
Luk
632b965357 rename https://git.tic.cc/open/ to /opx/ 2026-04-27 20:16:56 +08:00
Luk
bde475b433 u 2026-03-16 14:16:16 +08:00
Luk
c55b9931df u 2026-03-08 11:26:35 +08:00
Luk
4ffa88309e u 2026-03-07 20:22:14 +08:00
Luk
c723878a28 u 2026-03-07 15:53:59 +08:00
Luk
4cf98bc2cc u 2026-03-07 15:11:16 +08:00
Luk
d75c6b7d02 u 2026-02-24 11:20:15 +08:00
Luk
0d44ffbc99 u 2026-02-17 12:45:55 +08:00
Luk
9fad039627 u 2026-02-07 15:50:34 +08:00
Luk
aaff2c0a5f u 2026-02-07 15:08:00 +08:00
Luk
c8cd6ebd8e u 2026-02-07 15:06:52 +08:00
Luk
ac89a6b599 u 2026-02-07 15:02:03 +08:00
Luk
0fb47c30a2 u 2026-02-07 14:59:22 +08:00
Luk
fc75375f93 u 2026-02-07 14:58:14 +08:00
Luk
01ab07c7ea u 2026-02-07 14:56:25 +08:00
Luk
60e06abd72 u 2026-02-07 14:52:54 +08:00
Luk
13f6318023 rename /npm/ to /open/ 2026-02-06 19:36:57 +08:00
Luk
2a2be82375 u 2026-02-06 18:47:43 +08:00
luk
5920cde656 u 2026-02-01 19:17:14 +08:00
luk
f01868e246 u 2026-02-01 19:12:37 +08:00
root
dcb621ef20 add tailscale scripts 2026-01-31 00:21:06 +08:00
root
c5e6fdcbf5 add tailscale scripts 2026-01-31 00:17:02 +08:00
Luk
044bd6c8a3 u 2026-01-28 14:02:59 +08:00
Luk
a1d9d2a76f u 2026-01-28 13:02:05 +08:00
Luk
cc6789a9cc u 2026-01-27 21:32:50 +08:00
Luk
c8ef431ae3 u 2026-01-27 09:58:55 +08:00
Luk
d56cc243c1 u 2026-01-27 09:56:09 +08:00
Luk
002a4ccf5b u 2026-01-26 19:13:31 +08:00
50 changed files with 510 additions and 145 deletions

0
acme-install.sh Normal file → Executable file
View File

0
acme-setup.sh Normal file → Executable file
View File

0
acme-uninstall.sh Normal file → Executable file
View File

5
caddy-install.sh Normal file → Executable file
View File

@@ -9,3 +9,8 @@ sudo apt install caddy
echo
echo Certificates will be saved automatically in ~/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/
echo Config file of caddy started by systemctl : /etc/caddy/Caddyfile
# 202601 注意到 caddy 的 gpg.key 过时了,导致 apt update 报错。更新:
# https://github.com/caddyserver/caddy/issues/7411
# [Solved] Caddy's APT repo (ubuntu/debian) GPG key has expired · Issue #7411 · caddyserver/caddy
# curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg

0
conda-init.sh Normal file → Executable file
View File

0
conda-install.sh Normal file → Executable file
View File

View File

@@ -2,11 +2,11 @@ FROM debian:12.8
LABEL org.opencontainers.image.authors="luk"
RUN apt update && apt install curl -y
RUN curl -s https://git.tic.cc/npm/sysconfig/raw/branch/main/debian-setup.sh | bash
RUN curl -s https://git.tic.cc/opx/sysconfig/raw/branch/main/debian-setup.sh | bash
CMD bash
# mv $(basename "$0") Dockerfile
# mv $(basename $0) Dockerfile
# docker build -t debian-faronear .
# docker tag debian-faronear anolaxy/debian-faronear:11.5-20221205
# docker login

View File

@@ -1,6 +1,6 @@
#!/bin/bash
## "curl -s https://git.tic.cc/npm/sysconfig/raw/branch/main/debian-setup.sh | bash"
## "curl -s https://git.tic.cc/opx/sysconfig/raw/branch/main/debian-setup.sh | bash"
echo "Usage: this.sh [NewUser]"
echo "Example: this.sh alice"
@@ -26,7 +26,7 @@ echo "::*** Git cloning to /faronear/sysconfig"
git config --global credential.helper cache
if [ ! -d "/faronear/sysconfig" ]
then
git clone https://git.tic.cc/npm/sysconfig /faronear/sysconfig
git clone https://git.tic.cc/opx/sysconfig /faronear/sysconfig
chmod -R 755 /faronear # 确保其他用户能够读取 /faronear/sysconfig/nixhome/*
fi
echo

0
temp-detect.sh → detect-disk-temperature.sh Normal file → Executable file
View File

0
docker-install-debian.sh Normal file → Executable file
View File

0
docker-install-ubuntu.sh Normal file → Executable file
View File

View File

@@ -1,9 +1,9 @@
#!/bin/sh
echo "Usage:"
echo ' "this-script.sh [imageName]" to search library/[imageName]'
echo ' "this-script.sh [imageName] [ownerName]" to search [ownerName]/[imageName]'
echo ' "this.script.sh" to interactive enter [ownerName] and [imageName] to search'
echo " $(basename $0) [imageName] ===> to search library/[imageName]"
echo " $(basename $0) [imageName] [ownerName] ===> to search [ownerName]/[imageName]"
echo " $(basename $0) ===> to interactive enter [ownerName] and [imageName] to search"
echo
IMAGE=$1

View File

@@ -37,7 +37,7 @@ if [ $targetUrl ]
then
read -p "Enter adot password (ROAD) >>" PWD_ADOT
read -p "Enter root password (YU) >>" PWD_ROOT
expect ~/faronear/npm/sysconfig/expect-ssh.sh $targetUrl adot $PWD_ADOT $PWD_ADOT
expect ~/faronear/sysconfig/expect-ssh.sh $targetUrl adot $PWD_ADOT $PWD_ADOT
else
while [ ! "$HOST" ]
do

0
find-and-run-recursively.sh Normal file → Executable file
View File

View File

@@ -23,18 +23,18 @@ if not exist "%ROOTPATH%" (
echo √√√ ROOTPATH = [[%ROOTPATH%]]
)
echo ::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/.gitignore_global]]
set /p IGNOREPATH=">>> "
echo ::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global]]
set /p GLOBALPATH=">>> "
echo;
if "" == "%IGNOREPATH%" (
set IGNOREPATH=https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/.gitignore_global
if "" == "%GLOBALPATH%" (
set GLOBALPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global
) else (
for %P in (%IGNOREPATH%) do set "IGNOREPATH=%~dpnxP/.gitignore_global"
if not exist "%IGNOREPATH%" (
echo ××× [[%IGNOREPATH%]] not exist! Exit now. ***
for %P in (%GLOBALPATH%) do set "GLOBALPATH=%~dpnxP/.gitignore_global"
if not exist "%GLOBALPATH%" (
echo ××× [[%GLOBALPATH%]] not exist! Exit now. ***
@ GOTO END
) else (
echo √√√ IGNOREPATH = [[%IGNOREPATH%]]
echo √√√ GLOBALPATH = [[%GLOBALPATH%]]
)
)
@@ -48,7 +48,7 @@ for /d /r %%r in (*) do (
if exist "%%r\.git" (
pushd "%%r"
echo ---- updating .gitignore in [[%%r]] ----
cat %IGNOREPATH%\.gitignore %%r\.gitignore.local.txt > %%r\.gitignore
cat %GLOBALPATH%\.gitignore %%r\.gitignore.local.txt > %%r\.gitignore
echo;
popd
)

26
git-ignore-find2merge.sh Normal file → Executable file
View File

@@ -1,7 +1,7 @@
#!/bin/bash
echo ""
echo "Search in [ROOTPATH], merge [IGNOREPATH/.gitignore_global] and [ROOTPATH/*/.gitignore.local.txt] files to [seafile-ignore.txt]"
echo "Search in [ROOTPATH], merge [GLOBALPATH/.gitignore_global] and [ROOTPATH/*/.gitignore.local.txt] files to .gitignore"
echo ""
if [ -d "$1" ]
@@ -26,23 +26,23 @@ else
fi
echo ""
echo "::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/.gitignore_global]]"
read -p "***:: " IGNOREPATH
if [ "$IGNOREPATH" ]
echo "::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global]]"
read -p "***:: " GLOBALPATH
if [ "$GLOBALPATH" ]
then
if [ -d "$IGNOREPATH" ]
if [ -d "$GLOBALPATH" ]
then
IGNOREPATH=$(realpath $IGNOREPATH)/.gitignore_global
GLOBALPATH=$(realpath $GLOBALPATH)/.gitignore_global
fi
if [ ! -f "$IGNOREPATH" ]
if [ ! -f "$GLOBALPATH" ]
then
echo "××× Not found [[$IGNOREPATH]]. Exit now..."
echo "××× Not found [[$GLOBALPATH]]. Exit now..."
exit
else
echo "√√√ IGNOREPATH = [[$IGNOREPATH]]"
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
fi
else
IGNOREPATH=https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/.gitignore_global
GLOBALPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global
fi
echo ""
@@ -62,11 +62,11 @@ do
if [ -f "$repo/.gitignore" ] # some git repo need to keep privacy, therefore judge from .gitignore, not from .git
then
echo "---- updating [[$repo/.gitignore]] ----"
if [ -f "$IGNOREPATH" ]
if [ -f "$GLOBALPATH" ]
then
cat $IGNOREPATH > $repo/.gitignore
cat $GLOBALPATH > $repo/.gitignore
else
curl -sSL $IGNOREPATH | cat > $repo/.gitignore
curl -sSL $GLOBALPATH | cat > $repo/.gitignore
fi
cat $repo/.gitignore.local.txt 2>/dev/null >> $repo/.gitignore
echo ""

View File

@@ -1 +0,0 @@
echo `hostname -I` | awk '{print $1;}'

0
mac-accelerate-backup.sh Normal file → Executable file
View File

0
mac-autohide-dock.sh Normal file → Executable file
View File

0
mac-brew-apps.sh Normal file → Executable file
View File

0
mac-brew-install.sh Normal file → Executable file
View File

0
mac-brew-mirror.sh Normal file → Executable file
View File

83
mac-create-vdisk.sh Normal file → Executable file
View File

@@ -3,7 +3,7 @@
set -e
DISKNAME=vdisk
DISKSIZE=33554432 # 磁盘扇区数,每个扇区大小是 512 字节,n*1024*1024*1024/512 = n Gigabytes. Do NOT set the formula to DISKSIZE.
DISKSIZE=50331648 # 磁盘扇区数,每个扇区大小是 512 字节,1 Gigabytes 有 1024*1024*1024/512 = 2097152 扇区.
# 虚拟磁盘并不是一创建就把内存空间划走,而是等到真正写入了虚拟磁盘的时候,才会使用对应的内存空间,所以给虚拟磁盘分配大一点的空间是没有问题的
if [ -d /Volumes/$DISKNAME ]; then
@@ -13,6 +13,85 @@ else
diskutil apfs create ${DISKID} $DISKNAME
fi
# copy this script to some public folder, e.g. `sudo cp this-script.sh /etc/`, because in my test, it doesn't work in /Users/...
cat <<'EOF' > /Volumes/$DISKNAME/seafile-ignore.txt
# 特殊定制
*.mp4
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
*.sfignore
*.sfignore/
*.sfignore.*
*.sfignore.*/
*.sfomit
*.sfomit.*
*.sfomit/
*.sfomit.*/
*.nosf
*.nosf.*
*.nosf/
*.nosf.*/
## everything 'git pull or fetch' will update `.git/FETCH_HEAD`, even if the content doesn't change. To avoid too many useless updates of this file in Seafile history:
FETCH_HEAD
*/FETCH_HEAD
.Trash/
.Trashes/
.DS_Store
*/.DS_Store
*.aae # AAE 文件主要在苹果的照片应用程序中使用,保存对原始照片所做的编辑,比如,裁剪、旋转或调整亮度等操作的信息。
.thumbnails
*/.thumbnails
Thumbs.db
*/Thumbs.db
thumbs.db
*/thumbs.db
_desktop.ini
*/_desktop.ini
._*
*/._*
.$*
*/.$*
~$*
*/~$*
node_modules/
*/node_modules/
package-lock.json
*/package-lock.json
pages4loader.json5
*/pages4loader.json5
.deploy_git/
*/.deploy_git/
# next.js 项目
.next/
*/.next/
# HBuilder 目录
unpackage/
*/unpackage/
Icon
OneDrive/Icon
# wrangler project
.dev.vars*
*/.dev.vars*
.wrangler/
*/.wrangler/
EOF
# copy this script to some public folder, e.g. `sudo cp $(basename $0) /etc/`, because in my test, it doesn't work in /Users/...
# copy the corresponding plist file to /Library/LaunchDaemons/,
# optionally run `sudo launchctl load /Library/LaunchDaemons/my-launch-file.plist` immediately for test.

View File

@@ -0,0 +1,4 @@
cd /Library/Application\ Support/Microsoft/MAU2.0
# sudo chmod 000 Microsoft\ AutoUpdate.app
sudo mv Microsoft\ AutoUpdate.app Microsoft\ Autoupdate.disabled.app

0
mac-disable-store-files.sh Normal file → Executable file
View File

0
mac-remove-launchpad-icons.sh Normal file → Executable file
View File

0
mac-resize-launchpad.sh Normal file → Executable file
View File

12
myip.sh Executable file
View File

@@ -0,0 +1,12 @@
if [ "$(uname)" = "Darwin" ]; then
echo Local IP: $(ifconfig en0 | grep "inet " | awk '{print $2}')
elif [ "$(uname)" = "FreeBSD" ]; then
MYIPLAN='' # hostname -I not work in FreeBSD
else
echo Local IP: $(echo `hostname -I` | awk '{print $1;}')
fi
echo Public IP: `curl -s ifconfig.me`
echo
curl ipinfo.io

View File

@@ -53,7 +53,7 @@ if [ -d "$HomePath" ]; then
echo "--- Copying [[$NIXHOME/$homescript]] to [[$HomePath/$homescript]] ..."
cp -r "$NIXHOME/$homescript" ./
elif [ "$CopyOrLinkScripts" == 'g' ]; then
curl -sSLO "https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/$homescript"
curl -sSLO "https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/$homescript"
fi
done
@@ -74,23 +74,22 @@ if [ -d "$HomePath" ]; then
read -p "***:: " AuthorizedKeys
if [ "$AuthorizedKeys" = 'l' ]; then
if [ -f "$HomePath/.ssh/authorized_keys" ] || [ -L "$HomePath/.ssh/authorized_keys" ]; then
mv "$HomePath/.ssh/authorized_keys" "$HomePath/.ssh/authorized_keys.backup-$(date -u +%Y%m%dT%H%M%Sutc)"
fi
echo "--- Linking [[$NIXHOME/authorized_keys]] to [[$HomePath/.ssh/authorized_keys]] ..."
ln -s "$NIXHOME/.ssh/authorized_keys" "$HomePath/.ssh/authorized_keys"
sudo chmod 644 "$HomePath/.ssh/authorized_keys" # 确保其他用户能读取 nixhome/.ssh/authorized_keys
elif [ "$AuthorizedKeys" = 'a' ]; then
if [ -f "$HomePath/.ssh/authorized_keys" ] || [ -L "$HomePath/.ssh/authorized_keys" ]; then
mv "$HomePath/.ssh/authorized_keys" "$HomePath/.ssh/authorized_keys.backup-$(date -u +%Y%m%dT%H%M%Sutc)"
fi
echo "--- Copying [[$NIXHOME/authorized_keys]] to [[$HomePath/.ssh/authorized_keys]] ..."
cat "$NIXHOME/.ssh/authorized_keys" >> "$HomePath/.ssh/authorized_keys"
chmod 600 "$HomePath/.ssh/authorized_keys"
else
exit 0
fi
echo
if [ -f "$HomePath/.ssh/authorized_keys" ] || [ -L "$HomePath/.ssh/authorized_keys" ]; then
mv "$HomePath/.ssh/authorized_keys" "$HomePath/.ssh/authorized_keys.backup-$(date -u +%Y%m%dT%H%M%Sutc)"
fi
fi
popd

View File

@@ -19,7 +19,3 @@ unset USERNAME
################################################################################
# End Of File: "~/.bash_profile"
################################################################################
# Added by OrbStack: command-line tools and integration
# This won't be added again if you remove it.
source ~/.orbstack/shell/init.bash 2>/dev/null || :

View File

@@ -79,7 +79,7 @@ umask 022 # rwxr-xr-x
############## following settings copied from amazon's debian ####################
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
debian_chroot=$(cat /etc/debian_chroot)
fi
## uncomment for a colored prompt, if the terminal has the capability; turned
@@ -99,7 +99,7 @@ fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
xterm-color|*-256color) color_prompt=yes;;
esac
# color starts with \[\033[${Style};${Type}${Color}m\] and ends with \[\033[00m\].
@@ -124,29 +124,51 @@ esac
# - `7`: White
# others:
# \w shows absolute path, \W shows current folder.
if [ "$color_prompt" = yes ]; then
PS1='[\[\033[07;32m\]\t\[\033[00m\]#\[\033[07;35m\]\u\[\033[00m\]@\[\033[07;31m\]\h=$(uname)=$(uname -m)\[\033[00m\]::\[\033[07;34m\]\w\[\033[00m\]] '
MYIPPUB=$(curl -s ifconfig.me)
if [ "$(uname)" = "Darwin" ]; then
PSTYLE=07
PTYPE=3
elif [ "$(whoami)" = "root" ]; then
PSTYLE=07
PTYPE=4
AS_ROOT="#"
else
PS1='[\t#\u@\h($(uname)-$(uname -m)):\w] ' # \w shows absolute path, \W shows current folder.
PSTYLE=07
PTYPE=3
if [[ -n "$SSH_CONNECTION" ]]; then
IN_SSH="$"
fi
fi
if [ "$(uname)" = "Darwin" ]; then
MYOSVERSION=Mac`sw_vers -productVersion`
elif [ "$(uname)" = "FreeBSD" ]; then
MYOSVERSION=$(echo "$(uname -r)" | cut -d'-' -f1)
elif [ -f /etc/debian_version ]; then
MYOSVERSION=Deb`cat /etc/debian_version 2>/dev/null`
elif [ -f /etc/ubuntu_version ]; then
MYOSVERSION=Ubt`cat /etc/ubuntu_version 2>/dev/null`
fi
if [ "$color_prompt" = yes ]; then
PS1='<\[\033[$PSTYLE;${PTYPE}2m\]\t\[\033[00m\]#\[\033[$PSTYLE;${PTYPE}4m\]$MYIPPUB\[\033[00m\]^\[\033[$PSTYLE;${PTYPE}5m\]$(uname -m),$(uname),$MYOSVERSION\[\033[00m\]%\[\033[$PSTYLE;${PTYPE}2m\]\w\[\033[00m\]>\n<\[\033[$PSTYLE;${PTYPE}5m\]\u\[\033[00m\]@\[\033[$PSTYLE;${PTYPE}1m\]\h\[\033[00m\]%\[\033[$PSTYLE;${PTYPE}2m\]\W\[\033[00m\]> '
else
PS1='<\t#$MYIPPUB^$(uname -m),$(uname),$MYOSVERSION%\w>\n<\u@\h%\W> ' # \w shows absolute path, \W shows current folder.
fi
unset color_prompt force_color_prompt
############## above settings copied from amazon's debian ####################
if [ "$(uname)" = "Darwin" ]
then
if [ "$(uname -m)" = "arm64" ] && [ -f /opt/homebrew/bin/brew ]
then
if [ "$(uname)" = "Darwin" ]; then
if [ "$(uname -m)" = "arm64" ] && [ -f /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [ "$(uname -m)" = "x86_64" ] && [ -f /usr/local/homebrew/bin/brew ]
then
elif [ "$(uname -m)" = "x86_64" ] && [ -f /usr/local/homebrew/bin/brew ]; then
eval "$(echo $(/usr/local/homebrew/bin/brew shellenv) | sed 's#HOMEBREW_CELLAR=.*$#HOMEBREW_CELLAR=/usr/local/Cellar#')"
fi
fi
# nvm settings
if [ -d $HOME/.nvm ]
then
if [ -d $HOME/.nvm ]; then
# 注意,这句 export 导致 `su` 会继承原用户的环境变量 NVM_DIR=/home/原用户/.nvm可能导致不符合预期的行为。因此要 `su -` 更安全。
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@@ -159,13 +181,19 @@ fi
# eval "$(fnm env --use-on-cd)"
# fi
# acme.sh settings
# acme.sh
if [ -f $HOME/.acme.sh/acme.sh.env ]
then
. "$HOME/.acme.sh/acme.sh.env"
alias acme=$HOME/.acme.sh/acme.sh
fi
# Added by OrbStack: command-line tools and integration
if [ "$(uname)" = "Darwin" ] && [ -f $HOME/.orbstack/shell/init.bash ]
then
source ~/.orbstack/shell/init.bash 2>/dev/null || :
fi
# let MacOS uses the same variable so that vscode-sshfs can use "$USERPROFILE/.ssh/id_rsa" uniformly.
export USERPROFILE=$HOME
@@ -183,3 +211,4 @@ fi
################################################################################
# End Of File: "~/.bashrc"
################################################################################

View File

@@ -1,6 +1,2 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC20z+Vye8tcTjSrG8eLw54eEyabSc7/MGPzGa7/SKRPG6KP00hV38bZTg86mB4MGpY8MjJbK6GiEpCVGZAjm0bnDleqnkuGa9CpcNay0bAL+8g0Vvi3Vc9vJ9crmR735N4mjAQdgeGG1VCYXx3LAUsJavqVuOkRhAEQItpAb73oi4Ms7Oos9vdWLPDLjn7rZKM+iyi1n8zGwYXBlNzijzVZd/XXnb95mo36MBM+tySm5/aOIE6a11kX+74jKijh+1Ekz6Y1LMUm0j0mU0aJ0FCDVipIMZ0FI+W7l0RKNrIywIhI6d7CWAaJoDnaUKE+UMyJ7FRWeUrgyWxXWPJ7Kror5Won1HXlLhgb/IbITEM2mnCfJXd0JO9BurMDID3fYfANwsfFS7Av9/5RRbYv7Z/emJlkWfQhnzNzdo9rsU2p+7G+TTbmK6v7rlogUGtT55PGyOVBQNTjiPkijH2ulP/z8i/fqJwMINguysVztSR3Ouk7vxiZY+B4kZ6sh9Vvds= luk.lu@DoomBase
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDW8JpxQJX62DVuBnAMGD3L719PUsfHVAt5lAnAJDZl+QFbmtkOUPSi0YhyLBnf8eTn9W3I31mdoXWeQ4SvMWTixjgS/8J1wkLenPny/u3t5v4hgzJ+8rJEZONRLHxqqGz13ki3iScdziYlQtNezOTGFoNordRnDSmZcQdwrKLKSUrPr9xL6BW+j+yNp4yUxi6ePhZBp3SsEqVdn8rSJQQsVEkibkBNHzAM4lPWvaxK7XEpjC+jcTlDP7KYncwM85Tbn1G94AUcEiuGom1a9nWCqMbvuWGAC5FC1+4HjRa/VxTB1N4tvgBX6A+sPu5IjgxfSgrdXeoJhQ65WsmYahUG3vja6bH/bXACwo0lPl3r8sx2DfVchonyrnXtwJTsWHcRI/3dhreP/MyeaWmTCvNymvd1cy1TyjrCU77OIPBXgDsaM1flVV7lN33OE1XmxA4rccT0SCenUxt57NzviBfeQvUMpnJqSO0fSJXvHjPYeOKpe8udmH8RA5/pTyzcw9M= luk@doomship.local
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCuRHLPwgwJFbTtg+bzJV5W2iQuPWQ0DoTUiD03R74xeFaYjnU+8uc2kuBUEuB1w3XOdu54RSdhNQU1/fKyddr03G/WWoI/e1YzzW1Y+YtZP9t65XyCXcCp66/eVnR8dXG6fwPn55uveiY7jVOS6Wn4YIWgIwXbZgHcO0rlg4IywkzZ+nvZMaw6+w087iOf/0Ket/j1GLFs8HEP7ZlTLHP0tUaT+ThPSmGsxUCmiG1wFCjf1/ejvyNEzuj+wNstLlk26/1zP/Yo5yYHy3gWqfzRmXMzm98DqDM2VMtNIkslkcGw4xCLcve+Ia6sIfIzHoCDbFaIrTlbQLdCl8BJ4vH5/o4cMLXLSLw29lj6EQT4qegARU//AwIjuF7pB1rekBXzNRxa8UUdJG6snubiOoLzk8srMqwB97IZCLzxL/eF75pD7ACgyxauN2tfsyYrGAS9NLV5wuvZuObTQfzstrZR7H/eDQNt58jBmGeRUfoOc8DcI/ER96UXrHGDTdJ2nlEzx8hdBlk+wnm9OZiqD0zEk2q4rGR5PdgCxb8TlYXsjFMrB7sjrEDQUhV72SRai92TwOlSt8wtOfDw02ftyw8VlWGIumNlM5JdlHgbZt3NE/GV7tm1vX+fSw8kwtrFZt92rEvx7R3uwUR+uwxbO/MD0j4NXyKgwvF4QjfwHpvdzQ== Generated By Termius
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdXfteW8US09qDC4LNF2AFdlD4RVODLWHKCTPVbj/+s Generated By Termius
# Touch ID on luk@doomship.local by Termius
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMHlke0ByhaF3tHH7eyM1jZIm06pBobetOBNnPDnNLfxxUpMK6gsvq5dfSJq5sUMRd8UtUMY0LJmp+cYO1jOEn8=
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID/QUIK24Ldp0Yw3a+RTLL7xMRNZZNB0hSxIuEjAxPGk adot@doombase
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGWgBZQGyhQeMtOJKG1/kxO36Ok0GdrkJliMX54avBSn adot@doomship

View File

@@ -22,10 +22,16 @@
*.nosf/
*.nosf.*/
## everything 'git pull or fetch' will update `.git/FETCH_HEAD`, even if the content doesn't change. To avoid too many useless updates of this file in Seafile history:
FETCH_HEAD
*/FETCH_HEAD
.Trash/
.Trashes/
.DS_Store
*/.DS_Store
*.aae # AAE 文件主要在苹果的照片应用程序中使用,保存对原始照片所做的编辑,比如,裁剪、旋转或调整亮度等操作的信息。
.thumbnails
*/.thumbnails
@@ -50,14 +56,17 @@ _desktop.ini
node_modules/
*/node_modules/
package-lock.json
*/package-lock.json
pages4loader.json5
*/pages4loader.json5
.deploy_git/
*/.deploy_git/
# next.js 项目
.next/
*/.next/
# HBuilder 目录
unpackage/

View File

@@ -1,6 +1,6 @@
#!/bin/bash
echo "Usage: this-script.sh [VERSION]"
echo "Usage: $(basename $0) [VERSION]"
defaultVERSION=18.12.1

2
nodejs-remove.sh Normal file → Executable file
View File

@@ -1,6 +1,6 @@
#!/bin/bash
echo "Usage: this-script.sh [VERSION]"
echo "Usage: $(basename $0) [VERSION]"
sudo rm -fr /usr/local/bin/node
sudo rm -fr /usr/local/bin/npm

0
npm-registry.sh Normal file → Executable file
View File

60
photo_rename_folders.sh Normal file
View File

@@ -0,0 +1,60 @@
#!/bin/bash
# 指定目录
if [ "$1" ]; then
base_dir=$1
else
read -p "Please enter [root directory] to rename 1st level subfolders: " base_dir
fi
if [[ -d "$base_dir" ]]; then
base_dir=$(realpath "$base_dir")
echo Searching in "$base_dir";
else
echo not a folder!
exit 0
fi;
# Prompt user for input
read -p "Please enter [prod] to rename, or [anything else] to dry run: " user_input
# 遍历所有目录
find "$base_dir" -type d | while read -r fullpath; do
# 提取目录名称,去掉末尾的斜杠
dir_name=$(dirname "$fullpath")
folder_name=$(basename "$fullpath")
# 调试输出:检查目录名称
#echo "Processing: $folder_name"
# 使用正则表达式提取前缀(可选)、年份、月份和日期
if [[ $folder_name =~ ^([^,]*),?\ ([0-9]{4})([0-9]{1,2})([0-9]{1,2})日$ ]]; then
# 有前缀的情况
intro="${BASH_REMATCH[1]}"
year="${BASH_REMATCH[2]}"
month=$(printf "%02d\n" "$((10#${BASH_REMATCH[3]}))")
day=$(printf "%02d\n" "$((10#${BASH_REMATCH[4]}))")
elif [[ $folder_name =~ ^.?([0-9]{4})[年-]([0-9]{1,2})[月-]([0-9]{1,2})日?\]?_?\ ?(.*)$ ]]; then
# 没有前缀的情况
year="${BASH_REMATCH[1]}"
month=$(printf "%02d\n" "$((10#${BASH_REMATCH[2]}))")
day=$(printf "%02d\n" "$((10#${BASH_REMATCH[3]}))")
intro="${BASH_REMATCH[4]}"
else
echo "Skip: $folder_name"
continue
fi
# 创建新的目录名称
new_name="${year}${month}${day}"
if [[ -n "$intro" ]]; then
new_name="${new_name}_${intro// /_}" # 替换空格为下划线
fi
# 重命名目录
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
echo "Renamed: $folder_name"
echo " >>>> $dir_name/$new_name"
done

71
photo_rename_images.sh Normal file
View File

@@ -0,0 +1,71 @@
#!/bin/bash
# 设置要处理的目录
if [ "$1" ]; then
base_dir=$1
else
read -p "Please enter [root directory] to rename images recursively: " target_directory
fi
if [[ -d "$target_directory" ]]; then
echo Searching in $(realpath "$target_directory");
else
echo "$target_directory" is not a folder!
exit 0
fi;
# Prompt user for input
read -p "Please enter [prod] to rename, or [anything else] to dry run: " user_input
# 查找并遍历所有文件
find "$target_directory" -type f | while read -r fullpath; do
# 获取文件的原名和扩展名
dir_name=$(dirname "$fullpath")
base_name=$(basename "$fullpath")
extension="${base_name##*.}"
if [[ "$extension" = "7z" ]] || [[ "$extension" = "DS_Store" ]] || [[ "$extension" = "aae" ]] || [[ "$base_name" == *"unkn#own"* ]]; then
echo === Bypassing $base_name
elif [[ "$base_name" =~ ^\[?[0-9]{8}[-_][0-9]{6}\]? ]]; then
#echo === Formatting $base_name
# 删除文件名中的 [ 和 ],并将日期时间后的 - 或空格 替换为 #
new_name=$(echo "$base_name" | sed -E 's/\[?([0-9]{8})[-_]([0-9]{6})\]?[- ]/\1#\2_/g; s/\[?([0-9]{8})[-_]([0-9]{6})\]?/\1#\2/g; s/\[|\]//g')
# 如果重命名后的文件名与原文件名不同,则进行重命名
if [[ "$base_name" != "$new_name" ]]; then
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
echo "$base_name -> $new_name"
fi
elif [[ ! "$base_name" =~ ^[0-9]{8}#[0-9]{6} ]]; then
#echo === Add datetime $base_name
# 获取文件的拍摄日期假设日期以EXIF元数据存储
# 需要安装 exiftool
date_taken=$(exiftool -ExtractEmbedded -d "%Y%m%d#%H%M%S" -DateTimeOriginal -CreationDate -s -s -s "$fullpath")
# 检查日期是否为空和文件名格式
if [ -n "$date_taken" ]; then
# 生成新的文件名
new_name="${date_taken}_${base_name}"
# 重命名文件
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
echo "$base_name -> $new_name"
else
new_name="unkn#own_${base_name}"
# 重命名文件
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
echo "$base_name -> $new_name"
fi
else
echo === Unknown $base_name
fi
done

View File

@@ -11,10 +11,10 @@ fi
# to reset port to empty, otherwise the second run of this script will not ask for port.
PORT=
PORTDEFAULT=17890
PORTDEFAULT=7897
# function proxy() {
if [ "$proxySwitch" == "s" ] || [ "$proxySwitch" == "1" ]; then
echo "::*** Proxy server running on [port number] or [leave blank] for default $PORTDEFAULT (20170 for v2ray2, 17890 for 零点云, or 7897 for clash verge)"
echo "::*** Proxy server running on [port number] or [leave blank] for default $PORTDEFAULT (20170 for v2ray2, 7897 for 零点云 or clash verge)"
while [ ! "$PORT" ]
do
read -p "***:: " PORT

0
rclone-starter.sh Normal file → Executable file
View File

View File

@@ -23,11 +23,11 @@ if not exist "%ROOTPATH%" (
echo √√√ ROOTPATH = [[%ROOTPATH%]]
)
echo ::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]
echo ::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]
set /p IGNOREPATH=">>> "
echo;
if "" == "%IGNOREPATH%" (
set IGNOREPATH=https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
set IGNOREPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
) else (
for %P in (%IGNOREPATH%) do set "IGNOREPATH=%~dpnxP/seafile-ignore.global.txt"
if not exist "%IGNOREPATH%" (

52
seafile-ignore-find2merge.sh Normal file → Executable file
View File

@@ -1,7 +1,7 @@
#!/bin/bash
echo ""
echo "Search in [ROOTPATH], Merge [IGNOREPATH/seafile-ignore.global.txt] and [ROOTPATH/*/seafile-ignore.local.txt] files to [seafile-ignore.txt]"
echo "Search in [ROOTPATH], Merge [GLOBALPATH/seafile-ignore.global.txt] and [ROOTPATH/*/seafile-ignore.local.txt] files to [seafile-ignore.txt]"
echo ""
if [ -d "$1" ]
@@ -12,7 +12,7 @@ else
read -p "***:: " ROOTPATH
if [ "$ROOTPATH" ]
then
ROOTPATH=$(realpath $ROOTPATH)
ROOTPATH=$(realpath "${ROOTPATH/#\~/$HOME}")
else
ROOTPATH=`pwd`
fi
@@ -26,49 +26,53 @@ else
fi
echo ""
echo "::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]"
read -p "***:: " IGNOREPATH
if [ "$IGNOREPATH" ]
echo "::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]"
read -p "***:: " GLOBALPATH
if [ "$GLOBALPATH" ]
then
if [ -d "$IGNOREPATH" ]
GLOBALPATH=$(realpath "${GLOBALPATH/#\~/$HOME}")
echo $GLOBALPATH
if [ -d "$GLOBALPATH" ]
then
IGNOREPATH=$(realpath $IGNOREPATH)/seafile-ignore.global.txt
GLOBALPATH="$GLOBALPATH/seafile-ignore.global.txt"
fi
if [ ! -f "$IGNOREPATH" ]
if [ -f "$GLOBALPATH" ]
then
echo "××× Not found [[$IGNOREPATH]]. Exit now..."
exit
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
else
echo "√√√ IGNOREPATH = [[$IGNOREPATH]]"
echo "××× Not found [[$GLOBALPATH]]. Exit now..."
exit
fi
else
IGNOREPATH=https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
GLOBALPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
fi
echo ""
echo "::*** Enter [y] to start updating, or [anything else] to quit"
echo "::*** Enter [y] to start updating, or [anything else] for dry-run"
read -p "***:: " YESNO
if [ "$YESNO" != 'y' ]
then
exit
fi
cd $ROOTPATH
echo "*** Starting from [[`pwd`]] ***"
echo ""
find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -E -v 'node_modules|uni_modules|\.deploy_git|\.git|.svn|\.vscode|\.wrangler|unpackage|_webroot|_logstore|_datasotre|_archive|_filestore|_ssl' | while read repo
find . -mindepth 0 -maxdepth 3 -type d -name '[^.]*' | grep -E -v 'node_modules|uni_modules|\.deploy_git|\.git|.svn|\.vscode|\.wrangler|unpackage|_webroot|_logstore|_datasotre|_archive|_filestore|_ssl' | while read repo
do
if [ -f "$repo/seafile-ignore.txt" ]
if [ -f "$repo/seafile-ignore.txt" ] || [ -d "$repo/.git" ]
then
echo "---- updating [[$repo/seafile-ignore.txt]] ----"
if [ -f "$IGNOREPATH" ]
if [ "$YESNO" = 'y' ]
then
cat $IGNOREPATH > $repo/seafile-ignore.txt
else
curl -sSL $IGNOREPATH | cat > $repo/seafile-ignore.txt
if [ -f "$GLOBALPATH" ]
then
cat $GLOBALPATH > $repo/seafile-ignore.txt
else
curl -sSL $GLOBALPATH | cat > $repo/seafile-ignore.txt
fi
if [ -f "$repo/seafile-ignore.local.txt" ]
then
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
fi
fi
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
echo ""
fi
done

View File

@@ -1,6 +0,0 @@
#!/bin/bash
echo ::*** Merge remote [seafile-ignore.global.txt] and local [seafile-ignore.local.txt] to [seafile-ignore.txt]
curl -sSL https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt > seafile-ignore.txt
if [ -f seafile-ignore.local.txt ]; then cat seafile-ignore.local.txt >> seafile-ignore.txt; fi
echo

86
seafile-ignore.txt Normal file
View File

@@ -0,0 +1,86 @@
# https://help.seafile.com/syncing_client/excluding_files/
# 注释。通配符:* 匹配0到若干个字符包括代表目录的/。? 匹配1个字符包括/。
# seafile-ignore.txt 只能控制在客户端需要忽略哪些文件。你依然可以在 seahub 的 web 界面创建这些被客户端忽略的文件。
# 在这种情况下,
# 这些文件会被同步到客户端,但是用户在客户端对这些文件的后续修改会被忽略,不会被同步回服务器。
# 文件在服务器端的后续更改会被同步到客户端,如果客户端也同时修改了这些文件,系统会生成冲突文件。
# seafile-ignore.txt 只能忽略还没有被同步的文件。对于已经被同步的文件,如果后来把它添加到 seafile-ignore.txt 中,系统只会忽略后续更改,已经上传的版本不会受影响。
### seafile-ignore.global.txt ###
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
*.sfignore
*.sfignore/
*.sfignore.*
*.sfignore.*/
*.sfomit
*.sfomit.*
*.sfomit/
*.sfomit.*/
*.nosf
*.nosf.*
*.nosf/
*.nosf.*/
## everything 'git pull or fetch' will update `.git/FETCH_HEAD`, even if the content doesn't change. To avoid too many useless updates of this file in Seafile history:
FETCH_HEAD
*/FETCH_HEAD
.Trash/
.Trashes/
.DS_Store
*/.DS_Store
*.aae # AAE 文件主要在苹果的照片应用程序中使用,保存对原始照片所做的编辑,比如,裁剪、旋转或调整亮度等操作的信息。
.thumbnails
*/.thumbnails
Thumbs.db
*/Thumbs.db
thumbs.db
*/thumbs.db
_desktop.ini
*/_desktop.ini
._*
*/._*
.$*
*/.$*
~$*
*/~$*
node_modules/
*/node_modules/
package-lock.json
*/package-lock.json
pages4loader.json5
*/pages4loader.json5
.deploy_git/
*/.deploy_git/
# next.js 项目
.next/
*/.next/
# HBuilder 目录
unpackage/
*/unpackage/
Icon
OneDrive/Icon
# wrangler project
.dev.vars*
*/.dev.vars*
.wrangler/
*/.wrangler/
### seafile-ignore.local.txt ###

101
ssh.sh Normal file → Executable file
View File

@@ -1,6 +1,6 @@
#!/bin/bash
echo Usage: this_script.sh [selected_index] [to_run_cmd]
echo "Usage: $(basename $0) [host_to_ssh] [cmd_to_run]"
# Ensure jq is installed
if ! command -v jq &> /dev/null; then
@@ -11,21 +11,13 @@ fi
# Path to the settings.json file
SETTINGS_FILE="$HOME/Library/Application Support/Code/User/settings.json"
if [[ ! -f "$SETTINGS_FILE" ]]; then
SETTINGS_FILE="$HOME/product_产品/.vscode/settings.json"
if [[ ! -f "$SETTINGS_FILE" ]]; then
echo "settings.json file not found!"
exit 1
fi
SETTINGS_FILE="$HOME/product_产品/.vscode/settings.json"
if [[ ! -f "$SETTINGS_FILE" ]]; then
echo "settings.json file not found!"
exit 1
fi
fi
# 自定义的列表但是测试有问题只有第一行被select添加了序号
# targets=$(jq -r '.["sshfs.configs"][] | "\(.name)"' "$SETTINGS_FILE")
# if [ -z "$targets" ]
# then
# echo "No configurations found in the settings.json file."
# exit 1
# fi
# Parse the JSON to get labels and corresponding details
labels=($(jq -r '.["sshfs.configs"][] | .label' "$SETTINGS_FILE"))
hosts=($(jq -r '.["sshfs.configs"][] | .host' "$SETTINGS_FILE"))
@@ -35,22 +27,46 @@ usernames=($(jq -r '.["sshfs.configs"][] | .username' "$SETTINGS_FILE"))
passwords=($(jq -r '.["sshfs.configs"][] | .password' "$SETTINGS_FILE"))
privateKeyPaths=($(jq -r '.["sshfs.configs"][] | .privateKeyPath' "$SETTINGS_FILE"))
if [ "$1" -ge 0 ] 2>/dev/null && [ "$1" -le ${#hosts[@]} ] 2>/dev/null
then
selected_index=$1-1
options=()
prefixes=()
for i in "${!labels[@]}"; do
option=$(echo "${labels[$i]}" | sed 's/[^[:alnum:]].*//') # 提取前几个字母和数字
options+=("$option: ${labels[$i]}") # 去掉序号保留前缀和完整label
prefixes+=("$option") # 保存前缀
done
# Check if a command-line argument is provided
if [ "$1" != "" ]; then
# 如果提供了参数,则直接使用这个前缀
host_to_ssh=$1
else
echo "Select a target to connect via SSH, or press 0 to exit:"
select target in "${labels[@]}"
do
if [[ -n "$target" ]]; then
selected_index=$REPLY-1
break
elif [ "$REPLY" = '0' ]; then
exit 0
else
echo "Invalid selection. Try again."
echo "Select a target to connect via SSH, or press 0 to exit:"
echo
# Display options without numbers
for opt in "${options[@]}"; do
echo "$opt"
done
echo
read -p "请输入要连接的主机前缀: " host_to_ssh
fi
echo
# 查找用户输入对应的索引
selected_index=-1
for i in "${!prefixes[@]}"; do
if [[ "${prefixes[$i]}" == "$host_to_ssh" ]]; then
selected_index=$i
break
fi
done
done
# 如果没有找到匹配的索引
if [ "$selected_index" -eq -1 ]; then
echo "无效的选择,请重试。"
exit 1
fi
label="${labels[$selected_index]}"
@@ -61,23 +77,20 @@ username="${usernames[$selected_index]}"
password="${passwords[$selected_index]}"
privateKeyPath="${privateKeyPaths[$selected_index]}"
if [ "$port" = "null" ]
then
port=22
if [ "$port" = "null" ]; then
port=22
fi
echo "::*** Coonecting to ${label}"
if [ "$password" != "null" ]
then
if [ "$(which sshpass)" ]
then
echo "::*** sshpass -p $password -X -p $port $username@$host"
sshpass -p $password ssh -X -p $port "$username@$host" $2
else
echo "::*** ssh -X -p $port $username@$host"
ssh -X -p $port "$username@$host" $2
fi
echo "::*** Connecting to ${label}"
if [ "$password" != "null" ]; then
if command -v sshpass &> /dev/null; then
echo "::*** sshpass -p $password -Y -p $port $username@$host '$2'"
sshpass -p "$password" ssh -Y -p "$port" "$username@$host" "$2"
else
echo "::*** ssh -Y -p $port $username@$host '$2'"
ssh -Y -p "$port" "$username@$host" "$2"
fi
else
echo "::*** ssh -X -p $port $username@$host"
ssh -X -p $port "$username@$host" $2
echo "::*** ssh -Y -p $port $username@$host '$2'"
ssh -Y -p "$port" "$username@$host" "$2"
fi

0
svn-serve.sh Normal file → Executable file
View File

6
ts-run-as-exit.sh Executable file
View File

@@ -0,0 +1,6 @@
## 这应该是一次性即可,然后在 Admin Console 网页里这个 exit node 上就不会有警告标记。但实际上即使有警告也能用做 exit node。
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
sudo tailscale up --advertise-exit-node

1
ts-set-exit.sh Executable file
View File

@@ -0,0 +1 @@
sudo tailscale set --exit-node=de2 --exit-node-allow-lan-access=true

2
ts-unset-exit.sh Executable file
View File

@@ -0,0 +1,2 @@
sudo tailscale set --exit-node=