9 Commits

6 changed files with 13 additions and 52 deletions

View File

@@ -38,23 +38,6 @@ jobs:
force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
static_list: "antigen,zsh-syntax-highlighting,zsh-autosuggestions,zsh-completions" # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
timeout: '600s' # git超时设置,超时后会自动重试git操作
zdharma-continuum:
runs-on: ubuntu-20.04
steps:
- name: zdharma-continuum repos # 名字随便起
uses: Yikun/hub-mirror-action@v1.2 # 使用Yikun/hub-mirror-action
with:
src: github/zdharma-continuum # 源端账户名(github)
dst: gitee/dictxiong # 目的端账户名(gitee)
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} # SSH密钥对中的私钥
dst_token: ${{ secrets.GITEE_TOKEN }} # Gitee账户的私人令牌
src_account_type: org
dst_account_type: user # 账户类型
clone_style: "https" # 使用https方式进行clone,也可以使用ssh
debug: true # 启用后会显示所有执行命令
force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
static_list: "fast-syntax-highlighting" # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
timeout: '600s' # git超时设置,超时后会自动重试git操作
tmux-mem-cpu-load:
runs-on: ubuntu-20.04
steps:

View File

@@ -22,7 +22,7 @@ if [[ "$DFS_NO_WALL" == "1" ]]; then
ANTIGEN_URL="https://raw.githubusercontent.com/zsh-users/antigen/develop/bin/antigen.zsh"
ANTIGEN_OMZ_REPO_URL="https://github.com/ohmyzsh/ohmyzsh.git"
ANTIGEN_PLUGINS=(
"https://github.com/zdharma-continuum/fast-syntax-highlighting"
"https://github.com/zsh-users/zsh-syntax-highlighting"
"https://github.com/zsh-users/zsh-completions"
"https://github.com/zsh-users/zsh-autosuggestions"
)
@@ -30,7 +30,7 @@ else
ANTIGEN_URL="https://gitee.com/dictxiong/antigen/raw/develop/bin/antigen.zsh"
ANTIGEN_OMZ_REPO_URL="https://gitee.com/dictxiong/ohmyzsh.git"
ANTIGEN_PLUGINS=(
"https://gitee.com/dictxiong/fast-syntax-highlighting"
"https://gitee.com/dictxiong/zsh-syntax-highlighting"
"https://gitee.com/dictxiong/zsh-completions"
"https://gitee.com/dictxiong/zsh-autosuggestions"
)
@@ -140,9 +140,6 @@ bindkey "\e[1;5D" backward-word # alt+left_arrow; termius
bindkey "\ed" delete-char # alt+d
# mods
autoload zcalc
# dfs
dfs()
{

View File

@@ -197,9 +197,6 @@ install_crontab()
{
if [[ -x $(command -v crontab) ]]; then
fmt_note "installing \"$CRON_JOB\" to crontab ..."
if ! crontab -l 1>/dev/null 2>&1; then
echo -n | crontab -
fi
( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab -
else
fmt_warning "crontab does not exist. skipping ..."

View File

@@ -5,19 +5,6 @@ source "$THIS_DIR/../tools/common.sh"
RIOT_TRUST_CLIENT=${RIOT_TRUST_CLIENT:-${DFS_TRUST:-0}}
RIOT_TRUST_SERVER=${RIOT_TRUST_SERVER:-0}
# check if port number valid
check_port() {
( echo $1 | grep -qxE "[1-9][0-9]{0,4}" ) || return 1
test $1 -lt 65536 -a $1 -gt 0 || return 1
return 0
}
# check if username valid
check_username() {
( echo $1 | grep -qxE "^[a-z][-a-z0-9_]*\$" ) || return 1
return 0
}
# get single server setting
# may be called more than once
get_server_meta() {
@@ -33,24 +20,26 @@ get_server_meta() {
if [[ "$remote" == *@* ]]; then
RET_USERNAME=${remote%%@*}
remote=${remote#*@}
check_username $RET_USERNAME || fmt_warning \"$RET_USERNAME\" is not a valid unix username
fi
# if in the form ...:22
if [[ "$remote" == "["*"]":* || ( "$remote" != "["*"]" && "$remote" == *:* ) ]]; then
if [[ "$remote" == *:* ]]; then
RET_PORT=${remote##*:}
remote=${remote%:*}
check_port $RET_PORT || fmt_fatal invalid port number \"$RET_PORT\"
fi
# presets -- match domain
local domain=${remote##*.}
local host=${remote%.*}
# if ends with dot
if [[ -z "$domain" ]]; then
domain="ibd"
fi
# if there's no dot
if [[ "$host" == "$domain" && "$host" != "["*"]" ]]; then
if [[ "$host" == "$domain" ]]; then
domain="ibd"
fi
case $domain in
i|ibd )
RET_HOSTNAME=$host.ibd.ink
ibd|ebd )
RET_HOSTNAME=$host.$domain.ink
RET_PORT=${RET_PORT:-12022}
RET_USERNAME=${RET_USERNAME:-root}
RET_TRUST_SERVER=1
@@ -62,7 +51,7 @@ get_server_meta() {
RET_JUMP_SERVER="ssh@nasp.ob.ac.cn:36022"
RET_TRUST_SERVER=1
;;
x|proxied )
proxied )
RET_HOSTNAME=proxy.beardic.cn
local tmp=$(sha256sum <<< "$host" | tr -cd "[:digit:]")
tmp=${tmp:0:4}
@@ -71,7 +60,7 @@ get_server_meta() {
RET_TRUST_SERVER=1
;;
* )
test -z "$domain" || fmt_warning "unknown domain: \"$domain\". will try as host name"
fmt_warning "unknown domain: $domain. will try as host name"
RET_HOSTNAME="$remote"
esac
}
@@ -91,7 +80,7 @@ parse_remote() {
local remote="$1"
local jump_servers=""
# loop for jump servers
while [[ -n $remote ]]; do
while [[ -n $remote ]]; do
local server=${remote%%,*}
remote=${remote#*,}
get_server_meta "$server"

View File

@@ -79,10 +79,6 @@ all()
route()
{
os_type="$(get_os_type)"
if [[ "$os_type" == "msys" || "$os_type" == "cygwin" ]]; then
fmt_fatal "unsupported platform: $os_type. you may use WinCryptSSHAgent."
fi
if [[ $# -eq 0 ]]; then
all
return

View File

@@ -31,7 +31,6 @@ test $(echo n | tools/common.sh ask_for_yN "test") = "0"
test $(echo | tools/common.sh ask_for_yN "test") = "0"
test $(echo | tools/common.sh ask_for_Yn "test") = "1"
test $(DFS_QUIET=1 tools/common.sh ask_for_Yn "test") = "1"
test "$(DFS_TRUST=1 riot time@is.impt:2222,yes@you-r.right,you@are.really.recht.,ibd.,try@it scp /tmp/ ./tmp -D 2>/dev/null)" = 'scp -P 12022 -o ControlMaster=auto -o ControlPath=/tmp/sshcm-%C -o PermitLocalCommand=yes -o ProxyJump=time@is.impt:2222,yes@you-r.right,you@are.really.recht.,ibd. -r try@it.ibd.ink:"/tmp/" "./tmp"'
# check alias
alias p114