cknife 0.1.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a56ca9ba2138a51b292217b9254bb9dbe049b808
4
- data.tar.gz: de0612fa7044778dc72dd7719b03ef28b7e9d751
3
+ metadata.gz: 942e64f111eae005180fac6810e16a3edf9c3a84
4
+ data.tar.gz: c4a46d9f451bb18b8799815c48a1be45d1632e49
5
5
  SHA512:
6
- metadata.gz: cfd7df7db5758fe4f81984eb1682bd04337bab7175b3e88ce144c5f1052b217e5f67469066dff4d18422a863ec00e8644091b3a111ebf4e11e1667e74d5e31bc
7
- data.tar.gz: 5d6b9873ab3bc5dab84aab32e9db8d6637fdda0616bf11e2b8e7ba25e268126a8bcd03203b8ec56001403c6dd5bf756c1184732614bca08604d294250cc46041
6
+ metadata.gz: dbe3f929fa330740f8928de67be6b45f5ad3f3088538c79a7cd47bf0a88f4dd4492d7bfcdcd6018e86072c08228f6edf94db28c2c9366526bae39294d9dfca34
7
+ data.tar.gz: 805af5ed73add5a49fc6f10c4ae97bd6f73e6230625d1becb8b33e1b6303758d55d16ed64cb9d382f3e711bb9752bc1ca8a01dedd0d624990bfd896bcde6b7c8
data/Gemfile CHANGED
@@ -1,22 +1,23 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rest-client", '>= 1.6', '~> 1'
4
- gem "nokogiri", '>= 1.6', '~> 1'
5
- gem "i18n", "~> 0"
6
- gem "activesupport", '~> 3'
7
- gem "actionpack", '~> 3'
8
- gem "mail", '~> 2.4'
3
+ gem "rest-client", '>= 1.8.0', '~> 1'
4
+ gem "nokogiri", '>= 1.8.2', '~> 1'
5
+ gem "i18n", '>= 0.6.6'
6
+ gem "activesupport", '~> 4.2.9'
7
+ gem "actionpack", '~> 4.2.9'
8
+ gem "mail", '~> 2.5.5'
9
9
  gem "thor", '>= 0.14', '~> 0'
10
10
  gem "builder", '~> 3.0'
11
- gem "fog", '>= 1.15', '<= 1.17'
11
+ gem "fog-aws", '< 3.0'
12
12
  gem "unf", '>= 0.1', '~> 0'
13
+ gem "daemons"
13
14
 
14
15
  # Add dependencies to develop your gem here.
15
16
  # Include everything needed to run rake, tests, features, etc.
16
17
  group :development do
17
18
  # gem "cknife", :path => "." # this arguably makes it easier to test quickly, locally.
18
19
  gem "bundler", "~> 1.0"
19
- gem "jeweler", "~> 2.0"
20
+ gem "jeweler", "~> 2.1"
20
21
  end
21
22
 
22
23
 
@@ -1,110 +1,128 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionpack (3.1.12)
5
- activemodel (= 3.1.12)
6
- activesupport (= 3.1.12)
7
- builder (~> 3.0.0)
4
+ actionpack (4.2.10)
5
+ actionview (= 4.2.10)
6
+ activesupport (= 4.2.10)
7
+ rack (~> 1.6)
8
+ rack-test (~> 0.6.2)
9
+ rails-dom-testing (~> 1.0, >= 1.0.5)
10
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
11
+ actionview (4.2.10)
12
+ activesupport (= 4.2.10)
13
+ builder (~> 3.1)
8
14
  erubis (~> 2.7.0)
9
- i18n (~> 0.6)
10
- rack (~> 1.3.6)
11
- rack-cache (~> 1.2)
12
- rack-mount (~> 0.8.2)
13
- rack-test (~> 0.6.1)
14
- sprockets (~> 2.0.4)
15
- activemodel (3.1.12)
16
- activesupport (= 3.1.12)
17
- builder (~> 3.0.0)
18
- i18n (~> 0.6)
19
- activesupport (3.1.12)
20
- multi_json (~> 1.0)
21
- addressable (2.3.6)
22
- builder (3.0.4)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
17
+ activesupport (4.2.10)
18
+ i18n (~> 0.7)
19
+ minitest (~> 5.1)
20
+ thread_safe (~> 0.3, >= 0.3.4)
21
+ tzinfo (~> 1.1)
22
+ addressable (2.4.0)
23
+ builder (3.2.3)
24
+ concurrent-ruby (1.0.5)
25
+ crass (1.0.4)
26
+ daemons (1.2.3)
23
27
  descendants_tracker (0.0.4)
24
28
  thread_safe (~> 0.3, >= 0.3.1)
29
+ domain_name (0.5.20180417)
30
+ unf (>= 0.0.5, < 1.0.0)
25
31
  erubis (2.7.0)
26
- excon (0.27.6)
27
- faraday (0.9.0)
32
+ excon (0.62.0)
33
+ faraday (0.9.2)
28
34
  multipart-post (>= 1.2, < 3)
29
- fog (1.17.0)
35
+ fog-aws (2.0.1)
36
+ fog-core (~> 1.38)
37
+ fog-json (~> 1.0)
38
+ fog-xml (~> 0.1)
39
+ ipaddress (~> 0.8)
40
+ fog-core (1.45.0)
30
41
  builder
31
- excon (~> 0.27.0)
32
- formatador (~> 0.2.0)
33
- mime-types
34
- multi_json (~> 1.0)
35
- net-scp (~> 1.1)
36
- net-ssh (>= 2.1.3)
37
- nokogiri (~> 1.5)
38
- ruby-hmac
39
- formatador (0.2.4)
40
- git (1.2.8)
41
- github_api (0.12.1)
42
- addressable (~> 2.3)
42
+ excon (~> 0.58)
43
+ formatador (~> 0.2)
44
+ fog-json (1.2.0)
45
+ fog-core
46
+ multi_json (~> 1.10)
47
+ fog-xml (0.1.3)
48
+ fog-core
49
+ nokogiri (>= 1.5.11, < 2.0.0)
50
+ formatador (0.2.5)
51
+ git (1.5.0)
52
+ github_api (0.16.0)
53
+ addressable (~> 2.4.0)
43
54
  descendants_tracker (~> 0.0.4)
44
55
  faraday (~> 0.8, < 0.10)
45
- hashie (>= 3.2)
46
- multi_json (>= 1.7.5, < 2.0)
47
- nokogiri (~> 1.6.3)
48
- oauth2
49
- hashie (3.3.1)
50
- highline (1.6.21)
51
- hike (1.2.3)
52
- i18n (0.6.11)
53
- jeweler (2.0.1)
56
+ hashie (>= 3.4)
57
+ mime-types (>= 1.16, < 3.0)
58
+ oauth2 (~> 1.0)
59
+ hashie (3.6.0)
60
+ highline (2.0.0)
61
+ http-cookie (1.0.3)
62
+ domain_name (~> 0.5)
63
+ i18n (0.9.5)
64
+ concurrent-ruby (~> 1.0)
65
+ ipaddress (0.8.3)
66
+ jeweler (2.3.9)
54
67
  builder
55
- bundler (>= 1.0)
68
+ bundler
56
69
  git (>= 1.2.5)
57
- github_api
70
+ github_api (~> 0.16.0)
58
71
  highline (>= 1.6.15)
59
72
  nokogiri (>= 1.5.10)
73
+ psych
60
74
  rake
61
75
  rdoc
62
- json (1.8.1)
63
- jwt (1.0.0)
64
- mail (2.4.4)
65
- i18n (>= 0.4.0)
76
+ semver2
77
+ jwt (1.5.6)
78
+ loofah (2.2.2)
79
+ crass (~> 1.0.2)
80
+ nokogiri (>= 1.5.9)
81
+ mail (2.5.5)
66
82
  mime-types (~> 1.16)
67
83
  treetop (~> 1.4.8)
68
- mime-types (1.16)
69
- mini_portile (0.6.0)
70
- multi_json (1.10.1)
71
- multi_xml (0.5.5)
84
+ mime-types (1.25.1)
85
+ mini_portile2 (2.3.0)
86
+ minitest (5.11.3)
87
+ multi_json (1.13.1)
88
+ multi_xml (0.6.0)
72
89
  multipart-post (2.0.0)
73
- net-scp (1.1.2)
74
- net-ssh (>= 2.6.5)
75
- net-ssh (2.7.0)
76
- nokogiri (1.6.3.1)
77
- mini_portile (= 0.6.0)
78
- oauth2 (1.0.0)
79
- faraday (>= 0.8, < 0.10)
90
+ netrc (0.11.0)
91
+ nokogiri (1.8.5)
92
+ mini_portile2 (~> 2.3.0)
93
+ oauth2 (1.4.0)
94
+ faraday (>= 0.8, < 0.13)
80
95
  jwt (~> 1.0)
81
96
  multi_json (~> 1.3)
82
97
  multi_xml (~> 0.5)
83
- rack (~> 1.2)
98
+ rack (>= 1.2, < 3)
84
99
  polyglot (0.3.5)
85
- rack (1.3.10)
86
- rack-cache (1.2)
87
- rack (>= 0.4)
88
- rack-mount (0.8.3)
89
- rack (>= 1.0.0)
90
- rack-test (0.6.2)
100
+ psych (3.0.2)
101
+ rack (1.6.10)
102
+ rack-test (0.6.3)
91
103
  rack (>= 1.0)
92
- rake (10.3.2)
93
- rdoc (4.1.1)
94
- json (~> 1.4)
95
- rest-client (1.6.3)
96
- mime-types (>= 1.16)
97
- ruby-hmac (0.4.0)
98
- sprockets (2.0.4)
99
- hike (~> 1.2)
100
- rack (~> 1.0)
101
- tilt (~> 1.1, != 1.3.0)
104
+ rails-deprecated_sanitizer (1.0.3)
105
+ activesupport (>= 4.2.0.alpha)
106
+ rails-dom-testing (1.0.9)
107
+ activesupport (>= 4.2.0, < 5.0)
108
+ nokogiri (~> 1.6)
109
+ rails-deprecated_sanitizer (>= 1.0.1)
110
+ rails-html-sanitizer (1.0.4)
111
+ loofah (~> 2.2, >= 2.2.2)
112
+ rake (12.3.1)
113
+ rdoc (6.0.4)
114
+ rest-client (1.8.0)
115
+ http-cookie (>= 1.0.2, < 2.0)
116
+ mime-types (>= 1.16, < 3.0)
117
+ netrc (~> 0.7)
118
+ semver2 (3.4.2)
102
119
  thor (0.14.6)
103
- thread_safe (0.3.4)
104
- tilt (1.4.1)
120
+ thread_safe (0.3.6)
105
121
  treetop (1.4.15)
106
122
  polyglot
107
123
  polyglot (>= 0.3.1)
124
+ tzinfo (1.2.5)
125
+ thread_safe (~> 0.1)
108
126
  unf (0.1.3)
109
127
  unf_ext
110
128
  unf_ext (0.0.6)
@@ -113,18 +131,19 @@ PLATFORMS
113
131
  ruby
114
132
 
115
133
  DEPENDENCIES
116
- actionpack (~> 3)
117
- activesupport (~> 3)
134
+ actionpack (~> 4.2.9)
135
+ activesupport (~> 4.2.9)
118
136
  builder (~> 3.0)
119
137
  bundler (~> 1.0)
120
- fog (>= 1.15, <= 1.17)
121
- i18n (~> 0)
122
- jeweler (~> 2.0)
123
- mail (~> 2.4)
124
- nokogiri (~> 1, >= 1.6)
125
- rest-client (~> 1, >= 1.6)
138
+ daemons
139
+ fog-aws (< 3.0)
140
+ i18n (>= 0.6.6)
141
+ jeweler (~> 2.1)
142
+ mail (~> 2.5.5)
143
+ nokogiri (~> 1, >= 1.8.2)
144
+ rest-client (~> 1, >= 1.8.0)
126
145
  thor (~> 0, >= 0.14)
127
146
  unf (~> 0, >= 0.1)
128
147
 
129
148
  BUNDLED WITH
130
- 1.10.3
149
+ 1.16.5
data/README.md CHANGED
@@ -1,36 +1,73 @@
1
1
 
2
- [![Gem Version](https://badge.fury.io/rb/cknife.svg)](http://badge.fury.io/rb/cknife)
3
-
4
2
  # Overview
5
3
 
6
- Cali Army Knife, or cknife, is a collection of command line tools.
7
- It's written in Ruby with Thor, and packaged as a Ruby gem. It
8
- depends on the Fog gem for all of it's S3 operations.
4
+ cknife has command line tools written in Ruby. They're supposed
5
+ to help with some system administration tasks.
6
+
7
+ # Requirements
8
+
9
+ Ruby >= 2.1.
9
10
 
10
11
  # Installation
11
12
 
12
- Has been tested successfully on Rubies >= 1.9.2 with activesupport >= 3.
13
+ Install ruby and possibly bundler:
13
14
 
14
15
  > \curl -sSL https://get.rvm.io | bash -s stable --ruby
15
- > gem install cknife
16
+ > gem install bundler
17
+
18
+ Create a Gemfile with cknife and its git repository.
19
+
20
+ source "http://rubygems.org"
21
+
22
+ gem "cknife", :git => "https://github.com/mikedll/cknife.git"
23
+
24
+ Run bundle.
25
+
26
+ > bundle
27
+
28
+ # Monitor
29
+
30
+ This sends out a PUT request every fifteen minutes to a server
31
+ you configure.
32
+
33
+ > bundle exec cknifemon
34
+ Tasks:
35
+ cknifemon help [TASK] # Describe available tasks or one specific task
36
+ cknifemon restart # Restart monitor.
37
+ cknifemon start # Start monitor.
38
+ cknifemon status # Show status of monitor.
39
+ cknifemon stop # Stop monitor.
40
+
41
+ It is designed to work with M. Rivera CRM, but you can configure the
42
+ url to be any endpoint for your own monitoring purposes. You can
43
+ configure alerts on the server that you create as the target endpoint
44
+ of the monitor.
45
+
46
+ The configuration is as follows:
47
+
48
+ mon:
49
+ url: http://some.server.com/monitored_computers/heartbeat
50
+ api_key: someapikey
16
51
 
17
52
  # Amazon Web Services (AWS) Command Line Interface
18
53
 
19
- > cknifeaws help
54
+ > bundle exec cknifeaws help
20
55
  Tasks:
21
- cknifeaws afew [BUCKET_NAME] # Show first 5 files in bucket
22
- cknifeaws create [BUCKET_NAME] # Create a bucket
23
- cknifeaws create_cloudfront [BUCKET_NAME] # Create a cloudfront distribution (a CDN)
24
- cknifeaws delete [BUCKET_NAME] # Destroy a bucket
25
- cknifeaws download [BUCKET_NAME] # Download all files in a bucket to CWD. Or one file.
26
- cknifeaws help [TASK] # Describe available tasks or one specific task
27
- cknifeaws list # Show all buckets
28
- cknifeaws list_cloudfront # List cloudfront distributions (CDNs)
29
- cknifeaws list_servers # Show all servers
30
- cknifeaws show [BUCKET_NAME] # Show info about bucket
31
- cknifeaws start_server [SERVER_ID] # Start a given EC2 server
32
- cknifeaws stop_server [SERVER_ID] # Stop a given EC2 server (does not terminate it)
33
- cknifeaws upsync [BUCKET_NAME] [DIRECTORY] # Push local files matching glob PATTERN into bucket. Ignore unchanged files.
56
+ cknifeaws afew [BUCKET_NAME] # Show first 5 files in bucket
57
+ cknifeaws create [BUCKET_NAME] # Create a bucket
58
+ cknifeaws create_cloudfront [BUCKET_NAME] # Create a cloudfront distribution (a CDN)
59
+ cknifeaws delete [BUCKET_NAME] # Destroy a bucket
60
+ cknifeaws download [BUCKET_NAME] # Download all files in a bucket to CWD. Or one file.
61
+ cknifeaws fdelete [BUCKET_NAME] [FILE_NAME] # Delete a file in a bucket.
62
+ cknifeaws fupload [BUCKET_NAME] [LOCAL_FILE] # Upload a file to a bucket. Path to file is ignored.
63
+ cknifeaws help [TASK] # Describe available tasks or one specific task
64
+ cknifeaws list # Show all buckets
65
+ cknifeaws list_cloudfront # List cloudfront distributions (CDNs)
66
+ cknifeaws list_servers # Show all servers
67
+ cknifeaws show [BUCKET_NAME] # Show info about bucket
68
+ cknifeaws start_server [SERVER_ID] # Start a given EC2 server
69
+ cknifeaws stop_server [SERVER_ID] # Stop a given EC2 server (does not terminate it)
70
+ cknifeaws upsync [BUCKET_NAME] [DIRECTORY] # Push local files matching glob PATTERN into bucket. Ignore unchanged files.
34
71
 
35
72
  ### AWS Key and Secret Configuration
36
73
 
@@ -208,6 +245,10 @@ configuration file:
208
245
  username: dbuser
209
246
  password: dbpassword
210
247
 
248
+ **Warning:** do not use a colon in your password, or the password
249
+ configuration will not work. This is a shortcoming of this project and
250
+ a consequence of the `.pgpass` file format used by PostgreSQL.
251
+
211
252
  Then you can capture a snapshot of your database. You can also restore
212
253
  it using this tool.
213
254
 
@@ -311,8 +352,6 @@ executing once a day at 2am:
311
352
  0 2 * * * path/to/script > /dev/null
312
353
 
313
354
 
314
- # Contributing
315
-
316
355
  ### Making a release
317
356
 
318
357
  One of the following, like patch. This will create a git commit.
@@ -324,22 +363,16 @@ One of the following, like patch. This will create a git commit.
324
363
  Create the gem spec.
325
364
 
326
365
  bundle exec rake gemspec:generate
327
- git add -A
328
- git commit -m "Generated gemspec for version 0.1.4"
329
-
330
- Make a gem release. This will generate a commit and a tag for v0.1.2.
366
+ git commit -am "Generated gemspec for version 0.1.4"
331
367
 
332
- bundle exec rake release
368
+ You can `rake release`... I think that deploys
369
+ the gem to Rubygems.
333
370
 
334
- You may also build a raw gem for testing installs without
335
- releasing to Rubygems publically. Use scp
336
- to move this .gem file to a machine you want to install
337
- on:
371
+ You may build a local gem:
338
372
 
339
373
  bundle exec rake build
340
374
 
341
- If a gem is already built, you can remove it with
342
- something like the following:
375
+ And remove it:
343
376
 
344
377
  rm pkg/cknife-0.1.6.gem
345
378
 
@@ -347,9 +380,12 @@ something like the following:
347
380
 
348
381
  You can uncommente the 'gem cknife' line in the Gemfile.
349
382
 
350
- This allows you to test your changes without having to run `rake
351
- install` if you don't want to, after every file edit.
383
+ Then you can invoke the executables as you work on them.
384
+
385
+ Do not generate the .gemspec with this line uncommented, or
386
+ you'll create a self-dependency in this gem.
387
+
388
+ Run bundle after uncommenting the line then use `bundle exec cmd`
389
+ to invoke a given command named "cmd".
352
390
 
353
- Don't generate the gemspec with this on, though, or it'll be a self-dependency
354
- which isn't really what we want.
355
391
 
data/Rakefile CHANGED
@@ -15,12 +15,12 @@ require 'jeweler'
15
15
  Jeweler::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
17
  gem.name = "cknife"
18
- gem.homepage = "http://github.com/mikedll/cali-army-knife"
19
- gem.license = "MIT"
20
- gem.summary = "Cali Army Knife"
21
- gem.description = "Cali Army Knife, a collection of command line tools, especially for popular API services."
22
- gem.email = "mikedll@mikedll.com"
23
- gem.authors = ["Mike De La Loza"]
18
+ gem.homepage = "http://github.com/mikedll/cknife"
19
+ gem.license = ""
20
+ gem.summary = "CKnife"
21
+ gem.description = "A collection of command line tools, especially for popular API services."
22
+ gem.email = "soymrmike@gmail.com"
23
+ gem.authors = ["Michael Rivera"]
24
24
  # dependencies defined in Gemfile
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new