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 perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use RedisDB; | |
use Config::General; | |
use Array::Diff; | |
use Text::Diff; | |
my $redis_conf = shift or die 'usage:redis-conf-diff.pl <redis_config_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
var access_key = ''; | |
var secret_key = ''; | |
var region = 'ap-northeast-1'; | |
var dynode = require('dynode'); | |
dynode.auth({ | |
accessKeyId: access_key | |
,secretAccessKey: secret_key | |
,region: region | |
}); |
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
yoga render --template='[% i.dnsName %] ' --tagsname='web*' | xargs csshX --ssh_args '-i /path/to/key -l username' |
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
use strict; | |
use warnings; | |
use Amazon::SQS::Simple; | |
use Time::Piece; | |
my $access_key = ''; # Your AWS Access Key ID | |
my $secret_key = ''; # Your AWS Secret Key | |
my $queue_name = 'perl_test_queue'; | |
# Create an SQS object |
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 benchmarker import Benchmarker | |
import urllib2 | |
import httplib2 | |
import requests | |
h = httplib2.Http() | |
with Benchmarker(loop=3000) as bm: | |
for _ in bm.empty(): ## empty loop | |
pass |
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
my $app = sub { | |
return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ] ]; | |
}; | |
# starman --workers 1 hello_world.psgi -p 5001 | |
#################################################### | |
# ab -c 30 -n 5000 http://127.0.0.1:5001/ | |
Server Software: |
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
# encoding:utf-8 | |
# via http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html#dbengine-logging | |
import pdb | |
import logging | |
logging.basicConfig() | |
logging.getLogger('sqlalchemy.engine').setLevel(logging.DEBUG) | |
logging.getLogger('sqlalchemy.dialects').setLevel(logging.DEBUG) | |
logging.getLogger('sqlalchemy.pool').setLevel(logging.DEBUG) |
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
# encoding:utf-8 | |
from sqlalchemy import create_engine, Column, Integer, String, DateTime, Text, ForeignKey | |
from sqlalchemy.orm import scoped_session, sessionmaker, relationship, backref | |
from sqlalchemy.ext.declarative import declarative_base | |
from config import DSN | |
# setup sqlalchemy | |
engine = create_engine(DSN, encoding='utf-8') | |
db_session = scoped_session(sessionmaker(autocommit=False, |
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
use strict; | |
use warnings; | |
use Data::Dumper; | |
use JSON::XS; | |
use Data::MessagePack; | |
$| = 1; | |
my $mp = Data::MessagePack->new(); | |
while ( my $json = <STDIN> ) { |
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/sh | |
if [ ! -p /dev/stdin ] ; then | |
exit 0 | |
fi | |
VM="" | |
RECIPE="" | |
# 標準入力から受け取り | |
STDIN_STR=$(cat -) | |
PAYLOAD=`echo $STDIN_STR | jq -r '.[0] .Payload' | base64 -d` |