mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-11-06 03:58:16 +08:00
Compare commits
9 Commits
v1.2
...
cba76bd304
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cba76bd304 | ||
|
|
5f27592fb4 | ||
|
|
3c10ebfaeb | ||
|
|
b33604ac14 | ||
|
|
00b7a550ab | ||
|
|
8f3b053bbd | ||
|
|
8eb2088331 | ||
|
|
d6d3167de3 | ||
|
|
2019f16e56 |
17
.github/workflows/gitee_sync_dependencies.yml
vendored
17
.github/workflows/gitee_sync_dependencies.yml
vendored
@@ -38,23 +38,6 @@ jobs:
|
|||||||
force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
|
force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
|
||||||
static_list: "antigen,zsh-syntax-highlighting,zsh-autosuggestions,zsh-completions" # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
|
static_list: "antigen,zsh-syntax-highlighting,zsh-autosuggestions,zsh-completions" # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
|
||||||
timeout: '600s' # git超时设置,超时后会自动重试git操作
|
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:
|
tmux-mem-cpu-load:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
7
.zshrc2
7
.zshrc2
@@ -22,7 +22,7 @@ if [[ "$DFS_NO_WALL" == "1" ]]; then
|
|||||||
ANTIGEN_URL="https://raw.githubusercontent.com/zsh-users/antigen/develop/bin/antigen.zsh"
|
ANTIGEN_URL="https://raw.githubusercontent.com/zsh-users/antigen/develop/bin/antigen.zsh"
|
||||||
ANTIGEN_OMZ_REPO_URL="https://github.com/ohmyzsh/ohmyzsh.git"
|
ANTIGEN_OMZ_REPO_URL="https://github.com/ohmyzsh/ohmyzsh.git"
|
||||||
ANTIGEN_PLUGINS=(
|
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-completions"
|
||||||
"https://github.com/zsh-users/zsh-autosuggestions"
|
"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_URL="https://gitee.com/dictxiong/antigen/raw/develop/bin/antigen.zsh"
|
||||||
ANTIGEN_OMZ_REPO_URL="https://gitee.com/dictxiong/ohmyzsh.git"
|
ANTIGEN_OMZ_REPO_URL="https://gitee.com/dictxiong/ohmyzsh.git"
|
||||||
ANTIGEN_PLUGINS=(
|
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-completions"
|
||||||
"https://gitee.com/dictxiong/zsh-autosuggestions"
|
"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
|
bindkey "\ed" delete-char # alt+d
|
||||||
|
|
||||||
# mods
|
|
||||||
autoload zcalc
|
|
||||||
|
|
||||||
# dfs
|
# dfs
|
||||||
dfs()
|
dfs()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -197,9 +197,6 @@ install_crontab()
|
|||||||
{
|
{
|
||||||
if [[ -x $(command -v crontab) ]]; then
|
if [[ -x $(command -v crontab) ]]; then
|
||||||
fmt_note "installing \"$CRON_JOB\" to crontab ..."
|
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 -
|
( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab -
|
||||||
else
|
else
|
||||||
fmt_warning "crontab does not exist. skipping ..."
|
fmt_warning "crontab does not exist. skipping ..."
|
||||||
|
|||||||
33
scripts/riot
33
scripts/riot
@@ -5,19 +5,6 @@ source "$THIS_DIR/../tools/common.sh"
|
|||||||
RIOT_TRUST_CLIENT=${RIOT_TRUST_CLIENT:-${DFS_TRUST:-0}}
|
RIOT_TRUST_CLIENT=${RIOT_TRUST_CLIENT:-${DFS_TRUST:-0}}
|
||||||
RIOT_TRUST_SERVER=${RIOT_TRUST_SERVER:-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
|
# get single server setting
|
||||||
# may be called more than once
|
# may be called more than once
|
||||||
get_server_meta() {
|
get_server_meta() {
|
||||||
@@ -33,24 +20,26 @@ get_server_meta() {
|
|||||||
if [[ "$remote" == *@* ]]; then
|
if [[ "$remote" == *@* ]]; then
|
||||||
RET_USERNAME=${remote%%@*}
|
RET_USERNAME=${remote%%@*}
|
||||||
remote=${remote#*@}
|
remote=${remote#*@}
|
||||||
check_username $RET_USERNAME || fmt_warning \"$RET_USERNAME\" is not a valid unix username
|
|
||||||
fi
|
fi
|
||||||
# if in the form ...:22
|
# if in the form ...:22
|
||||||
if [[ "$remote" == "["*"]":* || ( "$remote" != "["*"]" && "$remote" == *:* ) ]]; then
|
if [[ "$remote" == *:* ]]; then
|
||||||
RET_PORT=${remote##*:}
|
RET_PORT=${remote##*:}
|
||||||
remote=${remote%:*}
|
remote=${remote%:*}
|
||||||
check_port $RET_PORT || fmt_fatal invalid port number \"$RET_PORT\"
|
|
||||||
fi
|
fi
|
||||||
# presets -- match domain
|
# presets -- match domain
|
||||||
local domain=${remote##*.}
|
local domain=${remote##*.}
|
||||||
local host=${remote%.*}
|
local host=${remote%.*}
|
||||||
|
# if ends with dot
|
||||||
|
if [[ -z "$domain" ]]; then
|
||||||
|
domain="ibd"
|
||||||
|
fi
|
||||||
# if there's no dot
|
# if there's no dot
|
||||||
if [[ "$host" == "$domain" && "$host" != "["*"]" ]]; then
|
if [[ "$host" == "$domain" ]]; then
|
||||||
domain="ibd"
|
domain="ibd"
|
||||||
fi
|
fi
|
||||||
case $domain in
|
case $domain in
|
||||||
i|ibd )
|
ibd|ebd )
|
||||||
RET_HOSTNAME=$host.ibd.ink
|
RET_HOSTNAME=$host.$domain.ink
|
||||||
RET_PORT=${RET_PORT:-12022}
|
RET_PORT=${RET_PORT:-12022}
|
||||||
RET_USERNAME=${RET_USERNAME:-root}
|
RET_USERNAME=${RET_USERNAME:-root}
|
||||||
RET_TRUST_SERVER=1
|
RET_TRUST_SERVER=1
|
||||||
@@ -62,7 +51,7 @@ get_server_meta() {
|
|||||||
RET_JUMP_SERVER="ssh@nasp.ob.ac.cn:36022"
|
RET_JUMP_SERVER="ssh@nasp.ob.ac.cn:36022"
|
||||||
RET_TRUST_SERVER=1
|
RET_TRUST_SERVER=1
|
||||||
;;
|
;;
|
||||||
x|proxied )
|
proxied )
|
||||||
RET_HOSTNAME=proxy.beardic.cn
|
RET_HOSTNAME=proxy.beardic.cn
|
||||||
local tmp=$(sha256sum <<< "$host" | tr -cd "[:digit:]")
|
local tmp=$(sha256sum <<< "$host" | tr -cd "[:digit:]")
|
||||||
tmp=${tmp:0:4}
|
tmp=${tmp:0:4}
|
||||||
@@ -71,7 +60,7 @@ get_server_meta() {
|
|||||||
RET_TRUST_SERVER=1
|
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"
|
RET_HOSTNAME="$remote"
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -91,7 +80,7 @@ parse_remote() {
|
|||||||
local remote="$1"
|
local remote="$1"
|
||||||
local jump_servers=""
|
local jump_servers=""
|
||||||
# loop for jump servers
|
# loop for jump servers
|
||||||
while [[ -n $remote ]]; do
|
while [[ -n $remote ]]; do
|
||||||
local server=${remote%%,*}
|
local server=${remote%%,*}
|
||||||
remote=${remote#*,}
|
remote=${remote#*,}
|
||||||
get_server_meta "$server"
|
get_server_meta "$server"
|
||||||
|
|||||||
@@ -79,10 +79,6 @@ all()
|
|||||||
|
|
||||||
route()
|
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
|
if [[ $# -eq 0 ]]; then
|
||||||
all
|
all
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -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") = "0"
|
||||||
test $(echo | tools/common.sh ask_for_Yn "test") = "1"
|
test $(echo | tools/common.sh ask_for_Yn "test") = "1"
|
||||||
test $(DFS_QUIET=1 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
|
# check alias
|
||||||
alias p114
|
alias p114
|
||||||
|
|||||||
Reference in New Issue
Block a user