This file contains hidden or 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
require 'aws-sdk' | |
require 'openssl' | |
class DotStream | |
def initialize(size) | |
@size = size | |
@bytes_left = size | |
end |
This file contains hidden or 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
require 'aws-sdk' | |
require 'logger' | |
# configure a logger instance that logs to standard out, | |
# this could be a file, standard error, etc. The logger only | |
# needs to respond to #log and accept a severity and a message. | |
AWS.config(:logger => Logger.new($stdout)) | |
# make a request to see the request logger | |
ec2 = AWS::EC2.new |
This file contains hidden or 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
# build a dummy http handler that extends the default handler | |
# that outputs the request body before making the request (via super) | |
# then check the response body | |
# req is a AWS::Core::Http::Request object | |
# resp is a AWS::Core::Http::Response object | |
default_handler = AWS.config.http_handler | |
debug_handler = AWS::Core::Http::Handler.new(default_handler) do |req,resp| | |
puts "REQUEST BODY: #{req.body}" | |
super(req,resp) |
This file contains hidden or 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
sudo yum install -y gcc make \ | |
libxml2 libxml2-devel libxslt libxslt-devel \ | |
rubygems ruby-devel | |
sudo gem install nokogiri -- --with-xml2-lib=/usr/local/lib \ | |
--with-xml2-include=/usr/local/include/libxml2 \ | |
--with-xslt-lib=/usr/local/lib \ | |
--with-xslt-include=/usr/local/include | |
sudo gem install aws-sdk --no-ri --no-rdoc |
NewerOlder