Python-时间转换

掌握几种对象及其关系 了解每类对象的基本操作方法 通过转化关系转化 time对象 datetime >>> import datetime >>> now = datetime.datetime.now() >>> now datetime.datetime(2015, 1, 12, 23, 9, 12, 946118) >>> type(now) <type 'datetime.datetime'> timestamp >>> import time >>> time.time() 1421075455.568243 time……

阅读全文

Jumpserver-安装文档

最新版本是docker安装,建议centos7+ 数据库安装 略…… 安装redis cd /usr/local/src && wget https://download.redis.io/releases/redis-6.2.2.tar.gz tar xzf redis-6.2.2.tar.gz && cd redis-6.2.2 make &&……

阅读全文

RabbitMQ-持久化

exchange持久化 broker服务重启之后,exchange任然保留,否则没有broker存在的时候会消失 channel.exchange_declare(exchange='ticket', exchange_type='direct', durable=True) queue持久化……

阅读全文

RabbitMQ-安装文档

测试环境:Centos6.x 安装 # 安装erlang(注意查看支持的系统版本) # https://github.com/rabbitmq/erlang-rpm/releases # 注意不要选错版本了,el6是centos6,el7……

阅读全文

Pureftpd-安装文档(基于puredb认证)

下载 wget -c --no-check-certificate https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.42.tar.gz 编译安装 # 依赖包 yum -y install openssl-devel.x86_64 useradd -M -s /bin/false ftp tar xzf pure-ftpd-1.0.42.tar.gz && cd pure-ftpd-1.0.42 ./configure --prefix=/usr/local/pureftpd --with-puredb --with-altlog --without-shadow --with-quotas \ --with-cookie --with-virtualchroot --with-language=english --with-rfc2640 --with-peruserlimits --with-tls make install-strip 生成配置文件 # 配置文件 install -o root -g root -m 500 -d /usr/local/pureftpd/etc install -o……

阅读全文

Python-多线程注意事项

锁申请位置错误导致内存泄露-多线程内存泄露注意事项 # encoding: UTF-8 import threading import time def show_fun(sem, n): # 不能放在这里 # sem_lock.acquire() print("{0}start -- {1}".format(time.ctime(), n)) print "working" time.sleep(2) print("{0}end -- {1}".format(time.ctime(), n)) sem.release() if __name__ == '__main__': max_connections = 5 semaphore = threading.BoundedSemaphore(max_connections)……

阅读全文