Wes Winham winhamwr@gmail.com
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.
#!/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 } |
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 = '/*' |
Wes Winham winhamwr@gmail.com
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]) |
#!/usr/bin/env python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
ack | |
bundle | |
cat | |
cd | |
cd- | |
ceedling | |
cp | |
curl | |
diff | |
find |
-- Two dashes start a one-line comment. | |
--[[ | |
Adding two ['s and ]'s makes it a | |
multi-line comment. | |
--]] | |
---------------------------------------------------- | |
-- 1. Variables and flow control. | |
---------------------------------------------------- |
#install openssl | |
#sudo aptitude install python-openssl | |
from OpenSSL import SSL | |
import socket, SocketServer | |
class SSlSocketServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): | |
def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True): | |
SocketServer.BaseServer.__init__(self, server_address, |
#!/usr/bin/ruby | |
require 'socket' | |
begin | |
addr = ['<broadcast>', 9] | |
UDPSock = UDPSocket.new | |
UDPSock.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true) | |
mac_address = ARGV[0] |