轮询检测Apache状态并启用钉钉报警 打印彩虹 打印菱形 expect实现远程登陆自动交互 http心跳检测 PV过量自动实现防火墙封IP shell实现自动安装 shell实现插入排序 bash实现动态进度条 根据文件内容创建账号 红色进度条 监控服务器网卡流量 检测CPU剩余百分比 检测磁盘剩 ...
分类:
系统相关 时间:
2018-05-31 21:07:53
阅读次数:
296
Subprocess模块 The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This m ...
分类:
编程语言 时间:
2018-05-29 00:31:21
阅读次数:
266
# Author: yeshengbao # -- coding: utf-8 -- # @Time : 2018/5/24 21:38 import datetime import requests import os import hashlib from multiprocessing imp... ...
分类:
编程语言 时间:
2018-05-25 00:25:32
阅读次数:
240
subprocess模块是python从2.4版本开始引入的模块。主要用来取代 一些旧的模块方法,如os.system、os.spawn*、os.popen*、commands.*等。subprocess通过子进程来执行外部指令,并通过input/output/error管道,获取子进程的执行的返回 ...
分类:
编程语言 时间:
2018-05-25 00:19:02
阅读次数:
295
expect分发yuminstall-yexpect1.自动远程登录#!/usr/bin/expectsethost"192.168.133.132"//定义变量hostsetpasswd"123456"spawnsshroot@$host//spawn后面跟系统shell命令,远程登录expect{"yes/no"{send"yes\r";exp_continue}//初次登录机器会提示yes/
分类:
其他好文 时间:
2018-05-16 22:45:12
阅读次数:
174
socketserver = 多进程 + 多线程 + IO模型 一、上节课复习及作业讲解 a、spawn用法复习 from gevent import monkey,spawn;monkey.patch_all() import time def f1(): print('from f1 1') t ...
分类:
编程语言 时间:
2018-05-02 22:15:44
阅读次数:
249
一、异步+回调机制 a、问题引入 问题: 1)任务的返回值不能得到及时的处理,必须等到所有任务都运行完毕才能统一进行处理 2)解析的过程是串行执行的,如果解析一次需要花费2s,解析9次则需要花费18s from concurrent.futures import ProcessPoolExecuto ...
分类:
编程语言 时间:
2018-04-29 15:21:49
阅读次数:
167
一、expect脚本同步文件 1、编辑同步脚本4.expect #! /usr/bin/expectset passwd "root1234"spawn rsync -av root@192.168.134.131:/tmp/hk.txt /tmp #将131 上hk.txt 考到 本地tmp下ex ...
分类:
系统相关 时间:
2018-04-27 02:45:16
阅读次数:
216
十八周二次课(4月26日)20.31 expect脚本同步文件20.32 expect脚本指定host和要同步的文件20.33 构建文件分发系统20.34 批量远程执行命令20.31 expect脚本同步文件自动同步文件 编辑脚本文件:vi 4.expect#!/usr/bin/expectset passwd "123456"spawn rsync -av root@192.
分类:
其他好文 时间:
2018-04-26 17:00:32
阅读次数:
205
需要的安装包: 步骤 出现以上结果,安装成功。可在sample-output中查看结果 遇到的坑!! 1.运行runRouge-test.pl时报错“can t spawn cmd.exe......”,解决方法,查看环境变量,我当时的环境变量缺少%SystemRoot%\System32,加进去即 ...