From a3479b06454cd68e268b5b114fdf8405ef2212b3 Mon Sep 17 00:00:00 2001 From: darkclip Date: Sat, 27 Jan 2024 22:32:22 +0800 Subject: [PATCH] update --- packages-base | 2 ++ tmux.conf | 8 ++++++++ update-github-release.sh | 28 +++++++++++----------------- 3 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 tmux.conf diff --git a/packages-base b/packages-base index 91f7c5d..87365dd 100644 --- a/packages-base +++ b/packages-base @@ -14,6 +14,8 @@ netcat-openbsd zsh-autosuggestions zsh-syntax-highlighting iperf3 +mosh +tmux zsh-completions docker-ce docker-ce-cli diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..ca19fdf --- /dev/null +++ b/tmux.conf @@ -0,0 +1,8 @@ +new-session +set -g set-clipboard on +set -g mouse on +set -g copy-command 'xsel -i && xsel -o | xsel -i -b' +bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection" +set -g status-right " \"#{=22:pane_title}\" %H:%M" +setw -g monitor-activity on +set -g visual-activity on \ No newline at end of file diff --git a/update-github-release.sh b/update-github-release.sh index d7f26ca..97be949 100755 --- a/update-github-release.sh +++ b/update-github-release.sh @@ -16,16 +16,16 @@ main(){ *) echo 'unsupported OS' && exit 1 ;; esac; - build_arch=$os_$arch; + build_arch=$os'_'$arch; if [ -z "$PROG_PATH" ] || [ -z "$PROG_NAME" ] || [ -z "$REPO" ]; then usage exit 1 fi echo "Update for $REPO" - api_url="https://$API_DOMAIN/repos/$REPO/releases/latest" - dl_url=$(curl -sSf $api_url | grep -i $build_arch | grep browser_download_url | cut -d '"' -f 4) - dl_url=$(echo $dl_url | sed -r s/$GH_DOMAIN/$DL_DOMAIN/i) + api_url="https://api.github.com/repos/$REPO/releases/latest" + dl_url=$(curl $SET_PROXY -sSfL $api_url | grep -i $build_arch | grep browser_download_url | cut -d '"' -f 4) + echo "From: $dl_url" if [ -z $dl_url ]; then usage @@ -40,10 +40,10 @@ main(){ pushd "$tmp_dir" >/dev/null ext=$(echo $dl_url | awk -F'.' '{print $NF}') if (echo $ext | grep -i zip) >/dev/null 2>&1; then - curl -Sfo pkg.zip "$dl_url" + curl $SET_PROXY -SfLo pkg.zip "$dl_url" unzip -o pkg.zip else - curl -Sfo pkg.tar.$ext "$dl_url" + curl $SET_PROXY -SfLo pkg.tar.$ext "$dl_url" tar -xvf pkg.tar.$ext fi if [ ! -z "$PKG_DIR" ]; then @@ -68,8 +68,7 @@ usage(){ echo " -r Github repo"; echo " -d Dir inside package"; echo " -s Service name"; - echo " -a API domain"; - echo " -b Download domain"; + echo " -x Proxy"; } PROG_PATH= @@ -77,10 +76,8 @@ PROG_NAME= REPO= PKG_DIR= SRV_NAME= -API_DOMAIN=api.github.com -GH_DOMAIN=github.com -DL_DOMAIN=github.com -while getopts ":p:n:r:d:s:a:b:" OPT; do +SET_PROXY= +while getopts ":p:n:r:d:s:x:" OPT; do case $OPT in p) PROG_PATH=$OPTARG; @@ -97,11 +94,8 @@ while getopts ":p:n:r:d:s:a:b:" OPT; do s) SRV_NAME=$OPTARG; ;; - a) - API_DOMAIN=$OPTARG; - ;; - b) - DL_DOMAIN=$OPTARG; + x) + SET_PROXY="-x $OPTARG"; ;; :) echo "Option -$OPTARG requires an argument.";