上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 59 下一页

2020年7月28日

Supervisor进程组的使用

摘要: 说明 因为后端服务一般我们会多开几个服务进程进行API接口的提供,在使用Supervisor进行进程管理的时候,会经常需要对相关进程进行管理。 所以我们可以把同一个相同的所属的进程组进行归类: 创建对应的需要包含的进程配置文件: [include] files = /etc/supervisor/c 阅读全文

posted @ 2020-07-28 18:23 星河赵 阅读(1696) 评论(0) 推荐(0)

2020年7月22日

Python 多线程、多进程、协成的使用

摘要: 写在前面将列表分割供多进程、多线程使用 def list_fund(listTemp, n): """ 将列表平均分成N块 :param listTemp: :param n: :return: """ resules = [] for i in range(0, len(listTemp), n) 阅读全文

posted @ 2020-07-22 13:49 星河赵 阅读(348) 评论(0) 推荐(0)

2020年7月1日

mongo 常用查询方法 pymongo mongoengine

摘要: 1.mongoengine 查询返回指定列(指定字段) scalar from models import UserDayStat, UserDetails userdaystat = UserDayStat.objects(date="2020-06-30", day_age=0).scalar( 阅读全文

posted @ 2020-07-01 16:58 星河赵 阅读(1436) 评论(0) 推荐(0)

2020年6月4日

ssh-pass 使用无需输入密码

摘要: 在Linux后台中,经常会用到ssh、scp等命令。需要进行认证,手动输入密码,是交互式的过程。当将ssh、scp等命令做成自动化脚本时,可能需要非交互式的登录过程,此时可以用sshpass。 安装方式 1.在基于 RedHat/CentOS 的系统中,首先需要启用 EPEL 仓库并使用 yum 命 阅读全文

posted @ 2020-06-04 18:06 星河赵 阅读(1061) 评论(0) 推荐(0)

curl 发送post请求

摘要: 1. curl 发送post请求 curl http://127.0.2.1:5353/user/get_macro_data -X POST -d '{"num": "7"}' --header "Content-Type: application/json" 2.curl 发送post请求 js 阅读全文

posted @ 2020-06-04 14:04 星河赵 阅读(2694) 评论(0) 推荐(0)

2020年5月18日

python实现socketserver处理多连接 相关逻辑

摘要: 1.收发字符串处理 # 接收字符处理 b转str # json_str = str(self.data, encoding="utf8") json_str = self.data.decode("utf-8") # 发送字符处理 str转b data.encode() 阅读全文

posted @ 2020-05-18 15:01 星河赵 阅读(485) 评论(0) 推荐(0)

2020年4月30日

使用supervisor 进行进程管理时调整最大文件打开数

摘要: [supervisord] logfile=/tmp/supervisord.log ; 日志文件,默认是 $CWD/supervisord.log logfile_maxbytes=50MB ; 日志文件大小,超出会 rotate,默认 50MB logfile_backups=10 ; 日志文件 阅读全文

posted @ 2020-04-30 11:30 星河赵 阅读(894) 评论(0) 推荐(0)

2020年4月27日

python str与bytes之间的转换

摘要: # bytes object b = b"example" # str object s = "example" # str to bytes bytes(s, encoding = "utf8") # bytes to str str(b, encoding = "utf-8") # an alt 阅读全文

posted @ 2020-04-27 19:01 星河赵 阅读(1593) 评论(0) 推荐(0)

2020年4月26日

vue 中区分测试环境和正式环境

摘要: 其实很简单,只要改动四个地方就行,不管你用的是vueResource或者anxios都可以 1.在/config/dev.env.js 和/config/prod.env.js中分别这样修改 /config/dev.env.js 'use strict' const merge = require( 阅读全文

posted @ 2020-04-26 15:42 星河赵 阅读(5240) 评论(0) 推荐(0)

Linux Centos 使用yum安装MongoDB 4.0

摘要: 1.配置MongoDB的yum源 创建yum源文件: #cd /etc/yum.repos.d #vim mongodb-org-4.0.repo 添加以下内容:(我们这里使用阿里云的源) [mngodb-org] name=MongoDB Repository baseurl=http://mir 阅读全文

posted @ 2020-04-26 11:24 星河赵 阅读(4047) 评论(0) 推荐(0)

上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 59 下一页

导航