ec2-tracer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +16 -15
- data/.gitignore +0 -8
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -33
- data/LICENSE.txt +0 -21
- data/README.md +0 -43
- data/Rakefile +0 -2
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/ec2-tracer.gemspec +0 -26
- data/ec2.d +0 -55
- data/lib/ec2/tracer/version.rb +0 -5
- data/lib/ec2/tracer.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d42c126f41efe3655870aa79317050dd3599ab0f921895cc0ef0eebcc1ee30a
|
4
|
+
data.tar.gz: e6206732e4ec34761eff8a7e3228d89839a6a3c1f06a43f7c495ff83b98f2d1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66ae63b5c314e9a25ed31af8674d3c7303a9776c6696f4d660066260bc23c9151b8e5f1f394b16936f79acce6dad7ec1e9647b83030060535a9cfbcbb337a2b1
|
7
|
+
data.tar.gz: 07e99885f5761f07b635edd9dedb04e8f78c24ec5f777ab724f0ce5f8c0056bf73823ebc3040ee89bea26d4631a0ccae13622cdf9ec0a3be4c90ee8fefda78e2
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ec2-tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cuongnm265
|
@@ -52,26 +52,27 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: thor
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Write a longer description or delete this line.
|
56
70
|
email:
|
57
71
|
- cuongnm265@gmail.com
|
58
72
|
executables: []
|
59
73
|
extensions: []
|
60
74
|
extra_rdoc_files: []
|
61
|
-
files:
|
62
|
-
- ".gitignore"
|
63
|
-
- CODE_OF_CONDUCT.md
|
64
|
-
- Gemfile
|
65
|
-
- Gemfile.lock
|
66
|
-
- LICENSE.txt
|
67
|
-
- README.md
|
68
|
-
- Rakefile
|
69
|
-
- bin/console
|
70
|
-
- bin/setup
|
71
|
-
- ec2-tracer.gemspec
|
72
|
-
- ec2.d
|
73
|
-
- lib/ec2/tracer.rb
|
74
|
-
- lib/ec2/tracer/version.rb
|
75
|
+
files: []
|
75
76
|
homepage:
|
76
77
|
licenses:
|
77
78
|
- MIT
|
data/.gitignore
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at cuongnm265@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
ec2-tracer (0.1.1)
|
5
|
-
aws-sdk-ec2
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
aws-eventstream (1.0.0)
|
11
|
-
aws-partitions (1.87.0)
|
12
|
-
aws-sdk-core (3.21.2)
|
13
|
-
aws-eventstream (~> 1.0)
|
14
|
-
aws-partitions (~> 1.0)
|
15
|
-
aws-sigv4 (~> 1.0)
|
16
|
-
jmespath (~> 1.0)
|
17
|
-
aws-sdk-ec2 (1.34.0)
|
18
|
-
aws-sdk-core (~> 3)
|
19
|
-
aws-sigv4 (~> 1.0)
|
20
|
-
aws-sigv4 (1.0.2)
|
21
|
-
jmespath (1.4.0)
|
22
|
-
rake (10.5.0)
|
23
|
-
|
24
|
-
PLATFORMS
|
25
|
-
ruby
|
26
|
-
|
27
|
-
DEPENDENCIES
|
28
|
-
bundler (~> 1.16)
|
29
|
-
ec2-tracer!
|
30
|
-
rake (~> 10.0)
|
31
|
-
|
32
|
-
BUNDLED WITH
|
33
|
-
1.16.1
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2018 cuongnm265
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# Ec2::Tracer
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ec2/tracer`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'ec2-tracer'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install ec2-tracer
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ec2-tracer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
-
|
37
|
-
## License
|
38
|
-
|
39
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
-
|
41
|
-
## Code of Conduct
|
42
|
-
|
43
|
-
Everyone interacting in the Ec2::Tracer project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/ec2-tracer/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "ec2/tracer"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/ec2-tracer.gemspec
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "ec2/tracer/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "ec2-tracer"
|
8
|
-
spec.version = Ec2::Tracer::VERSION
|
9
|
-
spec.authors = ["cuongnm265"]
|
10
|
-
spec.email = ["cuongnm265@gmail.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Write a short summary, because RubyGems requires one.}
|
13
|
-
spec.description = %q{Write a longer description or delete this line.}
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
-
f.match(%r{^(test|spec|features)/})
|
18
|
-
end
|
19
|
-
spec.bindir = "exe"
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
-
spec.require_paths = ["lib"]
|
22
|
-
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.16"
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
-
spec.add_dependency "aws-sdk-ec2"
|
26
|
-
end
|
data/ec2.d
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
|
2
|
-
# welligence_ml_5
|
3
|
-
Host welligence_ml_5
|
4
|
-
HostName
|
5
|
-
User ubuntu
|
6
|
-
IdentityFile ~/.ssh/welligence.pem
|
7
|
-
|
8
|
-
# welligence_ml_9
|
9
|
-
Host welligence_ml_9
|
10
|
-
HostName
|
11
|
-
User ubuntu
|
12
|
-
IdentityFile ~/.ssh/welligence.pem
|
13
|
-
|
14
|
-
# welligence_ml_2
|
15
|
-
Host welligence_ml_2
|
16
|
-
HostName 52.38.40.186
|
17
|
-
User ubuntu
|
18
|
-
IdentityFile ~/.ssh/welligence.pem
|
19
|
-
|
20
|
-
# welligence_ml_10
|
21
|
-
Host welligence_ml_10
|
22
|
-
HostName
|
23
|
-
User ubuntu
|
24
|
-
IdentityFile ~/.ssh/welligence.pem
|
25
|
-
|
26
|
-
# welligence_ml_6
|
27
|
-
Host welligence_ml_6
|
28
|
-
HostName 34.217.52.252
|
29
|
-
User ubuntu
|
30
|
-
IdentityFile ~/.ssh/welligence.pem
|
31
|
-
|
32
|
-
# welligence_ml_7
|
33
|
-
Host welligence_ml_7
|
34
|
-
HostName 18.237.174.97
|
35
|
-
User ubuntu
|
36
|
-
IdentityFile ~/.ssh/welligence.pem
|
37
|
-
|
38
|
-
# welligence_ml_3
|
39
|
-
Host welligence_ml_3
|
40
|
-
HostName
|
41
|
-
User ubuntu
|
42
|
-
IdentityFile ~/.ssh/welligence.pem
|
43
|
-
|
44
|
-
# welligence_ml_4
|
45
|
-
Host welligence_ml_4
|
46
|
-
HostName
|
47
|
-
User ubuntu
|
48
|
-
IdentityFile ~/.ssh/welligence.pem
|
49
|
-
|
50
|
-
# welligence_ml_8
|
51
|
-
Host welligence_ml_8
|
52
|
-
HostName
|
53
|
-
User ubuntu
|
54
|
-
IdentityFile ~/.ssh/welligence.pem
|
55
|
-
|
data/lib/ec2/tracer/version.rb
DELETED
data/lib/ec2/tracer.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require "ec2/tracer/version"
|
2
|
-
require 'aws-sdk-ec2'
|
3
|
-
|
4
|
-
module Ec2
|
5
|
-
module Tracer
|
6
|
-
class Writer
|
7
|
-
WRITE_MODE = 'a'.freeze
|
8
|
-
TEMP_IP = '0.0.0.0'
|
9
|
-
|
10
|
-
attr_reader :file_name, :host_prefix, :range, :user, :identity_file
|
11
|
-
|
12
|
-
def initialize(file_name = 'ec2.d', host_prefix = 'welligence_ml', range = (2..10), user = 'ubuntu', identity_file = '~/.ssh/welligence.pem' )
|
13
|
-
@file_name = file_name
|
14
|
-
@host_prefix = host_prefix
|
15
|
-
@range = range
|
16
|
-
@user = user
|
17
|
-
@identity_file = identity_file
|
18
|
-
end
|
19
|
-
|
20
|
-
def write_config
|
21
|
-
ec2 = Aws::EC2::Resource.new(region: 'us-west-2')
|
22
|
-
filepath = "#{Dir.pwd}/#{file_name}"
|
23
|
-
|
24
|
-
FileUtils.rm_rf filepath
|
25
|
-
FileUtils.touch filepath
|
26
|
-
|
27
|
-
ec2.instances({filters: [{name: 'tag:Name', values: range.map{|i| "#{host_prefix}_#{i}"} }]}).each do |i|
|
28
|
-
instance_tag_name = i.tags.map(&:value).join()
|
29
|
-
public_ip_address = i.public_ip_address
|
30
|
-
|
31
|
-
puts "#{instance_tag_name} - #{public_ip_address}"
|
32
|
-
File.open(filepath, WRITE_MODE) { |f| f << ssh_host(host: instance_tag_name, host_name: public_ip_address) }
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def ssh_host(host:, host_name:)
|
39
|
-
%{
|
40
|
-
# #{host}
|
41
|
-
Host #{host}
|
42
|
-
HostName #{host_name || TEMP_IP}
|
43
|
-
User #{user}
|
44
|
-
IdentityFile #{identity_file}
|
45
|
-
}
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|