elasticsearch
docker 安装 elasticsearch1docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.8.0
kibana1docker run -d --name kibana --link elasticsearch:elasticsearch -p 5601:5601 kibana:7.8.0
docker 安装 elasticsearch-head1docker run -d --name elasticsearch-head -p 9100:9100 mobz/elasticsearch-head:5
Elasticsearch-head 数据浏览无显示解决办法https://blog.csdn.net/weixin_42830314/article/details/108316045
进入 es-head 容器里面的 _site目录修改配置文件vendor.js
6886行conte ...
Adding API Key Authentication to a FastAPI application
https://joshdimella.com/blog/adding-api-key-auth-to-fast-api
Step 1: Define a List of Valid API Keys12345API_KEYS = [ "9d207bf0-10f5-4d8f-a479-22ff5aeff8d1", "f47d4a2c-24cf-4745-937e-620a5963c0b8", "b7061546-75e8-444b-a2c4-f19655d07eb8",]
Step 2: Implement API Key Security Function123456789101112131415161718192021222324252627282930from fastapi import HTTPException, status, Security, FastAPIfrom fastapi.security import APIKeyHeader, APIKeyQueryapi_key_query ...
js 利用正则表达式统计中文字符 size
123456export default { counts_zh_str (str) { str = str.replace(/[^\x00-\xff]/g, "00") return str.length }}
js es6 实现 sleep 阻塞
12345export default { async sleep(time){ return new Promise((resolve) => setTimeout(resolve, time)); }}
fastapi设置响应示例
123456789101112131415161718192021222324252627282930class Test(BaseModel): name: str description: int created_at: str updated_at: str data: dict @validator("data", pre=True) def parse_data(cls, value): return json.loads(value) if value else {} @validator("created_at", pre=True) def parse_created_at(cls, value): return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(value))) @validator("updated_at", ...
docker镜像加速
vi /etc/docker/daemon.json #编辑此文件,添加以下文件从上往下依次是:中国科技大学、docker中国站
123456{ "registry-mirrors": [ "https://docker.mirrors.ustc.edu.cn", "https://registry.docker-cn.com", ]}
docker安装部署rancher
https://www.cnblogs.com/mn609/articles/16070101.html
docker搭建discuz
https://blog.csdn.net/m0_55070913/article/details/124173304
python时间处理
12345678910111213a1 = "2019-5-10"# 先转换为时间数组timeArray = time.strptime(a1, "%Y-%m-%d")# 转换为时间戳timeStamp = int(time.mktime(timeArray))dt = datetime.fromtimestamp(timeStamp)# 当前时间timeStamp = time.time()dt2 = datetime.fromtimestamp(timeStamp)a = dt2 - dtb = dt - dt2print(dt2 - dt)print(dt - dt2)
rabbitmq-python
https://gitee.com/bitterteaer/rabbit-mq-learn
Advanced Message Queuing Protocol全称:高级消息队列协议
四大核心
生产者
消费者
队列
交换机
AMQP
HAProxy:负载均衡略 … …