执迷 执迷
首页
  • 技术分享

    • 小白都能看懂的闭包
    • GO-GMP模型
    • MySQL调优
    • centos7部署nacos
    • elasticserch
    • redis
  • 发布一个node插件

    • 发布一个npm包
    • 如何打包一个插件工具库
    • 打包工具的选择
  • JavaScript
  • ES6
  • CSS
  • 框架
  • Node
  • 服务
  • 其他
自我介绍
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

执迷

代码也是艺术
首页
  • 技术分享

    • 小白都能看懂的闭包
    • GO-GMP模型
    • MySQL调优
    • centos7部署nacos
    • elasticserch
    • redis
  • 发布一个node插件

    • 发布一个npm包
    • 如何打包一个插件工具库
    • 打包工具的选择
  • JavaScript
  • ES6
  • CSS
  • 框架
  • Node
  • 服务
  • 其他
自我介绍
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 前端

  • 后端及运维

    • 服务
    • GMP模型
    • MySQL调优
    • centos7部署nacos
    • consul单台机器部署,注册外网服务健康检查
    • centos7安装ES
    • MySQL底层
    • centos7安装rabbitmq
    • docker部署redis
    • 平常常用命令
      • MySQL调优
    • 年终总结

    • 个人博客
    • 后端及运维
    刘某
    2024-07-30
    目录

    平常常用命令原创

    # 查看微信支付证书的serialNumber

    openssl x509 -in apiclient_cert.pem -noout -serial
    
    1

    # 查看端口是否被占用

    # win
    netstat -ano | findstr :30033
    
    # centos7
    # 查看端口是否被占用
    
    netstat -tuln | grep 8500
    
    lsof -i tcp:80
    
    # 启动服务
    nohup consul agent -config-file=/consul/ >/dev/null 2>&1 &
    
    # 输出当天生成的文件
    find / -type f -mtime 0 -exec ls -ltr --time-style="+%Y-%m-%d %H:%M:%S" {} \; | awk '{print $6,$7,$8,$9}' > output1.txt
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    # 1.代理端口8118问题

    #检查配置文件
    sudo vi /etc/profile
    
    1
    2

    # 启动单consul服务

    sudo consul agent -dev -client 0.0.0.0 -enable-script-checks -node=web -ui
    
    1

    # 部署server端

    # server

    docker run -d -p 8400:8500 --name=consul1 \
      --restart=always \
      -v /www/wwwroot/consul/consul.json:/consul/config.json \
      consul agent -config-file=/consul/
    
    1
    2
    3
    4

    # server2

    docker run -d -p 8401:8500 --name=consul2 \
      --restart=always \
      -v /www/wwwroot/consul/consul1.json:/consul/config.json \
      consul agent -config-file=/consul/
    
    1
    2
    3
    4

    # 部署client端

    docker run -d -p 8402:8500 --name=client \
      --restart=always \
      -v /www/wwwroot/consul/client.json:/consul/config.json \
      consul agent -config-file=/consul/
      
      
      10.0.8.13
    
    1
    2
    3
    4
    5
    6
    7

    # golang,win打包Linux

    set CGO_ENABLED=0
    
    set GOOS=linux
    set GOARCH=amd64
    go build -o superDigit
    go build -o fileName
    
    
    beego打包命令
    1.定位到工程的 main.go 文件夹目录
    2.执行命令,打包
    linux打包: bee pack -be GOOS=linux
    windows打包: bee pack -be GOOS=windows
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    # go设置代理

    # 修改国内镜像
    go env -w GOPROXY=https://goproxy.cn,direct  
    go env -w GO111MODULE=on
    
    1
    2
    3
    你可以使用一些命令行工具或脚本来将文件转换为哈希值
        使用CertUtil命令:
    
        打开命令提示符(CMD)或PowerShell。
        使用以下命令将文件转换为MD5哈希值:certutil -hashfile <文件路径> MD5
        使用以下命令将文件转换为SHA1哈希值:certutil -hashfile <文件路径> SHA1
        使用以下命令将文件转换为SHA256哈希值:certutil -hashfile <文件路径> SHA256
        替换 <文件路径> 为要转换的文件的完整路径。
        例如,如果要将 C:\Users\username\Documents\example.txt 文件转换为MD5哈希值,可以运行命令:
        certutil -hashfile C:\Users\username\Documents\example.txt MD5
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    vue使用ObserveVisibility
    
    第一步安装
    yarn add vue-observe-visibility 或
    npm i vue-observe-visibility
    
    第二部引入
    import Vue from 'vue'
    import VueObserveVisibility from 'vue-observe-visibility'
    
    Vue.use(VueObserveVisibility)
    或
    
    第三步使用
    <div v-observe-visibility="visibilityChanged">
        
    methods声明visibilityChanged(isVisible)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    # 重启网卡 shell脚本

    # 重启网卡 shell脚本
    systemctl stop NetworkManager.service
    ifdown ens33
    ifup ens33
    systemctl start NetworkManager.service
    
    1
    2
    3
    4
    5

    # nginx配置

    server {
         #SSL 默认访问端口号为 443
         listen 443 ssl; 
         #请填写绑定证书的域名
         server_name fjcs.xyz; 
         #请填写证书文件的相对路径或绝对路径
         ssl_certificate /www/wwwroot/SSL/fjcs.xyz_bundle.crt; 
         #请填写私钥文件的相对路径或绝对路径
         ssl_certificate_key /www/wwwroot/SSL/fjcs.xyz.key; 
         ssl_session_timeout 5m;
         #请按照以下协议配置
         ssl_protocols TLSv1.2 TLSv1.3; 
         #请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
         ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; 
         ssl_prefer_server_ciphers on;
         
        location /tpublic {
          #向响应添加Content-Type标头,使浏览器直接预览文件,而不是直接下载
          add_header Content-Type text/plain;
            # 处理跨域问题
            add_header Access-Control-Allow-Origin *;
          alias /www/wwwroot/speech-synthesis/tts_daokaineed/time_stamp_generate_csv;
        }
        # 直接转发
        location ^~/csv {
    	  proxy_pass http://47.110.131.9:39001;
         }
        # 直接转发
         location ^~/csvfile {
            # rewrite ^/uapi/api/(.*)$ /$1 break;
            # rewrite ^/uapi(.*)$ /$1 break;
    		   proxy_pass http://127.0.0.1:39990;
         }
         # 使用nginx代理vue代理  vue模式为history  没有#号需要加try_files
        location ^~/publicity {
            alias /www/wwwroot/lexiang/Home/dist; 
            index  index.html index.htm;
            try_files $uri $uri/ /index.html break;
         }
        
         # 绑定域名根目录访问地址
         location ^~/QRcode {
            alias  /www/wwwroot/lexiang/QRcode/dist;
            index  index.html;
            try_files $uri $uri/ /QRcode/index.html;
         }
         
         # 绑定域名根目录访问地址 转发地址   并且携带
         location ^~/ {
            proxy_set_header   Host $host;
                proxy_set_header   X-Real-IP $remote_addr;
                proxy_set_header   X-Real-PORT $remote_port;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://127.0.0.1:8080;
                error_page 405 =200 http://$host$request_uri;
         }
         
         location ^~/home {
            proxy_set_header   Host $host;
                proxy_set_header   X-Real-IP $remote_addr;
                proxy_set_header   X-Real-PORT $remote_port;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://127.0.0.1:8080;
                error_page 405 =200 http://$host$request_uri;
         }
    
         
         location ^~/QRapi {
                proxy_set_header   Host $host;
                proxy_set_header   X-Real-IP $remote_addr;
                proxy_set_header   X-Real-PORT $remote_port;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                
                proxy_pass http://127.0.0.1:39100;
                error_page 405 =200 http://$host$request_uri;
        }
        
        
     }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    "changge_test1"
    "qqqwwwee11"
    document.getElementById("login_account").value = "changge_test1"
    document.getElementById("password").value = "qqqwwwee11"
    document.getElementById("password1").value = "qqqwwwee11"
    document.getElementById("name-p").value = "曾兆先"
    document.getElementById("id_card_number-p").value = "412928194606080028"
    
    1
    2
    3
    4
    5
    6
    7
    #运维
    上次更新: 2024/07/30, 22:53:10
    docker部署redis
    MySQL调优

    ← docker部署redis MySQL调优→

    最近更新
    01
    MySQL调优 原创
    08-04
    02
    MySQL底层 原创
    07-30
    03
    consul单台机器部署,注册外网服务健康检查 原创
    07-30
    更多文章>
    Theme by Vdoing | Copyright © 2019-2024 执迷 | 闽ICP备2022018045号 | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式