摘要: 1 import logging 2 LOG_LEVEL = logging.NOTSET 3 LOGFORMAT = "[%(log_color)s%(levelname)s] [%(log_color)s%(asctime)s] %(log_color)s%(filename)s [line:%(log_color)s%(lineno)d] : %(log_color)s%(messa... 阅读全文
posted @ 2016-12-21 18:22 小小白鼠 阅读(2085) 评论(0) 推荐(0) 编辑
摘要: def dedupe(items, key=None): seen = set() for item in items: val = item if key is None else key(item) if val not in seen: yield item seen.add(val) de... 阅读全文
posted @ 2016-12-21 10:40 小小白鼠 阅读(4209) 评论(0) 推荐(0) 编辑
摘要: # coding=utf-8 import smtplibfrom time import sleepfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipart def send_email(* 阅读全文
posted @ 2016-12-20 17:48 小小白鼠 阅读(273) 评论(0) 推荐(0) 编辑
摘要: db.users.find() select * from users db.users.find({"age" : 27}) select * from users where age = 27 db.users.find({"username" : "joe", "age" : 27}) sel 阅读全文
posted @ 2016-12-20 14:58 小小白鼠 阅读(136) 评论(0) 推荐(0) 编辑
摘要: # vsftp 安装yum install vsftpd -y # 配置用户名密码时需要yum install db* db4* -y# 启动vsftpdservice vsftpd start # 使用工具匿名连接,连接成功,即安装成功 # 修改配置文件 vim /etc/vsftpd/vsftp 阅读全文
posted @ 2016-12-20 14:40 小小白鼠 阅读(312) 评论(0) 推荐(0) 编辑
摘要: # Nginx 域名反向代理配置# 安装nginx yum install nginx -y# 修改配置文件 进入配置文件目录 cd /etc/nginx/conf.d 新建配置文件以.conf结尾 vim test.conf 输入一下内容: server { listen 80; server_n 阅读全文
posted @ 2016-12-20 14:39 小小白鼠 阅读(405) 评论(0) 推荐(0) 编辑
摘要: ################################# 测试函数运行内存# coding=utf-8# pip install memory_profiler# pip install psutil# 在pycharm包管理器里装from memory_profiler import p 阅读全文
posted @ 2016-12-20 14:35 小小白鼠 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-12-20 14:33 小小白鼠 阅读(1650) 评论(0) 推荐(1) 编辑
摘要: # -*- coding: UTF-8 -*- import ldap, ConfigParser, os from ldap import modlist LDAP_HOST = "mydomain.com" USER = "cn=admin,dc=mydomain,dc=com" PASSWORD = password BASE_DN = dc=mydomain,dc=comclass L... 阅读全文
posted @ 2016-12-20 14:22 小小白鼠 阅读(2522) 评论(0) 推荐(0) 编辑
摘要: #ldap 安裝配置 环境Centos7#安装 yum install -y openldap openldap-clients openldap-servers migrationtools pam_ldap python-ldap# 关闭防火墙 systemctl stop firewalld. 阅读全文
posted @ 2016-12-20 14:18 小小白鼠 阅读(3063) 评论(0) 推荐(0) 编辑