diff --git a/debian-setup.sh b/debian-setup.sh index 8092f49..1b03fd5 100644 --- a/debian-setup.sh +++ b/debian-setup.sh @@ -48,7 +48,9 @@ if [ "$DebianVersionMain" == '10' ] then chmod o+w /etc/sudoers ## Debian 10 上,不存在 includedir,需要自己添加。而 Debian 11.1 上,已经存在 @includedir - sed -i "s|#includedir /etc/sudoers.d|includedir /etc/sudoers.d|g" /etc/sudoers # allow users in /etc/sudoers.d/ folder to sudo + echo >> /etc/sudoers + echo includedir /etc/sudoers.d >> /etc/sudoers # allow users in /etc/sudoers.d/ folder to sudo + echo >> /etc/sudoers chmod o-w /etc/sudoers fi echo diff --git a/docker-allow-user.sh b/docker-allow-user.sh index 3e21801..9e76e93 100644 --- a/docker-allow-user.sh +++ b/docker-allow-user.sh @@ -12,5 +12,6 @@ else fi sudo usermod -aG docker $DOCKERUSER -sudo newgrp docker sudo systemctl restart docker +groups $DOCKERUSER +newgrp docker # run as the docker group in the current shell diff --git a/geth-install.sh b/geth-install.sh index 2cfcad1..96bb796 100644 --- a/geth-install.sh +++ b/geth-install.sh @@ -15,7 +15,7 @@ else fi fi -if [[ "$(uname)" = "linux" ]] +if [[ "$(uname)" = "Linux" ]] then # 用 dpkg --print-architecture 更直接 ARCH=`dpkg --print-architecture` diff --git a/ipfs-install.sh b/ipfs-install.sh index 8f3f677..76420e2 100755 --- a/ipfs-install.sh +++ b/ipfs-install.sh @@ -14,7 +14,7 @@ else fi fi -if [[ "$(uname)" = "linux" ]] +if [[ "$(uname)" = "Linux" ]] then # 用 dpkg --print-architecture 更直接 ARCH=`dpkg --print-architecture` diff --git a/nixhome/.bashrc b/nixhome/.bashrc index ca28ade..f1dc7d9 100644 --- a/nixhome/.bashrc +++ b/nixhome/.bashrc @@ -56,6 +56,7 @@ alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' alias su='su -' +alias npmc='npm --registry https://registry.npm.taobao.org' if [[ "$(uname)" = "Darwin" ]]; then alias l='ls -lG' diff --git a/nixhome/.npmrc_taobao b/nixhome/.npmrc_taobao index d93e496..ae44462 100644 --- a/nixhome/.npmrc_taobao +++ b/nixhome/.npmrc_taobao @@ -1,7 +1 @@ registry=https://registry.npm.taobao.org - -## npm config set registry https://registry.npm.taobao.org -## npm config set registry https://registry.npmjs.org -## npm config get registry -## npm config ls -l -## npm --registry registry https://registry.npm.taobao.org ... \ No newline at end of file diff --git a/portscan-mac.sh b/portscan-mac.sh deleted file mode 100644 index 75e001e..0000000 --- a/portscan-mac.sh +++ /dev/null @@ -1,9 +0,0 @@ -if [ "$1" ] -then - PORT=$1 -else - echo "=== 需要查看的端口号:" - read -p ">>> " PORT -fi - -lsof -i tcp:$PORT \ No newline at end of file diff --git a/portscan-windows.bat b/portscan.bat similarity index 100% rename from portscan-windows.bat rename to portscan.bat diff --git a/portscan-linux.sh b/portscan.sh similarity index 50% rename from portscan-linux.sh rename to portscan.sh index 086bfc9..674a0a1 100644 --- a/portscan-linux.sh +++ b/portscan.sh @@ -6,4 +6,9 @@ else read -p ">>> " PORT fi -netstat -tunlp | grep $PORT +if [[ "$(uname)" = "Darwin" ]] +then + lsof -i tcp:$PORT +else + netstat -tunlp | grep $PORT +fi diff --git a/proxy.bat b/proxy.bat index 4721c1a..a11368d 100644 --- a/proxy.bat +++ b/proxy.bat @@ -5,7 +5,7 @@ echo === Enter [s] to start, [t] to terminate or [anything else] for no change set /p TODOMODE=">>> " echo; if "s" == "%TODOMODE%" ( - set ALL_PROXY=socks5://127.0.0.1:1080 + set all_proxy=socks5://127.0.0.1:1080 echo "--- 已开启网络代理" ) else if "t" == "%TODOMODE%" ( set all_proxy= diff --git a/proxy.sh b/proxy.sh index 24c7995..8d83a2e 100755 --- a/proxy.sh +++ b/proxy.sh @@ -5,13 +5,13 @@ function proxy(){ read -p ">>> " proxySwitch if [ $proxySwitch ] && [ $proxySwitch == "s" ] then - export ALL_PROXY=socks5://127.0.0.1:1086 - export http_proxy=http://127.0.0.1:8090 - export https_proxy=https://127.0.0.1:8090 + export all_proxy=socks5://127.0.0.1:1086 + export http_proxy=socks5://127.0.0.1:1086 + export https_proxy=socks5://127.0.0.1:1086 echo -e "--- 已开启网络代理" elif [ $proxySwitch ] && [ $proxySwitch == "t" ] then - unset ALL_PROXY + unset all_proxy unset http_proxy unset https_proxy echo -e "--- 已关闭网络代理" diff --git a/seafile-install.sh b/seafile-install.sh index cdf26e3..bfef502 100755 --- a/seafile-install.sh +++ b/seafile-install.sh @@ -29,7 +29,7 @@ sudo ./setup-seafile.sh # to setup seafile+sqlite (setup-seafile-mysql.sh is for sudo ./seafile.sh start ## changed "127.0.0.1:8000" to "0.0.0.0:8000", otherwise it can only be accessed on the localhost, unless using nginx/apache to proxy -# sudo sed -i "s/127\.0\.0\.1/0.0.0.0/g" ../conf/gunicorn.conf.py +# sudo sed -i "s|127.0.0.1|0.0.0.0|g" ../conf/gunicorn.conf.py ## to change seahub port, to edit gunicorn.conf.py, it works although it still promts "Starting seahub at port 8000 ...". ## (Directly `./seahub.sh start ` prompts "Starting seahub at port ..." but it actually doesn't listen on .) sudo ./seahub.sh start # the first run will asks to setup an admin account