上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 队列--存放对象的容器 #coding:utf-8 import queue import time q = queue.Queue() for i in range(10): q.put(i) while not q.empty(): print('从队列中取出的元素: %s' % q.get() 阅读全文
posted @ 2018-09-22 21:34 厚德载物_VIP 阅读(179) 评论(0) 推荐(0)
摘要: 1、闭包--返回子函数名 作用:使用子函数之外的父函数的变量 闭包就是你调用了一个函数a,这个函数a反悔了一个子函数名b,这个返回的函数b就叫做闭包 代码举例 def a(): test = 'aa' def b(): print(test) return 1 return b c = a() pr 阅读全文
posted @ 2018-09-22 11:10 厚德载物_VIP 阅读(229) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2018-09-09 08:12 厚德载物_VIP 阅读(5) 评论(0) 推荐(0)
摘要: Codis 是一个分布式 Redis 解决方案, 对于上层的应用来说, 连接到 Codis Proxy 和连接原生的 Redis Server 没有显著区别 (不支持的命令列表), 上层应用可以像使用单机的 Redis 一样使用, Codis 底层会处理请求的转发, 不停机的数据迁移等工作, 所有后 阅读全文
posted @ 2018-08-31 16:23 厚德载物_VIP 阅读(332) 评论(0) 推荐(0)
摘要: playbook 剧本如下 192.168.11.172 ansible_user=opsadmin ansible_sudo_pass="x" ansible_ssh_port=12600192.168.11.173 ansible_user=opsadmin ansible_sudo_pass= 阅读全文
posted @ 2018-08-27 14:43 厚德载物_VIP 阅读(1258) 评论(0) 推荐(0)
摘要: 执行效果 阅读全文
posted @ 2018-08-22 09:40 厚德载物_VIP 阅读(2406) 评论(0) 推荐(0)
摘要: 1、环境如下 ansible 主控端 192.168.33.239 被控端 192.168.11.148 192.168.11.149 1.使用 ssh-keygen -t rsa生成密钥对 (后面用opsadmin用户来操作) 2.推送单个公钥到远程机器 格式: ssh-copy-id -i ~/ 阅读全文
posted @ 2018-08-15 15:55 厚德载物_VIP 阅读(270) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2018-08-06 17:31 厚德载物_VIP 阅读(2) 评论(0) 推荐(0)
摘要: 使用系统自带的logrorate来切个nginx日志,位于/usr/sbin/logrotate 需要注意的是你们的nginx.pid位置,不一定是在/home/nginx/logs/nginx.pid 执行该命令测试 logrotate -vf /etc/logrotate.d/nginx 查看生 阅读全文
posted @ 2018-08-06 16:38 厚德载物_VIP 阅读(1498) 评论(0) 推荐(0)
摘要: [root@mail CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 36560You are about to be asked to enter information that will be i 阅读全文
posted @ 2018-07-10 23:40 厚德载物_VIP 阅读(613) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 8 下一页