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 | |
if [[ $# != 1 && $# != 2 ]] | |
then | |
echo "$0 <path to git repository> [tree-ish]" | |
exit 1 | |
fi | |
msg() { | |
echo -e -n "\e[32;1m==>\e[0m " |
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
def date_range(start, end): | |
"""返回2个日期间的数据序列 | |
# test | |
start = datetime.date(2007,01,01) | |
end = datetime.date(2008,02,01) | |
dateList = date_range(start, end) | |
print '\n'.join([str(date) for date in dateList]) | |
""" |
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
#del dir being changed 10 days ago in depth 2 | |
find . -maxdepth 2 -mindepth 2 -type d -mtime +10 -exec rm -rf {} \; |
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
how to ssh in python | |
using following tools: | |
https://github.com/dlitz/pycrypto.git | |
https://github.com/paramiko/paramiko.git | |
download and install | |
install pycrypto: problem 1, GMP or MPIR library not found | |