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
| # SendHub API Service | |
| description "Play-Framework 2.0.x SendHub API" | |
| start on (net-device-up | |
| and local-filesystems | |
| and runlevel [2345]) | |
| stop on runlevel [016] |
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 | |
| """ | |
| Convert camel-case to snake-case in python. | |
| e.g.: CamelCase -> snake_case | |
| Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064 | |
| """ |
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
| # SplunkStorm Forwarder | |
| description "SplunkStorm Forwarder" | |
| start on (net-device-up | |
| and local-filesystems | |
| and runlevel [2345]) | |
| stop on runlevel [016] |
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 bash | |
| ## | |
| # @author Jay Taylor [@jtaylor] | |
| # | |
| # @date 2012-10-30 | |
| # | |
| # @description Nagios NRPE plugin: Check the number of seconds since a file | |
| # or directory was last modified. | |
| # |
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
| """ | |
| @author Jay Taylor [@jtaylor] | |
| @date 2010-11-01 | |
| Copyright Jay Taylor 2010 | |
| """ | |
| #import socks | |
| import socket |
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 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Real-world use case: | |
| -------------------- | |
| class MyModel( | |
| MainModel, | |
| DynamicallyGenerateTransformedAttributes(str, '_str', 'id', 'user_id') |
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
| imp = lambda path: reduce(lambda module, next: getattr(module, next), path.split('.')[1:], __import__(path[0:path.index('.')])) |
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
| # PgBouncer Upstart script | |
| description "pgbouncer" | |
| start on (net-device-up | |
| and local-filesystems | |
| and runlevel [2345]) | |
| stop on runlevel [016] |
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 time | |
| from werkzeug.serving import BaseRequestHandler | |
| class MyFancyRequestHandler(BaseRequestHandler): | |
| """Extend werkzeug request handler to suit our needs.""" | |
| def handle(self): | |
| self.fancyStarted = time.time() | |
| rv = super(MyFancyRequestHandler, self).handle() | |
| return rv |
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 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Utility to enable generation of SELECT SQL which executes to INSERT SQL. | |
| NB: only tested for compatibility with Postgres. | |
| """ | |
| __author__ = 'Jay Taylor [@jtaylor]' |