This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
## Monit control file | |
############################################################################### | |
## | |
## Comments begin with a '#' and extend through the end of the line. Keywords | |
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | |
## | |
## Below you will find examples of some frequently used statements. For | |
## information about the control file, a complete list of statements and | |
## options please have a look in the monit manual. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.poi.ss.usermodel.* | |
import org.apache.poi.hssf.usermodel.* | |
import org.apache.poi.xssf.usermodel.* | |
import org.apache.poi.ss.util.* | |
import org.apache.poi.ss.usermodel.* | |
import java.io.* | |
class GroovyExcelParser { | |
//http://poi.apache.org/spreadsheet/quick-guide.html#Iterator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
import sys | |
import email.mime.text | |
mail_username='[email protected]' | |
mail_password='password' | |
from_addr = mail_username | |
to_addrs=('[email protected]') | |
HOST = 'smtp.gmail.com' | |
PORT = 25 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import simplejson as json | |
>>> obj = [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] | |
>>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj | |
True | |
>>> json.loads('"\\"foo\\bar"') == u'"foo\x08ar' | |
True | |
>>> from StringIO import StringIO | |
>>> io = StringIO('["streaming API"]') | |
>>> json.load(io)[0] == 'streaming API' | |
True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import simplejson as json | |
>>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) | |
'["foo", {"bar": ["baz", null, 1.0, 2]}]' | |
>>> print json.dumps("\"foo\bar") | |
"\"foo\bar" | |
>>> print json.dumps(u'\u1234') | |
"\u1234" | |
>>> print json.dumps('\\') | |
"\\" | |
>>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import required modules | |
import feedparser, MySQLdb | |
# set up connection to MySQL database | |
db = MySQLdb.connect(host='host',user='user',passwd='pass',db='dbname') | |
cursor=db.cursor() | |
# fetch feed and turn into feedparser object | |
d = feedparser.parse('http://65s.org/feed/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL ^ E_NOTICE); | |
//FUNCTION: Connect to PostgreSql database | |
//create a connection to postgresql database | |
set_time_limit(0); | |
ini_set("memory_limit", "200M"); | |
pg_connect("host=localhost dbname=comds user=root password=root") | |
or die('Could not connect:'.pg_last_error()); | |
$handle = fopen("http://192.168.0.10/log/demo/log.txt", "r"); | |
while (!feof($handle)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git xxx -h | |
##显示git xxx命令可以跟哪些参数,比如git add -h | |
git --version | |
##显示git版本号 | |
git init | |
##初始化GIT版本库 | |
git init --bare /path/to/repos/xxx.git | |
##初始化GIT裸版本库 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -u | |
import os | |
import re | |
import sys | |
import time | |
import statvfs | |
import subprocess | |
import MySQLdb | |
# globa re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `comds` ( | |
`id` int(11) NOT NULL COMMENT 'lookup', | |
`TotalExp` varchar(8) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT 'TotalExp', | |
`FirstLoginTime` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT 'FirstLoginTime', | |
`FirstLogin` date DEFAULT NULL COMMENT 'lookup', | |
`TotalDollorGet` varchar(8) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT 'TotalDollorGet', | |
`TodayGameTime` varchar(8) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT 'TodayGameTime', | |
`TodayTCrystalLose` varchar(8) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT 'TodayTCrystalLose', | |
`Crystal` varchar(8) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT 'Crystal', | |
`TodayGoldGet` varchar(8) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT 'TodayGoldGet', |