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 sys, os, time, atexit | |
| from signal import SIGTERM | |
| class Daemon: | |
| """ | |
| A generic daemon class. | |
| Usage: subclass the Daemon class and override the run() method |
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
| # coding: utf-8 | |
| import base64 | |
| import hashlib | |
| import random | |
| base64.b64encode(hashlib.sha256( str(random.getrandbits(256)) ).digest(), | |
| random.choice(['rA','aZ','gQ','hH','hG','aR','DD'])).rstrip('==') |
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
| var jsdom = require('jsdom'); | |
| var promise = require('bluebird'); | |
| var request = require("request"); | |
| function getURL(url) { | |
| return new Promise(function (resolve, reject) { | |
| var target = url; | |
| var jar = request.jar(); |