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
from threading import _Timer | |
class Timer(_Timer): | |
def __init__(self, interval, handler, repeats=0, args=[], kwargs={}): | |
_Timer.__init__(self, interval, self.__invoke, args, kwargs) | |
self.handler = handler | |
self.repeats = repeats |
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: FastCGI servers for Django | |
# Required-Start: networking | |
# Required-Stop: networking | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: S 0 1 6 | |
# Short-Description: Start FastCGI servers with Django. | |
# Description: Django, in order to operate with FastCGI, must be started | |
# in a very specific way with manage.py. This must be done |
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 | |
def quicksort1(q): | |
""" | |
The basic version. | |
http://zh.wikipedia.org/wiki/%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F#.E6.BC.94.E7.AE.97.E6.B3.95 | |
""" | |
less = [] | |
pivotList = [] | |
greater = [] |
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 bash | |
# Update all vcs dirs in a specific path. | |
# Support git, hg and svn. | |
basePath=`pwd` | |
function vcsup() | |
{ | |
echo "checing $1" |
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 os, sys, subprocess, httplib | |
from cStringIO import StringIO | |
from django.http import HttpResponse | |
def gitweb(request): | |
cigenv = { | |
'REQUEST_METHOD': request.method, | |
'QUERY_STRING': request.META['QUERY_STRING'], | |
} | |
os.environ.update(cigenv) |
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
<p>这个手册是我转载的,准备用markdown整理下格式,感觉原来的html太乱了。</p> | |
<p>TOC是通过python的markdown生成的,<a href="http://www.freewisdom.org/projects/python-markdown/">http://www.freewisdom.org/projects/python-markdown/</a></p> | |
<pre><code>markdown awk.md > awk.html -x toc | |
</code></pre> | |
<p>以下全部内容是从 <a href="http://linuxfire.com.cn/~lily/awk.html">http://linuxfire.com.cn/~lily/awk.html</a> 转载的。</p> | |
<div id="awktoc"> | |
<div class="toc"> | |
<ul> | |
<li><a href="#awk">awk 手册</a><ul> |
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
-- http://blog.itmem.com/?p=1062 | |
-- @author xueyu | |
-- @desc modify the prefix of table name in db | |
-- @example | |
-- | |
-- use DBNAME; | |
-- show tables; | |
-- source ~/change_prefix.sql; | |
-- | |
-- call change_prefix('old_', 'new_', 'DBNAME'); |
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
# Create a new user. | |
adduser username | |
# Add a existing user to existing group. | |
# Add existing user tony to ftp supplementary/secondary group with usermod command using -a | |
# option ~ i.e. add the user to the supplemental group(s). Use only with -G option : | |
usermod -a -G ftp tony | |
# Create a new group. |
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
unmap <M-d> | |
unmap <C-f> | |
set disablesites=mail.google.com, reader.google.com, localhost, 127.0.0.1 | |
" vim: set ft=vim: |
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 bash | |
CURRENT_PATH=`pwd` | |
outdir="$CURRENT_PATH/out" | |
if [[ ! -d $outdir ]]; then | |
mkdir $outdir | |
fi | |
cd "$CURRENT_PATH/origin" | |
VIDEOS=`find . -name "*"` |
OlderNewer