Skip to content

Instantly share code, notes, and snippets.

View vitamin's full-sized avatar

David Wang vitamin

  • Beijing
View GitHub Profile
@vitamin
vitamin / python-ssh.txt
Last active December 18, 2015 23:59
install
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
#del dir being changed 10 days ago in depth 2
find . -maxdepth 2 -mindepth 2 -type d -mtime +10 -exec rm -rf {} \;
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])
"""
@vitamin
vitamin / sync.sh
Created March 22, 2013 02:31 — forked from leemars/sync.sh
#!/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 "