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
var results = {}; | |
var requests = 0; | |
var urls = ["values/1", "values/2", "values/3"]; | |
$.each(urls, function(url) { | |
$.getJSON(url, function(data) { | |
results[url] = data.value; | |
++requests; |
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/env python | |
from smtpd import SMTPChannel, SMTPServer | |
import asyncore | |
class LMTPChannel(SMTPChannel): | |
# LMTP "LHLO" command is routed to the SMTP/ESMTP command | |
def smtp_LHLO(self, arg): | |
self.smtp_HELO(arg) |
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
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
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 | |
# how to unfollow everyone who isn't following you | |
# By Jamieson Becker (Public Domain/no copyright, do what you will) | |
# Easy instructions, even if you don't know Python | |
# | |
# 1. Install pip (apt-get install python-pip) and then | |
# pip install tweepy, which is the python twitter client | |
# |
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 | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
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 | |
# Bash shell script for generating self-signed certs. Run this in a folder, as it | |
# generates a few files. Large portions of this script were taken from the | |
# following artcile: | |
# | |
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html | |
# | |
# Additional alterations by: Brad Landers | |
# Date: 2012-01-27 |
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 cloudsearch import connect_cloudsearch, get_document_service | |
endpoint = 'paste your doc service endpoint here' | |
service = get_document_service(endpoint=endpoint) # Get a new instance of cloudsearch.DocumentServiceConnection | |
# Presumably get some users from your db of choice. | |
users = [ | |
{ | |
'id': 1, |
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 | |
set -e | |
# Build and install cloud-init on RHEL 6 AMIs | |
# (Please note: RHEL5 not supported because python 2.4 is too old for even boto) | |
# This will have undefined behavior on non-RHEL6 systems but should work on CentOS 6. | |
# Ubuntu and Amazon already have cloud-init. | |
# temporary build directory |
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
On the last machine in the chain: | |
nc -l 1234 | pigz -d | tar xvf - | |
On each intermediate machine, you use a fifo to copy the data to the next machine as well as decompressing. | |
mkfifo myfifo | |
nc $NEXT_SERVER 1234 <myfifo & | |
nc -l 1234 | tee myfifo | pigz -d | tar xvf - |
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
On the last machine in the chain: | |
nc -l 1234 | pigz -d | tar xvf - | |
On each intermediate machine, you use a fifo to copy the data to the next machine as well as decompressing. | |
mkfifo myfifo | |
nc $NEXT_SERVER 1234 <myfifo & | |
nc -l 1234 | tee myfifo | pigz -d | tar xvf - |
OlderNewer