<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-204  評論-90  文章-8  trackbacks-0
      2024年2月4日
    此問題是由于升級 macos sonoma 14.2.1 引起的
    解決辦法,重新安裝xcode  
    rm -rf /Library/Developer/CommandLineTools
    xcode
    -select --install
    posted @ 2024-02-04 13:57 一凡 閱讀(51) | 評論 (0)編輯 收藏
      2023年11月10日
    # Springboot整合activiti
    源代碼:https://gitee.com/yifan88899/acttest

    ## 版本說明
    - springboot 2.4.2
    - activiti 7.1.0.M6
    - mysql 8.0.28
    ## 插件安裝
    - Activiti BPMN visualizer
    ## Bpmn流程圖位置
    - 流程圖xmlpng需放在resources/processes
    ## Test
    - Test Case 都可執行,包括:
    - 流程查詢
    - 流程部署
    - 流程啟動
    - 流程拾取、完成操作
    ## Mysql
    - 需要啟動Mysql8
    - 數據庫名Activiti7
    - activiti會版建表

    posted @ 2023-11-10 15:56 一凡 閱讀(96) | 評論 (0)編輯 收藏
      2021年8月5日
    1、打開my.cnf 加入 skip-grant-tables
    2、mysql.service stop && mysql.service start
    3、清空root密碼 并 退出
        update mysql.user set authentication_string='' where user='root';  
    4、mysql.service stop && mysql.service start
    5、mysql -root   免密登錄并修改root密碼
        alter user 'root'@'%' identified by 'pass$123';
        alter user 'root'@'localhost' identified by 'pass$123';

    確定是否支持遠程登錄,host中有%的記錄即支持
    select host, user, authentication_string, plugin from user;
    posted @ 2021-08-05 18:06 一凡 閱讀(202) | 評論 (0)編輯 收藏
      2021年6月22日

    64e696 綠色
    5a97ff 藍色
    ffdb5a 黃色
    ff8b64 橙色
    ff5a65 紅色
    e00b5d 粉紅
    666666 深灰
    3cc7f5 淺藍
    f5863c 淺橙
    b00072 枚紅
    674ea7 紫色
    999999 灰色
    posted @ 2021-06-22 17:46 一凡 閱讀(83) | 評論 (0)編輯 收藏
      2021年1月18日
    #!/usr/bin/expect
    ####################
    set pass xxxx
    set user yyyy
    ####################
    spawn ssh -p 35000 -o StrictHostKeyChecking=no "${user}@xgrelay.xxxx.com"
    expect {
      -re ".*Dkey.*" { gets stdin dkey; send "$dkey\r"; exp_continue}
      -re "Option>:"  { send "1\r" ;}
      -re "Password>:" { send "$pass\r" ; exp_continue }
      -re "password:" { send "$pass\r" ; exp_continue }
    }
    posted @ 2021-01-18 11:35 一凡 閱讀(162) | 評論 (0)編輯 收藏
      2020年9月10日
    -- data export csv   其中 $1=$1 如果不加指定分隔符不生效
    mysql -uadmin -ptest -h127.0.0.1 -P3306 -e "select * from test where create_time > unix_timestamp('2020-09-10 00:00:00'and status = 99| awk '{OFS=","}{$1=$1;print $0}'

    #csv中文轉碼
    tmpfn="exempt-update-3.30.csv";iconv -c -s -f UTF-8 -t GBK $tmpfn > /tmp/$tmpfn && mv /tmp/$tmpfn .
    posted @ 2020-09-10 22:08 一凡 閱讀(186) | 評論 (0)編輯 收藏
      2020年4月20日
    #!/bin/bash

    for f in "$@"do
        if [ -f "$f" ]; then
            iconv -s -c -f UTF8 -t GBK "$f" > /tmp/$f.tmp
            mv /tmp/$f.tmp "$f"
        fi
    done
    posted @ 2020-04-20 10:03 一凡 閱讀(185) | 評論 (0)編輯 收藏
      2020年2月29日
    # -*- coding: utf-8 -*-
    #
    !/usr/bin/python

    import re
    import io
    import sys

    # obj = re.compile(r'(?P<ip>.*?)- - \[(?P<time>.*?)\] "(?P<request>.*?)" (?P<status>.*?) (?P<bytes>.*?) "(?P<referer>.*?)" "(?P<ua>.*?)"')
    #
     example:xxxx"id":2640914,"orderId":144115188137125591xxxx"state":10xxxxx"
    # 日志整行都需要匹配,需要用的用具體正則匹配,如(\d{7}),不需要的用(.*)匹配,總之所有需要或不需要部分都用()括起來
    obj = re.compile(r'(.*"id":)(\d{7})(.*"orderId":)(\d{18})(.*"state":)(\d{2})(.*)')

    def load_log(path):
    # 讀取文件
        with io.open(path, mode="r", encoding="utf-8") as f:
            for line in f:
                line = line.strip()
                parse(line)

    def stdin():
    # 讀取管道輸入
        for line in sys.stdin:
            parse(line)

    def parse(line):
    # 解析單行nginx日志
        try:
            result = obj.match(line)
            print(result.group(2,4,6))
        except:
            pass

    if __name__ == '__main__':
        # load_log("/tmp/227.log")
        stdin()
    posted @ 2020-02-29 02:10 一凡 閱讀(294) | 評論 (0)編輯 收藏
      2019年12月26日
    1. 新增中間件cors
    2. func Cors() gin.HandlerFunc {
      return func(c *gin.Context) {
      method := c.Request.Method

      c.Header("Access-Control-Allow-Origin", "*") //必選
           c.Header("Access-Control-Allow-Headers", "*") //可選 如果request有header, 必選
           //c.Header("Access-Control-Allow-Credentials", "true") //可選
      //c.Header("Access-Control-Allow-Methods", "*") //可選
      //c.Header("Access-Control-Expose-Headers", "*") //可選

      //放行所有OPTIONS方法
      if method == "OPTIONS" {
      c.AbortWithStatus(http.StatusOK)
      }
      // 處理請求
      c.Next()
      }
      }
    3. 在router里增加cors,必須在group之前,全局設置
      r.Use(gin.Logger(), gin.Recovery(), cors.Cors())
    4. 測試代碼,header設置不能多于cors設置
      <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta charset="UTF-8">
      <title>Title</title>
      </head>
      <link type="test/css" href="css/style.css" rel="stylesheet">
      <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
      <script type="text/javascript">
      $(function(){
      $("#cors").click(
      function(){
      $.ajax({
      headers:{
      "Content-Type":"application/json;charset=UTF-8",
      "Access":"adsad",
      "Access-Token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJwYXNzd29yZCI6InRlc3QxMjM0NTYiLCJleHAiOjE1NzczMzY3MTIsImlzcyI6Imdpbi1ibG9nIn0.wMlQXqZO2V0LR-FIgDh45LWI0OYMYi6an_NvRmF0Nug"
      },
      url:"http://127.0.0.1:8000/api/v1/articles",
      success:function(data){
      console.log("start");
      console.log(data);
      }
      })
      });
      });
      </script>
      <body>
      <input type="button" id="cors" value="core跨域測試">
      </body>
      </html>
    5. 請求的headers數量、名稱與cors里的設置需要嚴格對應,不然報錯如下
      Access to XMLHttpRequest at 'http://127.0.0.1:8000/api/v1/articles' from origin 'http://localhost:9999' has been blocked by CORS policy: Request header field access is not allowed by Access-Control-Allow-Headers in preflight response.
    posted @ 2019-12-26 11:17 一凡 閱讀(325) | 評論 (0)編輯 收藏
      2019年12月23日
    1、在main函數中增加全局配置,其中@name就是你確定的鑒權參數名,我的是token,    @in header 說明參數放在header,你的鑒權代碼需要從header中獲取

    // @title gin-blog API
    // @version 0.0.1
    // @description This is a gin blog example
    // @securityDefinitions.apikey ApiKeyAuth
    // @in header
    // @name token
    // @BasePath /

    2、在具體的handler里添加如下注釋,此處的ApiKeyAuth和main中的apike對應,切記不要修改
    // @Security ApiKeyAuth

    3、swagger頁面如下:


    4、添加token后,后續所有有鑒權接口的header里自動攜帶token
    posted @ 2019-12-23 16:08 一凡 閱讀(1991) | 評論 (0)編輯 收藏
    僅列出標題  下一頁
    主站蜘蛛池模板: 丁香花在线观看免费观看图片| wwwxxx亚洲| 中国黄色免费网站| 亚洲综合色视频在线观看| 在线视频亚洲一区| 免费人成视网站在线观看不卡| 国产成人亚洲午夜电影| www.亚洲精品.com| 精品国产呦系列在线观看免费| 自拍偷自拍亚洲精品被多人伦好爽| 两个人看的www免费高清| 亚洲欧洲无码AV电影在线观看| 巨胸喷奶水www永久免费| 亚洲av无码乱码国产精品 | 精品久久久久久亚洲中文字幕| 青青青国产免费一夜七次郎| 国产午夜亚洲精品不卡免下载| 亚洲精品乱码久久久久久蜜桃 | 外国成人网在线观看免费视频| 亚洲第一福利网站| 成人在线免费看片| 国产偷国产偷亚洲高清人| 亚洲精品无码久久久久去q| 久久国产精品2020免费m3u8| 亚洲卡一卡2卡三卡4麻豆| 国产午夜无码视频免费网站| 一级做受视频免费是看美女| 亚洲av不卡一区二区三区| 99久久免费国产香蕉麻豆 | 久久精品国产亚洲AV天海翼| 亚洲一本大道无码av天堂| 污污网站免费观看| 国产精品久久亚洲一区二区| 亚洲无av在线中文字幕| 无码乱肉视频免费大全合集| 青青草国产免费国产是公开| 午夜影视日本亚洲欧洲精品一区| 成人性生交大片免费看无遮挡| 成人午夜免费视频| 亚洲免费在线视频播放| 亚洲国产精品人人做人人爽|