aeden-aws-tools 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ config/amazon.yml
data/README.markdown ADDED
@@ -0,0 +1 @@
1
+ Tools that help with gathering data and doing other things with Amazon Web Services. These tools require ruby and the Right AWS library to function.
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ require 'rake'
2
+ require 'rake/rdoctask'
3
+
4
+ desc 'Generate documentation.'
5
+ Rake::RDocTask.new(:rdoc) do |rdoc|
6
+ rdoc.rdoc_dir = 'rdoc'
7
+ rdoc.title = 'Refinery'
8
+ rdoc.options << '--line-numbers' << '--inline-source'
9
+ rdoc.rdoc_files.include('README.rdoc')
10
+ rdoc.rdoc_files.include('lib/*.rb')
11
+ rdoc.rdoc_files.include('lib/**/*.rb')
12
+ end
13
+
14
+ begin
15
+ require 'jeweler'
16
+ Jeweler::Tasks.new do |gemspec|
17
+ gemspec.name = "aws-tools"
18
+ gemspec.summary = "Tools for working with Amazon Web Services."
19
+ gemspec.email = "anthonyeden@gmail.com"
20
+ gemspec.homepage = "http://github.com/aeden/aws-tools"
21
+ gemspec.description = "Tools for working with Amazon Web Services."
22
+ gemspec.authors = ["Anthony Eden"]
23
+ gemspec.files.exclude 'docs/**/*'
24
+ end
25
+ rescue LoadError
26
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
27
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
data/bin/queue_length ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.dirname(__FILE__) + '/../lib/queue_length'
data/bin/queue_peek ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.dirname(__FILE__) + '/../lib/queue_peek'
@@ -0,0 +1,3 @@
1
+ credentials:
2
+ access_key_id: ACCESS_KEY_ID
3
+ secret_access_key: SECRET_ACCESS_KEY
data/lib/aws_config.rb ADDED
@@ -0,0 +1,13 @@
1
+ class AwsConfig
2
+ def self.credentials
3
+ config['credentials']
4
+ end
5
+
6
+ def self.config
7
+ @config ||= YAML.load(config_file)
8
+ end
9
+
10
+ def self.config_file
11
+ @config_file ||= File.new(File.join(File.dirname(__FILE__), "/../config/amazon.yml"))
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ $:.unshift(File.dirname(__FILE__))
2
+
3
+ require 'ssl_no_verify'
4
+
5
+ require 'rubygems'
6
+ require 'right_aws'
7
+ require 'aws_config'
8
+
9
+ queue_name = ARGV.pop
10
+
11
+ sqs = RightAws::SqsGen2.new(
12
+ AwsConfig.credentials["access_key_id"],
13
+ AwsConfig.credentials["secret_access_key"],
14
+ :logger => Logger.new(nil)
15
+ )
16
+ puts sqs.queue(queue_name).size()
data/lib/queue_peek.rb ADDED
@@ -0,0 +1,21 @@
1
+ $:.unshift(File.dirname(__FILE__))
2
+
3
+ require 'ssl_no_verify'
4
+
5
+ require 'rubygems'
6
+ require 'right_aws'
7
+ require 'json'
8
+ require 'aws_config'
9
+
10
+ queue_name = ARGV.pop
11
+ RAILS_ENV = ARGV.pop
12
+
13
+ sqs = RightAws::SqsGen2.new(
14
+ AwsConfig.credentials["access_key_id"],
15
+ AwsConfig.credentials["secret_access_key"],
16
+ :logger => Logger.new(nil)
17
+ )
18
+
19
+ while(m = sqs.queue(queue_name).receive(1))
20
+ pp JSON.parse(Base64.decode64(m.body))
21
+ end
@@ -0,0 +1,9 @@
1
+ require 'net/http'
2
+ class Net::HTTP
3
+ alias_method :old_initialize, :initialize
4
+ def initialize(*args)
5
+ old_initialize(*args)
6
+ @ssl_context = OpenSSL::SSL::SSLContext.new
7
+ @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aeden-aws-tools
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Anthony Eden
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-30 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Tools for working with Amazon Web Services.
17
+ email: anthonyeden@gmail.com
18
+ executables:
19
+ - queue_length
20
+ - queue_peek
21
+ extensions: []
22
+
23
+ extra_rdoc_files:
24
+ - README.markdown
25
+ files:
26
+ - .gitignore
27
+ - README.markdown
28
+ - Rakefile
29
+ - VERSION
30
+ - bin/queue_length
31
+ - bin/queue_peek
32
+ - config/amazon.example.yml
33
+ - lib/aws_config.rb
34
+ - lib/queue_length.rb
35
+ - lib/queue_peek.rb
36
+ - lib/ssl_no_verify.rb
37
+ has_rdoc: true
38
+ homepage: http://github.com/aeden/aws-tools
39
+ licenses:
40
+ post_install_message:
41
+ rdoc_options:
42
+ - --charset=UTF-8
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ version:
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ requirements: []
58
+
59
+ rubyforge_project:
60
+ rubygems_version: 1.3.5
61
+ signing_key:
62
+ specification_version: 2
63
+ summary: Tools for working with Amazon Web Services.
64
+ test_files: []
65
+