Wes Winham [email protected]
There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.
import boto | |
import sys | |
ec2 = boto.connect_ec2() | |
elb = boto.connect_elb() | |
load_balancer = elb.get_all_load_balancers(load_balancer_names=[sys.argv[1]])[0] | |
health = load_balancer.get_instance_health() | |
instances = ec2.get_only_instances(instance_ids=[instance.id for instance in load_balancer.instances]) |
Wes Winham [email protected]
There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.
require "cgi" | |
class AkamaiTokenConfig | |
attr_accessor :window, :session_id, :data, :salt, :field_delimiter, :early_url_encoding, :ip | |
attr_reader :start_time, :hash_strategy, :acl, :url | |
def initialize(config={}) | |
@ip = '' | |
self.start_time = Time.now.to_i | |
self.acl = '/*' |
#!/usr/bin/env ruby | |
require 'net/telnet' | |
require 'terminal-table' | |
tbl = Terminal::Table.new headings: %w(id expires cache_key bytes) | |
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3) | |
matches = localhost.cmd("String" => "stats items", "Match" => /^END/).scan(/STAT items:(\d+):number (\d+)/) | |
slabs = matches.inject([]) { |items, item| items << Hash[*['id','items'].zip(item).flatten]; items } |