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
#!/usr/bin/env python | |
# | |
# A simple eventlet script that will run a django app | |
# | |
import eventlet | |
eventlet.monkey_patch() | |
from eventlet import wsgi | |
import django.core.handlers.wsgi | |
from optparse import OptionParser |
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
#!/usr/bin/env python | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 2.1 of the License, or (at your option) any later version. | |
# This library is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
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
#!/usr/bin/env python | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 2.1 of the License, or (at your option) any later version. | |
# This library is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
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
#!/usr/bin/env python | |
# The above line will cause this script to be run using the program 'python' | |
# Lines that start with a hash are comments for fun | |
# The interpreter wont read these. | |
def print_function(): | |
print ''' | |
******* * * | |
* * * |
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
# ---------------------------------------------------------------------------- # | |
# Standard setup stuff. In general you will want to alter the formatters | |
# | |
[formatters] | |
keys: detailed,simple | |
[handlers] | |
keys: console | |
[formatter_simple] |
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
#!/usr/bin/env/python | |
# | |
# More of a reference of using jinaj2 without actual template files. | |
# This is great for a simple output transformation to standard out. | |
# | |
# Of course you will need to "sudo pip install jinja2" first! | |
# | |
# I like to refer to the following to remember how to use jinja2 :) | |
# http://jinja.pocoo.org/docs/templates/ | |
# |
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
#!/usr/bin/env python | |
# Stupid gist by warren runk | |
import os | |
if __name__ == "__main__": | |
full_file_path = os.path.realpath(__file__) | |
print 'Full path to this current file is', full_file_path | |
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
const char stats_sock_usage_msg[] = | |
"Unknown command. Please enter one of the following commands only :\n" | |
" clear counters : clear max statistics counters (add 'all' for all counters)\n" | |
" help : this message\n" | |
" prompt : toggle interactive mode with prompt\n" | |
" quit : disconnect\n" | |
" show info : report information about the running process\n" | |
" show stat : report counters for each proxy and server\n" | |
" show errors : report last request and response errors for each proxy\n" | |
" show sess [id] : report the list of current sessions or dump this session\n" |
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
from optparse import OptionParser | |
import sys | |
def example_function(): | |
print "Hello world!" | |
if __name__ == "__main__": | |
parser = OptionParser() | |
parser.add_option( |
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
''' | |
Pass a time in seconds, and a base directory. | |
I will nuke anything older than now - seconds in that directory. Optionally | |
recursively | |
''' | |
from datetime import datetime | |
import os | |
from optparse import OptionParser |
OlderNewer