Python-多进程日志文件拆分

import logging import colorlog import time from multiprocessing import Process, current_process def _job(event_id): [logging.root.removeHandler(handler) for handler in logging.root.handlers[:]] colorlog.basicConfig( level=logging.DEBUG, format="[%(asctime)s%(log_color)s%(levelname)-8s%(reset)s%(processName)spid:%(process)d] %(message)s" "%(name)s:%(lineno)d", filename="main_{0}.log".format(event_id), filemode='a+', ) count = 0 while True: time.sleep(0.1) logger = logging.getLogger(__name__) logger.error("fuck: {0}{1}".format(id(logger), event_id)) count += 1 if count == 100: break if __name__ == '__main__': jobs = [] # 生成 for _event_id in range(10): _p = Process(target=_job, name="{0}_{1}".format(current_process().name, _event_id), args=(_event_id,))……

阅读全文

Node-npm入门教程

JavaScript经典工具库 https://github.com/sorrycc/awesome-javascript https://www.cnblogs.com/fundebug/p/13_js_utilities_you_need.html Underscore或者Lodash Ramda MathJS Moment & date-fns Sugar Lazy CollectJS ChanceJS ChartJS Polished Mout Voca Licia 常见命令 安装包 # 本地安装 ### # 将安装……

阅读全文

Flask-WSGI规范

WSGI规范(PEP 3333) WSGI 的全称是:Web Server Gateway Interface,介于 web server(uwsgi) 和应用 server (flask)之间的接口规范。当使用 Python 进行 web 开发时,……

阅读全文

Python-Windows安装Crypto

Windows安装Crypto m2crypto vs pycrypto vs pycryptodome m2crypto:30+的星星,windows的兼容性较差,pip上面默认的版本不是whl包……

阅读全文

Kafka-集群安装文档

kafka集群安装文档 一、架构 # zookeeper和kafka架构 producer producer producer | | | -------------------- | zookeeper zookeeper zookeeper (zookeeper支持failover,至……

阅读全文

Axios-学习文档

axios链式请求 const axios = require('axios') // 全局配置文件 axios.defaults.baseURL = 'https://httpbin.org'; axios.defaults.timeout = 100000; console.log('第一次异步请求数据:/json'); axios.get('/json').then(response……

阅读全文

ECMAScript6-标准

环境搭建 创建目录 C:\Users\Administrator\WebstormProjects\es6 项目初始化 # 主要用于生成配置文件 package.json # 静默生成配置文件 # npm init --yes cd es6 && npm init 安装基础依赖包 常见组件安装 npm install --save-dev @babel/core @babel/cli @babel/preset-env @babel/node # npm……

阅读全文

前端工具

diagram-designer 流程图,思维导图,电路图,GUI界面布局设计 Snipaste 一个简单但强大的截图工具 F1可以截图,同时测量大小,设置箭头,书写文字 F3在桌面置顶……

阅读全文

Kafka-代理(NAT)

一、kafka配置 1.1 配置文件修改 vim /usr/local/kafka/config/server.properties listeners=PLAINTEXT://:9092 # 必须声明域名 advertised.listeners=PLAINTEXT://test.kafka:9092 1.2 hosts绑定(必须绑定) # vim /etc/hosts # host 绑定本地内网ip 10.0.26.26 test.kafka 二、nat服务器配置……

阅读全文

Iptables-芝麻开门

端口碰撞 端口容易破解,因为一般探测器都是扫描端口,而ping很少用,所以用ping会保险一点,所以其实是包大小碰撞。 包大小碰撞 包大小……

阅读全文