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/bash | |
find "$4" -depth -name "$3" -exec grep -Hni "$2" {} \; |
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/bash | |
# | |
# File: check_status.sh | |
# Author: Kinch Zhang <kinch.zhang@gmail.com> with help from ChaoQian Xu <chaoranxu@gmail.com> | |
# Usage: $ check_status.sh [HOSTS ...] | |
# | |
function check() | |
{ | |
ip=`ping $1 | head -n 1| awk '{print $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
#! /bin/bash | |
# recursively searching current directory for "foo" in PHP files and replace it with "bar" | |
for i in `find . -depth -name "*.php" -exec grep -Hni "foo" | awk -F: '{print $1}'`; do | |
if [ -f "$i" ]; then | |
sed -i ".old" -e "s/foo/bar/g' "$i" | |
fi | |
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 | |
""" | |
uncompress packages from ~/software/ directory | |
""" | |
import os, sys | |
p = os.path | |
cwd = os.getcwd() |
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/bash | |
# git init configs for Kinch Zhang | |
# username and email address | |
git config --global user.name "Kinch Zhang" | |
git config --global user.email kinch.zhang@gmail.com | |
# SVN-like shortcuts | |
git config --global alias.st status |
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/bash | |
# compile python from source with debug support | |
./configure --prefix=/dev/null --with-pydebug | |
make -s -j2 |
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
" clever tab completion | |
function! CleverTab() | |
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' | |
return "\<Tab>" | |
else | |
return "\<C-N>" | |
endfunction | |
inoremap <Tab> <C-R>=CleverTab()<CR> |
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 | |
# vim: set fileencoding=utf-8 | |
""" | |
download softwares | |
""" | |
import os, sys | |
p = os.path |
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/bash | |
sudo aptitude install -y \ | |
subversion \ | |
git-core \ | |
vim-full \ | |
ctags \ | |
stardict \ | |
glade \ | |
xclip \ | |
make \ |
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/bash | |
# install nginx + php5(with apc & memcache extensions) + mysql | |
# install php5 first | |
echo "* installing PHP 5 with extension APC, Xdebug and Memcache..." | |
sudo aptitude install -y \ | |
php5-cli \ | |
php5-cgi \ | |
php-apc \ |
OlderNewer