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
################################################################################ | |
## Kontrollkit | |
## NAME: mt-my.cnf_2GB | |
## DATE: 2008-10-01 | |
## AUTHOR: Matt Reid | |
## WEBSITE: http://kontrollsoft.com | |
## EMAIL: themattreid@gmail.com | |
## LICENSE: BSD http://www.opensource.org/licenses/bsd-license.php | |
################################################################################ | |
# WHAT THIS IS |
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
#!/bin/sh | |
OOO_HOME=/Applications/OpenOffice.org.app/Contents | |
OOO_HOST= | |
OOO_PORT="2002 2003 2004 2005" | |
USER_HOME=/tmp | |
_create_home() { | |
port=$1 | |
home=${USER_HOME}/user/port${port} | |
mkdir -p ${home} |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: oooserver | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: S 0 1 6 | |
# Short-Description: Initscript to start OOo as server | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
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
class PinId(object): | |
SHARD_LEN = 46 | |
OBJECT_LEN = 10 | |
@classmethod | |
def uuid(clz, shard_id, object_type, local_id): | |
sid = shard_id << clz.SHARD_LEN | object_type << clz.OBJECT_LEN | local_id | |
return sid | |
@classmethod |
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
https://klaver.it/linux/sysctl.conf | |
# Kernel sysctl configuration file for Linux | |
# | |
# Version 1.9 - 2011-03-23 | |
# Michiel Klaver - IT Professional | |
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant | |
# | |
# This file should be saved as /etc/sysctl.conf and can be activated using the command: | |
# sysctl -e -p /etc/sysctl.conf |
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
tar cf – files | ssh user@192.168.1.18 “tar -C /home/jiaojy -xf -” | |
files为文件,或者目录 | |
-C 后面指定要拷贝的地址, | |
user为192.168.1.18上的用户 |
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/env python | |
# -*- coding: utf-8 -*- | |
import re | |
keeps = ('em', 'i', 'b', 'strong', 'p', 'br', 'img', 'u') | |
CLEANBODY_RE = re.compile(r'<(/?)(.+?)>', re.M) | |
IMG_SRC = re.compile(r'(src="(.*?)")', re.M) | |
WORD_RE = re.compile(r'(([\s</]*?)(\w+)([\s>]*?))', re.M) |
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
awk 'BEGIN{SUM=0}{if($9="200"){SUM+=$10}}END{print SUM}' 1123.log | |
awk 'BEGIN{SUM=0}{if($7 ~ /\.3gp/){SUM+=$10}}END{print SUM}' 1123.log |
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 | |
import time | |
import multiprocessing | |
from merge_sort import * | |
from sort_helpers import * | |
def split(arr, n): | |
part_len = len(arr) / n | |
if part_len == 0: |
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
function splitBigFile() | |
{ | |
tail -n 1000000000 $1 | awk '{ | |
subNum=substr($1,length($1)-1) | |
print subNum,$0 | |
}' | while read subNum others | |
do | |
echo $others >> $2.$subNum | |
done | |
} |
OlderNewer