tianyun 9 hónapja
szülő
commit
080faa9b59
5 módosított fájl, 68 hozzáadás és 63 törlés
  1. 7 0
      README.md
  2. 1 0
      mac_config.sh
  3. 51 0
      pri_config.sh
  4. 7 56
      sh_config.sh
  5. 2 7
      ssh_config.sh

+ 7 - 0
README.md

@@ -13,3 +13,10 @@ done
 alias sync_config_file='cd ~/sync && git pull && git add . && git commit -m 123 && git push'
 alias vim-config-file='idea ~/sync'
 ```
+
+
+# 使用一次
+```bash
+source <(curl -s https://git.tianyunperfect.cn/tianyunperfect/sync/raw/master/sh_config.sh)
+```
+# 

+ 1 - 0
mac_config.sh

@@ -0,0 +1 @@
+alias notify='function _notify() { osascript -e "display notification \"$1\""; }; _notify'

+ 51 - 0
pri_config.sh

@@ -0,0 +1,51 @@
+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"
+}

+ 7 - 56
sh_config.sh

@@ -1,13 +1,10 @@
 
-
-
 # 快捷命令
 ## 未分类
 alias ll='ls -alh --time-style="+%Y-%m-%d %H:%I:%S"'
 #du -sh * 2>/dev/null | sort -hr
 alias du-sh='du -sh * 2>/dev/null | sort -hr'
 alias sourcevenv='source venv/bin/activate'
-alias notify='function _notify() { osascript -e "display notification \"$1\""; }; _notify'
 
 alias weather='curl wttr.in/beijing'
 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(){
   arp -a
 }
@@ -377,6 +321,7 @@ alias nodedefault='fnm default'
 alias nodeinstall='fnm install'
 alias nodelsremote='fnm ls-remote'
 alias nodeuninstall='fnm uninstall'
+
 alias catnodeversion='node --version > .node-version'
 
 
@@ -386,3 +331,9 @@ alias yarnadd='yarn add'
 alias yarnremove='yarn remove'
 alias yarninstall='yarn install'
 
+
+function echosync() {
+echo '
+source <(curl -s https://git.tianyunperfect.cn/tianyunperfect/sync/raw/master/sh_config.sh)
+'
+}

+ 2 - 7
ssh_config.sh

@@ -27,17 +27,12 @@ alias ssh-212='expect -c " spawn ssh root@192.168.10.212
                send \"123456\r\"
                interact
                "'
-alias ssh-89='expect -c " spawn ssh root@192.168.10.89
+alias ssh-189='expect -c " spawn ssh root@192.168.10.189
                expect \"password:\"
                send \"123456\r\"
                interact
                "'
-alias ssh-89='expect -c " spawn ssh root@192.168.10.89
-               expect \"password:\"
-               send \"123456\r\"
-               interact
-               "'
-alias ssh-89='expect -c " spawn ssh root@192.168.10.89
+alias ssh-181='expect -c " spawn ssh root@192.168.10.181
                expect \"password:\"
                send \"123456\r\"
                interact