netid-tools 0.3.0 → 0.3.1
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.
- data/Gemfile +1 -1
- data/LICENSE.txt +2 -19
- data/README.md +135 -5
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/netid-tools.gemspec +75 -0
- metadata +39 -4
- data/Gemfile.lock +0 -46
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,20 +1,3 @@
|
|
1
|
-
|
1
|
+
This software is licensed under the Apache License, Version 2.0.
|
2
2
|
|
3
|
-
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
3
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
data/README.md
CHANGED
@@ -1,6 +1,136 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
NetID Tools
|
2
|
+
===========
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
NetID Tools is a Ruby Gem that contains various methods for supporting Uniform Access computing at the University of Washington. These are mainly methods that I've found useful to create during the course of my job, but may be useful to others as well.
|
5
|
+
|
6
|
+
Currently the focus is on finding and displaying information on any MySQL database server(s) that users may be running, as well as highlight potential quota issues.
|
7
|
+
|
8
|
+
## Usage Notes
|
9
|
+
|
10
|
+
* Using keybased SSH authentication is highly recommended, both from your system->UA, and for UA->UA.
|
11
|
+
* You may need membership of certain Unix Groups in order to run some of these checks.
|
12
|
+
|
13
|
+
## Dependencies
|
14
|
+
|
15
|
+
* Ruby 1.9
|
16
|
+
* Nokogiri
|
17
|
+
* Colored
|
18
|
+
|
19
|
+
Executables
|
20
|
+
===========
|
21
|
+
|
22
|
+
`ua_check` is provided as an included executable.
|
23
|
+
|
24
|
+
## Example
|
25
|
+
|
26
|
+
nikky@uvb76:~/Repositories/www ☿ on default at tip % ua_check nikky
|
27
|
+
Running UA Check for NetID nikky on behalf of nikky
|
28
|
+
|
29
|
+
MySQLd detected on ovid02.u.washington.edu:5280
|
30
|
+
/ov03/d20/nikky
|
31
|
+
|
32
|
+
Disk quotas for nikky (uid 247520):
|
33
|
+
Filesystem Usage Quota Limit Grace Files Limit
|
34
|
+
/cg32a 15.574 5120.000 105120.0 219 10000
|
35
|
+
/da21 17.523 1937.254 5370.0 1535 10000
|
36
|
+
etc
|
37
|
+
|
38
|
+
Methods
|
39
|
+
=======
|
40
|
+
|
41
|
+
## Netid#validate_netid?(netid)
|
42
|
+
|
43
|
+
### What it does
|
44
|
+
|
45
|
+
This class method will return a true/false depending on if a given string could potentially be a NetID. It does not check to see if the NetID exists; only if a NetID has a valid structure. Namely:
|
46
|
+
|
47
|
+
* 1-8 Characters in length
|
48
|
+
* First character is *not* a number
|
49
|
+
* Only a word characters [a-zA-Z0-9]
|
50
|
+
|
51
|
+
### Example
|
52
|
+
|
53
|
+
>> require 'netid-tools'
|
54
|
+
=> true
|
55
|
+
>> Netid.validate_netid?("nikky")
|
56
|
+
=> true
|
57
|
+
>> Netid.validate_netid?("1nikky")
|
58
|
+
=> false
|
59
|
+
>> Netid.validate_netid?("1nikky111")
|
60
|
+
=> false
|
61
|
+
>> Netid.validate_netid?("nikky@1")
|
62
|
+
=> false
|
63
|
+
|
64
|
+
## Netid#check_for_mysql_presence(host,user,system_user)
|
65
|
+
|
66
|
+
### What it does
|
67
|
+
|
68
|
+
This class method will check to see if a specific NetID is running a MySQL instance on a specified host. It will return false if no MySQL server is found, and return [host,port] if true.
|
69
|
+
|
70
|
+
### Method variables
|
71
|
+
|
72
|
+
#### host
|
73
|
+
|
74
|
+
The FQDN of the server you want to check for MySQL
|
75
|
+
|
76
|
+
#### user
|
77
|
+
|
78
|
+
The NetID you want to check
|
79
|
+
|
80
|
+
#### system_user
|
81
|
+
|
82
|
+
*Your* NetID, required for login to the host.
|
83
|
+
|
84
|
+
### Example
|
85
|
+
|
86
|
+
>> Netid.check_for_mysql_presence("ovid02.u.washington.edu","nikky","nikky")
|
87
|
+
=> ["ovid02.u.washington.edu", "5280"]
|
88
|
+
|
89
|
+
## Netid#check_for_localhome(user,system_user)
|
90
|
+
|
91
|
+
### What it does
|
92
|
+
|
93
|
+
Checks to see if a user has a localhome, and if they do, return the location.
|
94
|
+
|
95
|
+
### Method variables
|
96
|
+
|
97
|
+
#### user
|
98
|
+
|
99
|
+
The NetID you want to check
|
100
|
+
|
101
|
+
#### system_user
|
102
|
+
|
103
|
+
*Your* NetID, required for login to the host.
|
104
|
+
|
105
|
+
### Example
|
106
|
+
|
107
|
+
>> Netid.check_for_localhome("nikky","nikky")
|
108
|
+
=> "/ov03/d20/nikky"
|
109
|
+
|
110
|
+
## Netid#quota_check(user,system_user)
|
111
|
+
|
112
|
+
### What it does
|
113
|
+
|
114
|
+
Spits out various quota information, and highlights a line in red if a user is over quota. This writes directly to stdout.
|
115
|
+
|
116
|
+
### Method variables
|
117
|
+
|
118
|
+
#### user
|
119
|
+
|
120
|
+
The NetID you want to check
|
121
|
+
|
122
|
+
#### system_user
|
123
|
+
|
124
|
+
*Your* NetID, required for login to the host.
|
125
|
+
|
126
|
+
Version History
|
127
|
+
===============
|
128
|
+
|
129
|
+
## 0.3.1
|
130
|
+
|
131
|
+
* Initial documented release
|
132
|
+
* Swich to Apache License
|
133
|
+
|
134
|
+
## 0.3.0
|
135
|
+
|
136
|
+
Initial release
|
data/Rakefile
CHANGED
@@ -16,13 +16,13 @@ Jeweler::Tasks.new do |gem|
|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = "netid-tools"
|
18
18
|
gem.homepage = "http://github.com/allynfolksjr/netid-tools"
|
19
|
-
gem.license = "
|
19
|
+
gem.license = "Apache License, Version 2.0"
|
20
20
|
gem.summary = %Q{Gem with various methods to support UW NetIDs}
|
21
21
|
gem.description = %Q{Gem with various methods to support UW NetIDs}
|
22
22
|
gem.email = "nikky@uw.edu"
|
23
23
|
gem.authors = ["Nikky Southerland"]
|
24
24
|
gem.add_dependency 'nokogiri'
|
25
|
-
|
25
|
+
gem.add_dependency 'colored'
|
26
26
|
end
|
27
27
|
Jeweler::RubygemsDotOrgTasks.new
|
28
28
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/netid-tools.gemspec
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "netid-tools"
|
8
|
+
s.version = "0.3.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Nikky Southerland"]
|
12
|
+
s.date = "2012-12-13"
|
13
|
+
s.description = "Gem with various methods to support UW NetIDs"
|
14
|
+
s.email = "nikky@uw.edu"
|
15
|
+
s.executables = ["ua_check"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE.txt",
|
18
|
+
"README.md"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.md",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"bin/ua_check",
|
28
|
+
"lib/netid-tools.rb",
|
29
|
+
"netid-tools.gemspec",
|
30
|
+
"test/helper.rb",
|
31
|
+
"test/test_netid-tools.rb"
|
32
|
+
]
|
33
|
+
s.homepage = "http://github.com/allynfolksjr/netid-tools"
|
34
|
+
s.licenses = ["Apache License, Version 2.0"]
|
35
|
+
s.require_paths = ["lib"]
|
36
|
+
s.rubygems_version = "1.8.24"
|
37
|
+
s.summary = "Gem with various methods to support UW NetIDs"
|
38
|
+
|
39
|
+
if s.respond_to? :specification_version then
|
40
|
+
s.specification_version = 3
|
41
|
+
|
42
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
43
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
44
|
+
s.add_runtime_dependency(%q<colored>, [">= 0"])
|
45
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
46
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
47
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
49
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
50
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
51
|
+
s.add_runtime_dependency(%q<colored>, [">= 0"])
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
54
|
+
s.add_dependency(%q<colored>, [">= 0"])
|
55
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
56
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
57
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
58
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
59
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
60
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
61
|
+
s.add_dependency(%q<colored>, [">= 0"])
|
62
|
+
end
|
63
|
+
else
|
64
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
65
|
+
s.add_dependency(%q<colored>, [">= 0"])
|
66
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
67
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
68
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
69
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
70
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
71
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
72
|
+
s.add_dependency(%q<colored>, [">= 0"])
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netid-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: colored
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
30
46
|
- !ruby/object:Gem::Dependency
|
31
47
|
name: shoulda
|
32
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,6 +139,22 @@ dependencies:
|
|
123
139
|
- - ! '>='
|
124
140
|
- !ruby/object:Gem::Version
|
125
141
|
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: colored
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
126
158
|
description: Gem with various methods to support UW NetIDs
|
127
159
|
email: nikky@uw.edu
|
128
160
|
executables:
|
@@ -134,18 +166,18 @@ extra_rdoc_files:
|
|
134
166
|
files:
|
135
167
|
- .document
|
136
168
|
- Gemfile
|
137
|
-
- Gemfile.lock
|
138
169
|
- LICENSE.txt
|
139
170
|
- README.md
|
140
171
|
- Rakefile
|
141
172
|
- VERSION
|
142
173
|
- bin/ua_check
|
143
174
|
- lib/netid-tools.rb
|
175
|
+
- netid-tools.gemspec
|
144
176
|
- test/helper.rb
|
145
177
|
- test/test_netid-tools.rb
|
146
178
|
homepage: http://github.com/allynfolksjr/netid-tools
|
147
179
|
licenses:
|
148
|
-
-
|
180
|
+
- Apache License, Version 2.0
|
149
181
|
post_install_message:
|
150
182
|
rdoc_options: []
|
151
183
|
require_paths:
|
@@ -156,6 +188,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
188
|
- - ! '>='
|
157
189
|
- !ruby/object:Gem::Version
|
158
190
|
version: '0'
|
191
|
+
segments:
|
192
|
+
- 0
|
193
|
+
hash: 1235800762409252497
|
159
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
195
|
none: false
|
161
196
|
requirements:
|
data/Gemfile.lock
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
activesupport (3.2.9)
|
5
|
-
i18n (~> 0.6)
|
6
|
-
multi_json (~> 1.0)
|
7
|
-
bourne (1.1.2)
|
8
|
-
mocha (= 0.10.5)
|
9
|
-
git (1.2.5)
|
10
|
-
i18n (0.6.1)
|
11
|
-
jeweler (1.8.4)
|
12
|
-
bundler (~> 1.0)
|
13
|
-
git (>= 1.2.5)
|
14
|
-
rake
|
15
|
-
rdoc
|
16
|
-
json (1.7.5)
|
17
|
-
metaclass (0.0.1)
|
18
|
-
mocha (0.10.5)
|
19
|
-
metaclass (~> 0.0.1)
|
20
|
-
multi_json (1.5.0)
|
21
|
-
nokogiri (1.5.5)
|
22
|
-
rake (10.0.2)
|
23
|
-
rdoc (3.12)
|
24
|
-
json (~> 1.4)
|
25
|
-
shoulda (3.3.2)
|
26
|
-
shoulda-context (~> 1.0.1)
|
27
|
-
shoulda-matchers (~> 1.4.1)
|
28
|
-
shoulda-context (1.0.1)
|
29
|
-
shoulda-matchers (1.4.2)
|
30
|
-
activesupport (>= 3.0.0)
|
31
|
-
bourne (~> 1.1.2)
|
32
|
-
simplecov (0.7.1)
|
33
|
-
multi_json (~> 1.0)
|
34
|
-
simplecov-html (~> 0.7.1)
|
35
|
-
simplecov-html (0.7.1)
|
36
|
-
|
37
|
-
PLATFORMS
|
38
|
-
ruby
|
39
|
-
|
40
|
-
DEPENDENCIES
|
41
|
-
bundler
|
42
|
-
jeweler (~> 1.8.4)
|
43
|
-
nokogiri
|
44
|
-
rdoc (~> 3.12)
|
45
|
-
shoulda
|
46
|
-
simplecov
|