This file contains 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
# password file that stores user name and password | |
sessionid 192.168.1.15 user123 pass123 |
This file contains 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/local/php/bin/php | |
<?php | |
function get_longest_common_substring($string_1, $string_2) { | |
$string_1_length = strlen($string_1); | |
$string_2_length = strlen($string_2); | |
$return = ""; | |
if ($string_1_length === 0 || $string_2_length === 0) { | |
// No similarities |
This file contains 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/local/php/bin/php | |
<?php | |
function cstrrev($str) | |
{ | |
$len = strlen($str); | |
for($i = 0; $i < $len; $i++) | |
{ | |
$char = $str{0}; | |
if(ord($char) > 127) |
This file contains 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/local/bin/python | |
import sys | |
import random | |
def GetRand(src, N, dest): | |
query_list = [] | |
# load src query | |
fp = open(src, "r") |
This file contains 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
#coding=gbk | |
import time | |
import MySQLdb | |
import sys | |
class DbHandle: | |
def __init__(self, host_name, usr_name, usr_password, data_base, charset = 'gbk'): | |
self.m_host_name = host_name | |
self.m_usr_name = usr_name | |
self.m_usr_password = usr_password |
This file contains 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/perl | |
use Net::SMTP; | |
use Authen::SASL; | |
if(@ARGV < 2){ | |
die "usage: SendMail.pl <MailTo> <MimeFile>"; | |
} | |
my($MailTo, $MimeFile) = @ARGV; | |
my $smtp = Net::SMTP->new('111.222.3.123'); |
This file contains 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 sys | |
# Use the property: | |
# Almost every Chinese character is 3 bytes in UTF-8 | |
""" | |
# bytes length check | |
for line in open(sys.argv[1], "r"): | |
parts = line.rstrip('\r\n').split('\t') | |
if len(parts[0].strip()) <= 3: |
This file contains 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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,38,00,38,e0,00,00,00,00 |
This file contains 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
/////////////////////////////////////////////////////////////// | |
// Filename : MyList.h | |
// Author : Zhang Xiang | |
// Date : 2010-8-18 | |
// Comment : A two-direction list class and it implemented part of the | |
// functions as the list container of STL come with Visual | |
// studio. | |
// | |
// Iterator class name is MyListIterator, and the value is a | |
// four-byte integer, which may need a type cast in the pointer |
This file contains 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
# coding: utf-8 | |
import sys, logging, logging.handlers, time, multiprocessing | |
def setLogger(name): | |
logger = logging.getLogger(name) | |
logger.setLevel(logging.INFO) | |
handler = logging.handlers.WatchedFileHandler('info.log') | |
formatter = logging.Formatter('%(asctime)s\t%(message)s') | |
handler.setFormatter(formatter) |
OlderNewer