2023年1月14日
摘要: Docker Swarm集群管理 1. 创建Swarm集群 在已经安装好 Docker 的主机上执行如下命令: $ docker swarm init --advertise-addr 172.25.114.4 Swarm initialized: current node (dxn1zf6l61q 阅读全文
posted @ 2023-01-14 11:57 JentZhang 阅读(396) 评论(0) 推荐(1) 编辑
  2023年1月12日
摘要: docker swarm 部署ES集群 0. 环境准备 修改系统配置,在所有主机中,编辑 /etc/sysctl.conf,追加以下内容: vm.max_map_count=262144 保存后,执行sysctl -p 创建专用网络: docker network create --driver o 阅读全文
posted @ 2023-01-12 19:58 JentZhang 阅读(683) 评论(0) 推荐(0) 编辑
  2022年10月25日
摘要: Caddy File Server Docker部署 1. 切换到应用的文件夹下面 $ cd /alidata1/admin/app/caddy 2. 编辑docker-compose.yml version: "3.7" services: caddy: image: caddy:latest r 阅读全文
posted @ 2022-10-25 16:19 JentZhang 阅读(429) 评论(0) 推荐(0) 编辑
摘要: def nested_dict_2_dict(nested_dict): """ 嵌套字典转化为字典(闭包实现) 形如: 转化前:{"a": {"name": "张三", "friends": {"name": "lisi"}},"b": 20} 转化后:{'a.name': '张三', 'a.fr 阅读全文
posted @ 2022-10-25 10:10 JentZhang 阅读(166) 评论(0) 推荐(0) 编辑
  2022年10月10日
摘要: Python3实现i18n国际化 主要涉及Python基础类库gettext。详细步骤如下: 1. 编写公共方法的python文件(_i18n.py) #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time:2022/9/21 10:39 # @So 阅读全文
posted @ 2022-10-10 14:59 JentZhang 阅读(1126) 评论(0) 推荐(1) 编辑
  2022年8月3日
摘要: import pytz from apscheduler.schedulers.asyncio import AsyncIOScheduler # other schedulers are available from fastapi import FastAPI from fastapi_sqla 阅读全文
posted @ 2022-08-03 13:32 JentZhang 阅读(1331) 评论(0) 推荐(0) 编辑
  2022年3月25日
摘要: package main import ( "fmt" "io/ioutil" "log" "path" "github.com/jung-kurt/gofpdf" ) // Hello 测试 func Hello() { pdf := gofpdf.New("P", "mm", "A4", "") 阅读全文
posted @ 2022-03-25 11:02 JentZhang 阅读(625) 评论(0) 推荐(0) 编辑
  2022年3月2日
摘要: Python操作Redis实现排行榜功能实例 #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time:2022/3/2 15:41 # @Software:PyCharm __author__ = "JentZhang" import redis i 阅读全文
posted @ 2022-03-02 16:11 JentZhang 阅读(205) 评论(0) 推荐(0) 编辑
  2022年2月18日
摘要: 缓存装饰器 from django.core.cache import cache from hashlib import md5 import json def cache_response(view_func): """ 接口返回信息加入缓存机制 :param view_func: :retur 阅读全文
posted @ 2022-02-18 14:08 JentZhang 阅读(169) 评论(0) 推荐(0) 编辑
  2022年1月21日
摘要: 图片素材网 天堂网:https://www.ivsky.com/ 站长素材:https://sc.chinaz.com/ 路过图床:https://imgchr.com/ Hippopx:https://www.hippopx.com/zh Pexels:https://www.pexels.com 阅读全文
posted @ 2022-01-21 10:40 JentZhang 阅读(254) 评论(0) 推荐(0) 编辑