Cron在Centos上的安装方法

Centos最小化安装时候貌似crond是不带的,需要自己手动安装。但是Centos不同的版本安装命令不一样,在此记录一下! ...

March 17, 2017 · 1 min · Me

获取所有用户的计划任务

一句话代码 cut -d: -f1 /etc/passwd|xargs -i sudo crontab -u {} -l

March 18, 2016 · 1 min · Me

模拟登录联通10010.com查询宽带余额

家里的宽带是包年按天扣费,时间长了就忘了改什么时候续费了。 抽时间写了个模拟登录10010.com的脚本,自动查询余额。 每天中午12点查一次,省得下次又欠费了。 模拟登录的过程很简单,获取查询的cookie需要两步请求,拿到cookie后可以随意查询。 有TX想看源码么? 已贴源码 #!/usr/bin/env python # encoding: utf-8 """ @version: 0.2 @author: phpergao @license: Apache Licence @contact: endoffight@gmail.com @site: http://www.phpgao.com @software: PyCharm @file: 10010.py @time: 15-1-3 下午6:06 一键查询联通宽带余额 """ import urllib2 import cookielib import json class Crawl(): def __init__(self, username, passwd, debug=False): (self.username, self.passwd) = (username, passwd) self.cookie = cookielib.CookieJar() cookieHandler = urllib2.HTTPCookieProcessor(self.cookie) self.is_debug = debug if self.is_debug: httpHandler = urllib2.HTTPHandler(debuglevel=1) httpsHandler = urllib2.HTTPSHandler(debuglevel=1) opener = urllib2.build_opener(cookieHandler, httpHandler, httpsHandler) else: opener = urllib2....

January 6, 2015 · 2 min · Me