Skip to content

Instantly share code, notes, and snippets.

@upsidedownchicken
upsidedownchicken / proxy.rb
Last active August 29, 2015 14:07 — forked from tomlea/proxy.rb
require "net/http"
require "enumerator"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end
@upsidedownchicken
upsidedownchicken / gist:1878736
Created February 21, 2012 20:34
bash-style ctrl-r in zsh vi-mode
# from http://zshwiki.org/home/zle/bindkeys
bindkey -M viins '^r' history-incremental-search-backward
bindkey -M vicmd '^r' history-incremental-search-backward
@upsidedownchicken
upsidedownchicken / ssh-config-gen.rb
Created June 7, 2011 19:33
Generate SSH config from Rackspace cloud servers
require 'erb'
require 'yaml'
require 'cloudservers'
conf = YAML.load_file( 'conf.yml' )
cs = CloudServers::Connection.new(
:username => conf['rackspace_api_username'],
:api_key => conf['rackspace_api_key'],
)