Compare commits
27 Commits
cbe9d7ef85
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bde475b433 | ||
|
|
c55b9931df | ||
|
|
4ffa88309e | ||
|
|
c723878a28 | ||
|
|
4cf98bc2cc | ||
|
|
d75c6b7d02 | ||
|
|
0d44ffbc99 | ||
|
|
9fad039627 | ||
|
|
aaff2c0a5f | ||
|
|
c8cd6ebd8e | ||
|
|
ac89a6b599 | ||
|
|
0fb47c30a2 | ||
|
|
fc75375f93 | ||
|
|
01ab07c7ea | ||
|
|
60e06abd72 | ||
|
|
13f6318023 | ||
|
|
2a2be82375 | ||
| 5920cde656 | |||
| f01868e246 | |||
|
|
dcb621ef20 | ||
|
|
c5e6fdcbf5 | ||
|
|
044bd6c8a3 | ||
|
|
a1d9d2a76f | ||
|
|
cc6789a9cc | ||
|
|
c8ef431ae3 | ||
|
|
d56cc243c1 | ||
|
|
002a4ccf5b |
0
acme-install.sh
Normal file → Executable file
0
acme-install.sh
Normal file → Executable file
0
acme-setup.sh
Normal file → Executable file
0
acme-setup.sh
Normal file → Executable file
0
acme-uninstall.sh
Normal file → Executable file
0
acme-uninstall.sh
Normal file → Executable file
5
caddy-install.sh
Normal file → Executable file
5
caddy-install.sh
Normal file → Executable 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
0
conda-init.sh
Normal file → Executable file
0
conda-install.sh
Normal file → Executable file
0
conda-install.sh
Normal file → Executable 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/open/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
|
||||
|
||||
@@ -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/open/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/open/sysconfig /faronear/sysconfig
|
||||
chmod -R 755 /faronear # 确保其他用户能够读取 /faronear/sysconfig/nixhome/*
|
||||
fi
|
||||
echo
|
||||
|
||||
0
temp-detect.sh → detect-disk-temperature.sh
Normal file → Executable file
0
temp-detect.sh → detect-disk-temperature.sh
Normal file → Executable file
0
docker-install-debian.sh
Normal file → Executable file
0
docker-install-debian.sh
Normal file → Executable file
0
docker-install-ubuntu.sh
Normal file → Executable file
0
docker-install-ubuntu.sh
Normal file → Executable 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
|
||||
|
||||
@@ -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
0
find-and-run-recursively.sh
Normal file → Executable 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/open/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/open/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
26
git-ignore-find2merge.sh
Normal file → Executable 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/open/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/open/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 ""
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
echo `hostname -I` | awk '{print $1;}'
|
||||
0
mac-accelerate-backup.sh
Normal file → Executable file
0
mac-accelerate-backup.sh
Normal file → Executable file
0
mac-autohide-dock.sh
Normal file → Executable file
0
mac-autohide-dock.sh
Normal file → Executable file
0
mac-brew-apps.sh
Normal file → Executable file
0
mac-brew-apps.sh
Normal file → Executable file
0
mac-brew-install.sh
Normal file → Executable file
0
mac-brew-install.sh
Normal file → Executable file
0
mac-brew-mirror.sh
Normal file → Executable file
0
mac-brew-mirror.sh
Normal file → Executable file
4
mac-create-vdisk.sh
Normal file → Executable file
4
mac-create-vdisk.sh
Normal file → Executable 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,6 @@ 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/...
|
||||
# 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.
|
||||
|
||||
4
mac-disable-msoffice-autoupdate.sh
Normal file
4
mac-disable-msoffice-autoupdate.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
cd /Library/Application\ Support/Microsoft/MAU2.0
|
||||
|
||||
# sudo chmod 000 Microsoft\ AutoUpdate.app
|
||||
sudo mv Microsoft\ AutoUpdate.app MicrosoftAutoupdateDisabled.app
|
||||
0
mac-disable-store-files.sh
Normal file → Executable file
0
mac-disable-store-files.sh
Normal file → Executable file
0
mac-remove-launchpad-icons.sh
Normal file → Executable file
0
mac-remove-launchpad-icons.sh
Normal file → Executable file
0
mac-resize-launchpad.sh
Normal file → Executable file
0
mac-resize-launchpad.sh
Normal file → Executable file
8
myip.sh
Executable file
8
myip.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
echo Local IP: $(ifconfig en0 | grep "inet " | awk '{print $2}')
|
||||
else
|
||||
echo Local IP: $(echo `hostname -I` | awk '{print $1;}')
|
||||
fi
|
||||
|
||||
echo Public IP: `curl -s ifconfig.me`
|
||||
echo
|
||||
@@ -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/open/sysconfig/raw/branch/main/nixhome/$homescript"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -74,22 +74,21 @@ 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
|
||||
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
|
||||
|
||||
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"
|
||||
fi
|
||||
echo
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -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 || :
|
||||
|
||||
@@ -124,29 +124,56 @@ 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\]] '
|
||||
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
MYIPLAN=$(ifconfig en0 | grep "inet " | awk '{print $2}')
|
||||
else
|
||||
PS1='[\t#\u@\h($(uname)-$(uname -m)):\w] ' # \w shows absolute path, \W shows current folder.
|
||||
MYIPLAN=$(echo `hostname -I` | awk '{print $1;}')
|
||||
fi
|
||||
MYIPPUB=$(curl -s ifconfig.me)
|
||||
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
PSTYLE=07
|
||||
PTYPE=3
|
||||
elif [ "$(whoami)" = "root" ]; then
|
||||
PSTYLE=07
|
||||
PTYPE=4
|
||||
AS_ROOT="#"
|
||||
else
|
||||
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}5m\]\u\[\033[00m\]@\[\033[$PSTYLE;${PTYPE}1m\]\h\[\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\]>$IN_SSH$AS_ROOT '
|
||||
else
|
||||
PS1='<\t#\u@\h=$MYIPPUB^$(uname -m),$(uname),$MYOSVERSION:\w>$IN_SSH$AS_ROOT ' # \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 +186,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 +216,4 @@ fi
|
||||
################################################################################
|
||||
# End Of File: "~/.bashrc"
|
||||
################################################################################
|
||||
|
||||
|
||||
@@ -22,10 +22,15 @@
|
||||
*.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/
|
||||
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
*.aae # AAE 文件主要在苹果的照片应用程序中使用,保存对原始照片所做的编辑,比如,裁剪、旋转或调整亮度等操作的信息。
|
||||
|
||||
.thumbnails
|
||||
*/.thumbnails
|
||||
@@ -50,14 +55,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/
|
||||
|
||||
@@ -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
2
nodejs-remove.sh
Normal file → Executable 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
0
npm-registry.sh
Normal file → Executable file
58
photo_rename_folders.sh
Normal file
58
photo_rename_folders.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/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
|
||||
|
||||
# 遍历所有目录
|
||||
for dir in "$base_dir"/*/; do
|
||||
# 提取目录名称,去掉末尾的斜杠
|
||||
dir_name=$(basename "$dir")
|
||||
|
||||
# 调试输出:检查目录名称
|
||||
echo "Processing: $dir_name"
|
||||
|
||||
# 使用正则表达式提取前缀(可选)、年份、月份和日期
|
||||
if [[ $dir_name =~ ^([^,]*),?\ ([0-9]{4})年([0-9]{1,2})月([0-9]{1,2})日$ ]]; then
|
||||
# 有前缀的情况
|
||||
prefix="${BASH_REMATCH[1]}"
|
||||
year="${BASH_REMATCH[2]}"
|
||||
month=$(printf "%02d" "${BASH_REMATCH[3]}")
|
||||
day=$(printf "%02d" "${BASH_REMATCH[4]}")
|
||||
|
||||
elif [[ $dir_name =~ ^([0-9]{4})年([0-9]{1,2})月([0-9]{1,2})日$ ]]; then
|
||||
# 没有前缀的情况
|
||||
prefix=""
|
||||
year="${BASH_REMATCH[1]}"
|
||||
month=$(printf "%02d" "${BASH_REMATCH[2]}")
|
||||
day=$(printf "%02d" "${BASH_REMATCH[3]}")
|
||||
|
||||
else
|
||||
echo "Skipping: $dir_name (not matching expected format)"
|
||||
continue
|
||||
fi
|
||||
|
||||
# 创建新的目录名称
|
||||
new_name="${year}${month}${day}"
|
||||
|
||||
if [[ -n "$prefix" ]]; then
|
||||
new_name="${new_name}_${prefix// /_}" # 替换空格为下划线
|
||||
fi
|
||||
|
||||
# 重命名目录
|
||||
if [[ "$user_input" == "prod" ]]; then mv "$dir" "$base_dir/$new_name"; fi;
|
||||
echo "Renamed: $dir_name -> $new_name"
|
||||
done
|
||||
71
photo_rename_images.sh
Normal file
71
photo_rename_images.sh
Normal 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 file; do
|
||||
# 获取文件的原名和扩展名
|
||||
dir_name=$(dirname "$file")
|
||||
base_name=$(basename "$file")
|
||||
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 "$file" "$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 "$file")
|
||||
|
||||
# 检查日期是否为空和文件名格式
|
||||
if [ -n "$date_taken" ]; then
|
||||
# 生成新的文件名
|
||||
new_name="${date_taken}_${base_name}"
|
||||
|
||||
# 重命名文件
|
||||
if [[ "$user_input" == "prod" ]]; then mv "$file" "$dir_name/$new_name"; fi;
|
||||
echo "$base_name -> $new_name"
|
||||
else
|
||||
new_name="unkn#own_${base_name}"
|
||||
|
||||
# 重命名文件
|
||||
if [[ "$user_input" == "prod" ]]; then mv "$file" "$dir_name/$new_name"; fi;
|
||||
echo "$base_name -> $new_name"
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
echo === Unknown $base_name
|
||||
|
||||
fi
|
||||
done
|
||||
4
proxy.sh
4
proxy.sh
@@ -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
0
rclone-starter.sh
Normal file → Executable 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/open/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/open/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%" (
|
||||
|
||||
30
seafile-ignore-find2merge.sh
Normal file → Executable file
30
seafile-ignore-find2merge.sh
Normal file → Executable 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" ]
|
||||
@@ -26,23 +26,23 @@ 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/open/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]"
|
||||
read -p "***:: " GLOBALPATH
|
||||
if [ "$GLOBALPATH" ]
|
||||
then
|
||||
if [ -d "$IGNOREPATH" ]
|
||||
if [ -d "$GLOBALPATH" ]
|
||||
then
|
||||
IGNOREPATH=$(realpath $IGNOREPATH)/seafile-ignore.global.txt
|
||||
GLOBALPATH=$(realpath $GLOBALPATH)/seafile-ignore.global.txt
|
||||
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/seafile-ignore.global.txt
|
||||
GLOBALPATH=https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -57,16 +57,16 @@ 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 [ -f "$GLOBALPATH" ]
|
||||
then
|
||||
cat $IGNOREPATH > $repo/seafile-ignore.txt
|
||||
cat $GLOBALPATH > $repo/seafile-ignore.txt
|
||||
else
|
||||
curl -sSL $IGNOREPATH | cat > $repo/seafile-ignore.txt
|
||||
curl -sSL $GLOBALPATH | cat > $repo/seafile-ignore.txt
|
||||
fi
|
||||
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
|
||||
echo ""
|
||||
|
||||
2
seafile-ignore-merge-here.sh
Normal file → Executable file
2
seafile-ignore-merge-here.sh
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
#!/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
|
||||
curl -sSL https://git.tic.cc/open/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
|
||||
|
||||
84
seafile-ignore.txt
Normal file
84
seafile-ignore.txt
Normal file
@@ -0,0 +1,84 @@
|
||||
# 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/
|
||||
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
|
||||
.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 ###
|
||||
|
||||
83
ssh.sh
Normal file → Executable file
83
ssh.sh
Normal file → Executable 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
|
||||
@@ -18,14 +18,6 @@ if [[ ! -f "$SETTINGS_FILE" ]]; then
|
||||
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."
|
||||
fi
|
||||
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
|
||||
|
||||
# 如果没有找到匹配的索引
|
||||
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
|
||||
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
|
||||
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 -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
|
||||
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
0
svn-serve.sh
Normal file → Executable file
6
ts-run-as-exit.sh
Executable file
6
ts-run-as-exit.sh
Executable 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
1
ts-set-exit.sh
Executable file
@@ -0,0 +1 @@
|
||||
sudo tailscale set --exit-node=de2 --exit-node-allow-lan-access=true
|
||||
2
ts-unset-exit.sh
Executable file
2
ts-unset-exit.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
sudo tailscale set --exit-node=
|
||||
|
||||
Reference in New Issue
Block a user