This file contains hidden or 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://qiita.com/gumob@github/items/09330100c2a32e41715e |
This file contains hidden or 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
Tools | |
Degrees | |
Evernote | |
Sublime2 | |
KeepassX | |
Dropbox |
This file contains hidden or 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 | |
import base64, getpass, hashlib, os | |
salt = os.urandom(8) | |
print '{SSHA}' + base64.b64encode(hashlib.sha1(getpass.getpass() + salt).digest() + salt) |
This file contains hidden or 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 fnmatch | |
import os | |
src = '<Path>' | |
pattern = '*.py' | |
matches = [] | |
for root, dirnames, filenames in os.walk(src): | |
for filename in fnmatch.filter(filenames, pattern): | |
matches.append(os.path.join(root, filename)) |
This file contains hidden or 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
/* | |
* Original version by Stephen Toub and Shawn Farkas. | |
* Random pool and thread safety added by Markus Olsson (freakcode.com). | |
* | |
* Original source: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx | |
* | |
* Some benchmarks (2009-03-18): | |
* | |
* Results produced by calling Next() 1 000 000 times on my machine (dual core 3Ghz) | |
* |