摘要: nginx跨域配置 配置参考1 location / { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' alway 阅读全文
posted @ 2024-01-02 16:06 Sincere_Ye 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 容器运行出现 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(256) 问题 原因是打印的内容有中文,编码出现问题 Dockerfile中,添加一行,设置环 阅读全文
posted @ 2023-08-08 12:23 Sincere_Ye 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 第一种情况:比如说我新建了一个click表,进行了迁移,后发现表不对需要重新建表 1.先删除models中定义的表 2.删除makemigrations生成的文件system/migrations/0007_auto_20201027_1105.py 3.将数据库中django_migrations 阅读全文
posted @ 2022-04-28 21:17 Sincere_Ye 阅读(195) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash # 存放文件路径 FILE="./temp_es_data.txt" # ES访问地址 HOST="xxx.xxx.xxx.xxx:11414" # ES index INDEX="api-gateway-prd-error-2023.02.19" # ES type TYP 阅读全文
posted @ 2021-08-18 19:34 Sincere_Ye 阅读(153) 评论(0) 推荐(0) 编辑
摘要: cpu利用率控制脚本:/data/nlu/cpu_tools/test_image_cpu.py import os import threading import multiprocessing import argparse def dead_circle(n): i = n while Tru 阅读全文
posted @ 2021-07-26 19:29 Sincere_Ye 阅读(370) 评论(0) 推荐(0) 编辑
摘要: websocket_test.html,使用浏览器打开html文件,即可在console中看到三次websocket连接的结果 <!DOCTYPE HTML> <html> <head> <script type = "text/javascript"> function WebSocketTest 阅读全文
posted @ 2021-07-03 15:17 Sincere_Ye 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 推荐使用python3.6以上版本来运行websockets pip3 install websockets 主要用到的API有: websockets.connect() websockets.send() websockets.recv() server.py,用于搭建webscocket服务器 阅读全文
posted @ 2021-03-08 16:01 Sincere_Ye 阅读(12755) 评论(2) 推荐(0) 编辑
摘要: nginx.conf配置文件 worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [ 阅读全文
posted @ 2021-02-26 19:58 Sincere_Ye 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 1.Python中json和dict的关系与区别, 参考 https://medium.com/analytics-vidhya/python-dictionary-and-json-a-comprehensive-guide-ceed58a3e2ed#:~:text=In%20Python%2C% 阅读全文
posted @ 2021-01-13 21:46 Sincere_Ye 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 1.查看当前在线用户:w/who [root@VM-0-7-centos home]# w 第一行信息: 00:26:57:系统当前时间 up 18 days,8:36:系统已运行时间 4 users:当前在线用户个数 load average:系统负载,三个值为过去1、5、15分钟的平均负载 第二 阅读全文
posted @ 2020-11-30 02:35 Sincere_Ye 阅读(104) 评论(0) 推荐(0) 编辑