|
@@ -1,13 +1,10 @@
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
# 快捷命令
|
|
# 快捷命令
|
|
## 未分类
|
|
## 未分类
|
|
alias ll='ls -alh --time-style="+%Y-%m-%d %H:%I:%S"'
|
|
alias ll='ls -alh --time-style="+%Y-%m-%d %H:%I:%S"'
|
|
#du -sh * 2>/dev/null | sort -hr
|
|
#du -sh * 2>/dev/null | sort -hr
|
|
alias du-sh='du -sh * 2>/dev/null | sort -hr'
|
|
alias du-sh='du -sh * 2>/dev/null | sort -hr'
|
|
alias sourcevenv='source venv/bin/activate'
|
|
alias sourcevenv='source venv/bin/activate'
|
|
-alias notify='function _notify() { osascript -e "display notification \"$1\""; }; _notify'
|
|
|
|
|
|
|
|
alias weather='curl wttr.in/beijing'
|
|
alias weather='curl wttr.in/beijing'
|
|
alias dust1='dust -d 1'
|
|
alias dust1='dust -d 1'
|
|
@@ -313,59 +310,6 @@ function mvn_clean_deploy() {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-memo() {
|
|
|
|
- # 获取传入的参数
|
|
|
|
- updatedContent=$*
|
|
|
|
- # 转义特殊字符
|
|
|
|
-# escapedContent=$(echo -n "$updatedContent" | jq -sRr @uri)
|
|
|
|
-
|
|
|
|
- # 构建请求体数据
|
|
|
|
-# data="{\"content\": \"$escapedContent\"}"
|
|
|
|
- # 构建请求体数据
|
|
|
|
- data="{\"content\": \"$updatedContent\"}"
|
|
|
|
-
|
|
|
|
- # 发送请求
|
|
|
|
- response=$(curl -s -X POST -H "Content-Type: application/json" \
|
|
|
|
- -H "Authorization: bearer eyJhbGciOiJIUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJuYW1lIjoidGlhbnl1bnBlcmZlY3QiLCJpc3MiOiJtZW1vcyIsInN1YiI6IjEiLCJhdWQiOlsidXNlci5hY2Nlc3MtdG9rZW4iXSwiaWF0IjoxNzA5MTc5NTUyfQ.LFxWB4efya1sL7VoJ42xpXxbAip-udT_Kx2OwZ8Y3-E" \
|
|
|
|
- -d "$data" \
|
|
|
|
- "https://memos.tianyunperfect.cn/api/v1/memo")
|
|
|
|
-
|
|
|
|
- # 判断是否存在name字段
|
|
|
|
- if [[ $response == *"name"* ]]; then
|
|
|
|
- echo "记录成功 https://memos.tianyunperfect.cn"
|
|
|
|
- else
|
|
|
|
- echo "失败" $response
|
|
|
|
- fi
|
|
|
|
-}
|
|
|
|
-todo(){
|
|
|
|
- memo "#todo $*"
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-function upload_file() {
|
|
|
|
- file_path=$1
|
|
|
|
- if [ -z "$file_path" ]; then
|
|
|
|
- echo "Error: file_path is empty!"
|
|
|
|
- return 1
|
|
|
|
- fi
|
|
|
|
- if [ ! -f "$file_path" ]; then
|
|
|
|
- echo "Error: file not exist!"
|
|
|
|
- return 1
|
|
|
|
- fi
|
|
|
|
- oss_path=$2
|
|
|
|
- # 如果没有传入oss路径,则
|
|
|
|
- if [ -z "$oss_path" ]; then
|
|
|
|
- oss_path="file"
|
|
|
|
- fi
|
|
|
|
- curl -k -X POST -F "file=@$file_path" -F "oss_path=$oss_path" https://web_history.tianyunperfect.cn/oss/upload_file
|
|
|
|
-
|
|
|
|
- file_name=$(basename "$file_path")
|
|
|
|
- echo ''
|
|
|
|
- echo "https://alist.tianyunperfect.cn/oss_gang/$oss_path/$file_name"
|
|
|
|
- echo "https://tianyunperfect.oss-cn-hongkong.aliyuncs.com/$oss_path/$file_name"
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
function show_all_local_ip(){
|
|
function show_all_local_ip(){
|
|
arp -a
|
|
arp -a
|
|
}
|
|
}
|
|
@@ -377,6 +321,7 @@ alias nodedefault='fnm default'
|
|
alias nodeinstall='fnm install'
|
|
alias nodeinstall='fnm install'
|
|
alias nodelsremote='fnm ls-remote'
|
|
alias nodelsremote='fnm ls-remote'
|
|
alias nodeuninstall='fnm uninstall'
|
|
alias nodeuninstall='fnm uninstall'
|
|
|
|
+
|
|
alias catnodeversion='node --version > .node-version'
|
|
alias catnodeversion='node --version > .node-version'
|
|
|
|
|
|
|
|
|
|
@@ -386,3 +331,9 @@ alias yarnadd='yarn add'
|
|
alias yarnremove='yarn remove'
|
|
alias yarnremove='yarn remove'
|
|
alias yarninstall='yarn install'
|
|
alias yarninstall='yarn install'
|
|
|
|
|
|
|
|
+
|
|
|
|
+function echosync() {
|
|
|
|
+echo '
|
|
|
|
+source <(curl -s https://git.tianyunperfect.cn/tianyunperfect/sync/raw/master/sh_config.sh)
|
|
|
|
+'
|
|
|
|
+}
|