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
upstream _a { | |
server 127.0.0.1:8000; | |
} | |
upstream _b { | |
server 127.0.0.1:8001; | |
} | |
upstream _c { | |
server 127.0.0.1:8002; |
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
port = lambda do |env| | |
body = "Hello from variant #{ENV['VARIANT']} on #{env['SERVER_NAME']}:#{env['SERVER_PORT']} at #{env['HTTP_X_TIME']}" | |
[200, {"Content-Type" => "text/html"}, [body]] | |
end | |
run port |
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
--- src/http/ngx_http_variables.c.orig 2010-01-11 03:21:46.000000000 -0800 | |
+++ src/http/ngx_http_variables.c 2010-02-18 10:01:32.000000000 -0800 | |
@@ -93,6 +93,9 @@ | |
static ngx_int_t ngx_http_variable_pid(ngx_http_request_t *r, | |
ngx_http_variable_value_t *v, uintptr_t data); | |
+static ngx_int_t ngx_http_variable_start_time(ngx_http_request_t *r, | |
+ ngx_http_variable_value_t *v, uintptr_t data); | |
+ | |
/* |
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
# | |
# shell function to print graphite graphs as sparklines in the terminal | |
# needs https://github.com/holman/spark | |
# | |
function graphline() { | |
GRAPHITEHOST="graphite.example.com" | |
if [ ! -n "$1" ]; then print "Usage: $0 metric [minutes]"; return 1; fi | |
if [ ! -n "$2" ]; then MINUTES=10 ; else MINUTES=$2; fi | |
curl -s "${GRAPHITEHOST}/render?from=-${MINUTES}minutes&target=${1}&format=raw" | cut -d"|" -f 2 | spark ; | |
} |
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 | |
# create an array from the params | |
declare -a CMD=($*) | |
# execute the command given by the params | |
${CMD[@]} | |
# notify the outcome given by the exit code | |
if [ $? == 0 ] | |
then | |
notify-send "${CMD[0]} passed" -i gtk-dialog-info |
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
if (typeof window.console == "undefined") { | |
if (!window.console || !console.firebug) | |
{ | |
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", | |
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; | |
window.console = {}; | |
for (var i = 0; i < names.length; ++i) | |
window.console[names[i]] = function() {} | |
} |
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
module Firebug | |
VERSION = "1.6.2" | |
end | |
Capybara.register_driver :selenium_with_firebug do |app| | |
require 'selenium/webdriver' | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile.add_extension("spec/support/firebug-#{Firebug::VERSION}.xpi") |
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
Using /home/dave/.rvm/gems/ruby-1.8.7-p334 with gemset rails2-3-10 | |
$ time spec spec/views/people/_header.haml_spec.rb | |
No server is running | |
Running specs locally: | |
...... | |
Finished in 1.522537 seconds | |
6 examples, 0 failures |
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
# Force backtraces from Thin to output to STDERR | |
# workaround for http://stackoverflow.com/questions/4627928/get-rails-exceptions-to-show-using-capybara-and-selenium | |
module Thin::Logging | |
def log_error(e=$!) | |
STDERR.print "#{e}\n\t" + e.backtrace.join("\n\t") | |
end | |
end |
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 | |
echo "adding xPUD 0.9.2" >&2 | |
exec tail -n +3 $0 | |
# This file provides an easy way to add custom menu entries. Simply type the | |
# menu entries you want to add after this comment. Be careful not to change | |
# the 'exec tail' line above. | |
menuentry "xPUD 0.9.2" { | |
set isofile="/boot/iso/xpud-0.9.2.iso" | |
loopback loop (hd0,1)$isofile |