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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'pp' | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "centos" | |
config.vm.network :forwarded_port, guest: 80, host: 8888 | |
config.vm.network :private_network, ip: "192.168.33.10" |
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
use strict; | |
use warnings; | |
use Data::Dumper; | |
use Parallel::Benchmark; | |
use RedisDB; | |
use String::Random; | |
my $host = shift || 'localhost'; | |
my $port = shift || '6379'; |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "AWS CloudFormation Sample Template AutoScalingKeepAtNSample: Create a load balanced, Auto Scaled sample website. This example creates an Auto Scaling group behind a load balancer with a simple health check using a basic getting start AMI that has a simple Apache Web Server-based PHP page. The web site is available on port 80, however, the instances can be configured to listen on any port (8888 by default). **WARNING** This template creates one or more Amazon EC2 instances and an Elastic Load Balancer. You will be billed for the AWS resources used if you create a stack from this template.", | |
"Parameters" : { | |
"InstanceType" : { | |
"Description" : "WebServer EC2 instance type", | |
"Type" : "String", | |
"Default" : "m1.small", |
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
#!/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 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
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 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
yoga render --template='[% i.dnsName %] ' --tagsname='web*' | xargs csshX --ssh_args '-i /path/to/key -l username' |
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
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 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
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 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
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 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
# 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) |