MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。
2014年6月11日時点での情報。
- Version: CoreOS 343.0.0
- Kernel: 3.14.5
- Docker: 1.0
| #!/bin/bash | |
| echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..." | |
| echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n" | |
| ## Gnuplot settings | |
| echo "set terminal png | |
| set output 'benchmark_${1}_${2}.png' | |
| set title 'ab ${1} ${2}' |
| #!/usr/bin/env perl | |
| use 5.10.0; | |
| use utf8; | |
| use LWP::Simple; | |
| use Encode 'encode'; | |
| use Encode::MIME::Header; | |
| use File::Slurp 'slurp'; | |
| use Email::MIME; | |
| use Email::Sender::Simple qw(sendmail); |
| # https://gist.github.com/1214011 | |
| module WillPaginate | |
| module ActionView | |
| def will_paginate(collection = nil, options = {}) | |
| options[:renderer] ||= BootstrapLinkRenderer | |
| super.try :html_safe | |
| end | |
| class BootstrapLinkRenderer < LinkRenderer |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl http://npmjs.org/install.sh | sh |
| function git_branch { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
| echo "("${ref#refs/heads/}") "; | |
| } | |
| function git_since_last_commit { | |
| now=`date +%s`; | |
| last_commit=$(git log --pretty=format:%at -1 2> /dev/null) || return; | |
| seconds_since_last_commit=$((now-last_commit)); | |
| minutes_since_last_commit=$((seconds_since_last_commit/60)); |
| require 'rubygems' | |
| require 'sinatra' | |
| get '/' do | |
| "Hello from Sinatra running on Java!" | |
| end |