start new:
tmux
start new with session name:
tmux new -s myname
| # Description: | |
| # Log all the things to ElasticSearch then lets you ask hubot what you missed | |
| # | |
| # Dependencies: | |
| # None | |
| # | |
| # Configuration: | |
| # ELASTICSEARCH_HOSTNAME - E.G. elasticsearch.example.com:9200, where to send the put requests | |
| # ELASTICSEARCH_USERNAME - OPTIONAL basic auth username | |
| # ELASTICSEARCH_PASSWORD - OPTIONAL basic auth password |
| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
| # | |
| WP_OWNER=www-data # <-- wordpress owner | |
| WP_GROUP=www-data # <-- wordpress group | |
| WP_ROOT=$1 # <-- wordpress root directory |
| # Interacts with PagerDuty | |
| # Author: Markus Heurung <[email protected]> | |
| # | |
| # pd inc(idents) [all|ack(nowledged)|res(olved)] - list incidents (only all for now) | |
| # pd ack(nowledge) <key> - acknowledge incident - not fully working yet | |
| # pd res(olve) <key> - resolve incident - not fully working yet | |
| # pd #ID - show incident details - not working yet | |
| # pd trigger <description> - create new incident | |
| # Create 4 volumes and attach them to hdb | |
| %w[sdi sdj sdk sdl].each do |dev| | |
| volume = AWS.volumes.new :device => "/dev/#{dev}", :size => 5, :availability_zone => hdb.availability_zone | |
| volume.server = hdb | |
| volume.save | |
| end |
| #!/usr/bin/env ruby | |
| require 'fog' | |
| require 'trollop' | |
| require 'yaml' | |
| STDOUT.sync = true |
| # based on http://uberblo.gs/2011/06/high-performance-url-shortening-with-redis-backed-nginx | |
| # using code from http://stackoverflow.com/questions/3554315/lua-base-converter | |
| # "database scheme" | |
| # database 0: id ~> url | |
| # database 1: id ~> hits | |
| # database 2: id ~> [{referer|user_agent}] | |
| # database 3: id ~> hits (when id is not found) | |
| # database 4: id ~> [{referer|user_agent}] (when id is not found) | |
| # database 5: key "count" storing the number of shortened urls; the id is generated by (this number + 1) converted to base 62 |
| ######################################## | |
| ##### upstart_virtualenv_test.conf ##### | |
| ##### install in /etc/init ##### | |
| ######################################## | |
| description "Testing virtualenv and upstart setup" | |
| env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test | |
| start on runlevel [2345] |
Run these two servers using the commands given in their source. Benchmark using:
ab -n 1000 -c 1000 http://localhost:8000/
I found thin can handle these requests without a problem. puma drops connections
and causes ab to exit early.
With 200 threads, puma can handle 200 requests but does not respond promptly:
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'fog' | |
| config = YAML.load(File.read(ARGV[0])) | |
| volumes_to_snap = YAML.load(File.read(ARGV[1])) | |
| time = Time.now | |
| puts "\nCreating snaps #{time.to_s}" |