Skip to content

Instantly share code, notes, and snippets.

View alexliang1975's full-sized avatar

alexliang1975

View GitHub Profile
@alexliang1975
alexliang1975 / findWithoutGrep.sh
Created September 3, 2012 17:54
Find file which include string without grep
find . -type f -exec awk 'BEGIN{n=0} {if($0~/'"$1"'/){a[n++]=FNR" "$0}}END{if(n>0){print(FILENAME); for(i=0;i<n;++i) print a[i] }}' {} \;
@alexliang1975
alexliang1975 / download.py
Created September 11, 2012 16:34
download source code which powered by Trac's Browse source
#!/usr/env python
import urllib2
from HTMLParser import HTMLParser
import os
def downloadFile(url, filename):
u = urllib2.urlopen(url+'?format=txt')
localFile = open(filename, 'w')