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
# | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
#!/bin/sh | |
set -e | |
HOST=localhost | |
DB=test-entd-products | |
COL=asimproducts | |
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/" | |
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz | |
S3LATEST=$S3PATH"latest".dump.gz | |
/usr/bin/aws s3 mb $S3PATH |
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 "container/ring" | |
// Use a goroutine to receive values from `out` and store them | |
// in an auto-expanding buffer, so that sending to `out` never blocks. | |
// Return a channel which serves as a sending proxy to to `out`. | |
func sendproxy(out chan<- int) chan<- int { | |
in := make(chan int, 100) | |
go func() { | |
n := 1000 // the allocated length of the circular queue | |
first := ring.New(n) |
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
phabricator_audit | |
phabricator_auth | |
phabricator_cache | |
phabricator_calendar | |
phabricator_chatlog | |
phabricator_conduit | |
phabricator_config | |
phabricator_conpherence | |
phabricator_countdown | |
phabricator_daemon |
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
/* | |
* Copyright (c) 2012 Calvin Rien | |
* | |
* Based on the JSON parser by Patrick van Bergen | |
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
* | |
* Simplified it so that it doesn't throw exceptions | |
* and can be used in Unity iPhone with maximum code stripping. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining |
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
#!/bin/sh - | |
"exec" "python" "-O" "$0" "$@" | |
__doc__ = """Tiny HTTP Proxy. | |
This module implements GET, HEAD, POST, PUT and DELETE methods | |
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT | |
method is also implemented experimentally, but has not been | |
tested yet. |
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
''' | |
Hey guys! | |
This is a the first python program(except hello worlds) I have written. | |
With HTTPServer, I can easily write a webserver. | |
Python is such a powerful language that many complicated problems can be | |
solved by a few lines of code. | |
Welcome to visit my blog: www.xiaoxia.org | |
The proxy program is just coded for fun <img src="http://xiaoxia.org/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley"> | |
''' |
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
# Alexander Sherwin | |
# 08/14/2005 v1.2 | |
# | |
# This class is designed to look for and parse miscellaneous <strong class="highlight">data</strong> | |
# that is not handled internally through <strong class="highlight">Python</strong> (i.e. <strong class="highlight">POST</strong>, GET.) | |
# | |
# Currently, upon instantiation of the class it automatically parses | |
# all <strong class="highlight">POST</strong>, GET and SERVER <strong class="highlight">data</strong> available to the script. | |
# | |
# Report any errors, bugs or contributions & additions |
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 asyncore, asynchat | |
import httplib | |
import socket | |
import sys | |
try: | |
from cStringIO import StringIO | |
except ImportError: | |
from StringIO import StringIO | |
from urlparse import urlsplit |