shell
摘要: #查看电脑的版本 C:\Users\lys>pip -V pip 8.1.1 from e:\python\python3.5\lib\site-packages (python 3.5) #安装 C:\Users\lys>pip install virtualenv #创建 C:\Users\lys>virtualenv testvir #进入 C:\Users\lys>cd testvir ... 阅读全文
posted @ 2017-07-31 16:00 devops运维 阅读(348) 评论(0) 推荐(0)
摘要: #!/usr/bin/env python # _*_ coding:utf-8 _*_ # Author:Liuyoushui # Time = 2017/7/18 10:33 print ('\n'.join([' '.join(['%s*%s=%2s' % (y,x,x*y) for y in range(1,x+1)]) for x in range(1,10)])) print([... 阅读全文
posted @ 2017-07-18 15:07 devops运维 阅读(392) 评论(0) 推荐(0)
摘要: 我在salt上编写了备份日志的脚本,在/opt/CardServer下的主程序目录只保留当天的日志,/opt/log_del目录会保存7天的日志。salt * state.sls script.log_sevenday#添加计划任务salt * cron.set_job root '00' '4' 阅读全文
posted @ 2017-07-05 15:19 devops运维 阅读(251) 评论(0) 推荐(0)
摘要: vsftp日志xferlog格式分析 vsftp日志xferlog格式分析 1、开始vsftp记录日志。修改/etc/vsftpd/vsftpd.conf 如下: xferlog_enable=YES xferlog_std_format=YES xferlog_file=/var/log/xfer 阅读全文
posted @ 2017-06-05 16:57 devops运维 阅读(2566) 评论(0) 推荐(0)
摘要: nat internet iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth1 -j SNAT --to-source $LAN_GW_IP IPT=/sbin/iptables LAN_GW_IP=192.168.0.15 WAN_GW_IP=10.0.0.15 LAN_SERVER=192.168.0.1... 阅读全文
posted @ 2017-03-31 11:20 devops运维 阅读(993) 评论(0) 推荐(0)
摘要: [root@salt-master ~]# salt-master --version salt-master 2015.5.10 (Lithium) #master 的配置文件 [root@salt-master ~]# cat /etc/salt/roster web1: host: 192.168.50.101 user: root passwd: 1234... 阅读全文
posted @ 2017-03-30 13:50 devops运维 阅读(780) 评论(0) 推荐(0)
摘要: [root@xuegod63 ~]# vim /etc/vsftpd/vuserconfig/nonevip guest_enable=yes guest_username=ftpuser anon_world_readable_only=no anon_max_rate=50000 解释: gue 阅读全文
posted @ 2017-03-27 17:36 devops运维 阅读(199) 评论(0) 推荐(0)
摘要: #生成证书和key openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout /opt/nginx/pdk.key -out /opt/nginx/pdk.crt #修改配置文件 nginx.conf server { listen 443; ssl on; server_na... 阅读全文
posted @ 2017-03-23 15:59 devops运维 阅读(366) 评论(0) 推荐(0)
摘要: [root@centos-6 ~]# cat info_file.txt lys:28:shanxi zhy:28:shanxi [root@centos-6 ~]# cat info_file2.txt lys 28 shanxi zhy 28 shanxi [root@centos-6 ~]# cat print.sh #!/bin/bash for i in `cat info_fi... 阅读全文
posted @ 2017-03-21 17:43 devops运维 阅读(409) 评论(0) 推荐(0)
摘要: 在linux系统中,last与lastb命令用来列出目前与过去登录系统的用户相关信息。指令英文原义: last, lastb - show listing of last logged in users 单独执行last指令时,它会读取位于/var/log/wtmp的文件,并把该给文件的内容记录的登 阅读全文
posted @ 2017-03-21 16:04 devops运维 阅读(5561) 评论(0) 推荐(0)
python