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
def my_thread_func(comment_id): | |
# form url based on comment id so http://www.evite.com/services/<comment_id>/whatever | |
# send request | |
# check result, log error | |
from multiprocessing.pool import ThreadPool as Pool | |
def main(): | |
# Read file into a list of IDs | |
list_of_ids = [read from file] |
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 script is free software written by Warren Runk (warren.runk@gmail.com) | |
""" | |
This is a (hopefully) simple example of how to download your appengine logs to a normal | |
linux (non google or appengine) computer using remote api and logservice. | |
You can use appcfg.py to "request_logs" but that is not practical for real workloads | |
From here you can download smaller time slices of logs as necessary depending on your scale. |
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 | |
# Written by Warren Runk | |
# This file is free software in the public domain. | |
import base64 | |
import uuid | |
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 | |
# Written by Warren Runk | |
# This file is free software in the public domain. | |
import base64 | |
import random | |
import uuid |
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
#!/bin/bash | |
# --------------------------------------------------------------------------- # | |
# These are git settings from: | |
# http://neverstopbuilding.net/gitpro/ | |
# --------------------------------------------------------------------------- # | |
#source ~/.git-completion.bash | |
#source ~/.git-prompt.sh | |
# | |
# Settings for python virtual envs and the python virtualenvwrapper |
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
#!/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
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