vlad_freebsd 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/README.txt +57 -0
- data/lib/vlad/freebsd.rb +44 -0
- data/lib/vlad_freebsd.rb +5 -0
- metadata +90 -0
data/History.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
= vlad_freebsd
|
2
|
+
|
3
|
+
* FIX (url)
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
FIX (describe your package)
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* FIX (list of features or problems)
|
12
|
+
|
13
|
+
== SYNOPSIS:
|
14
|
+
|
15
|
+
FIX (code sample of usage)
|
16
|
+
|
17
|
+
== REQUIREMENTS:
|
18
|
+
|
19
|
+
* FIX (list of requirements)
|
20
|
+
|
21
|
+
== INSTALL:
|
22
|
+
|
23
|
+
* FIX (sudo gem install, anything else)
|
24
|
+
|
25
|
+
== DEVELOPERS:
|
26
|
+
|
27
|
+
After checking out the source, run:
|
28
|
+
|
29
|
+
$ rake newb
|
30
|
+
|
31
|
+
This task will install any missing dependencies, run the tests/specs,
|
32
|
+
and generate the RDoc.
|
33
|
+
|
34
|
+
== LICENSE:
|
35
|
+
|
36
|
+
(The MIT License)
|
37
|
+
|
38
|
+
Copyright (c) 2010 FIX
|
39
|
+
|
40
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
41
|
+
a copy of this software and associated documentation files (the
|
42
|
+
'Software'), to deal in the Software without restriction, including
|
43
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
44
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
45
|
+
permit persons to whom the Software is furnished to do so, subject to
|
46
|
+
the following conditions:
|
47
|
+
|
48
|
+
The above copyright notice and this permission notice shall be
|
49
|
+
included in all copies or substantial portions of the Software.
|
50
|
+
|
51
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
52
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
53
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
54
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
55
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
56
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
57
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/vlad/freebsd.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
def upload_pubkey(user, keyfile)
|
2
|
+
run sudo "mkdir -pvm 755 ~#{user}/.ssh"
|
3
|
+
put_template keyfile, '.ssh/authorized_keys', binding
|
4
|
+
run "chown #{user}:#{user} ~#{user}/.authorized_keys"
|
5
|
+
end
|
6
|
+
|
7
|
+
def update_ports
|
8
|
+
sudo "portsnap update"
|
9
|
+
end
|
10
|
+
|
11
|
+
#this is a driver for the pw command. pass arguments in as a hash of k-v. simple flags map to nil.
|
12
|
+
#will only add a user if it doesn't exist
|
13
|
+
def adduser(username, args={})
|
14
|
+
args = { '-s' => '/usr/local/bin/bash', "-c"=>"'service user'", "-n"=>username, "-m"=>nil, '-w'=>'no'}.merge(args)
|
15
|
+
slug = "if [ $(id -u sophia > /dev/null) ];then \n"
|
16
|
+
slug += "pw user add "
|
17
|
+
args.each do |k,v|
|
18
|
+
slug << ' ' << [k,v].join(" ")
|
19
|
+
end
|
20
|
+
puts "running #{slug}"
|
21
|
+
slug += "\nfi"
|
22
|
+
sudo slug
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
def install_port(port)
|
27
|
+
commands = []
|
28
|
+
commands << "portinstall --batch #{port} "
|
29
|
+
yield commands if block_given?
|
30
|
+
commands = commands.join(" && ")
|
31
|
+
puts "Running [#{commands}]"
|
32
|
+
commands.each {|x| sudo x}
|
33
|
+
end
|
34
|
+
|
35
|
+
def put_template(tmpl, dest, b)
|
36
|
+
tmpl = File.read(tmpl)
|
37
|
+
buf = ERB.new(tmpl).result(b)
|
38
|
+
put './tmpl', application do
|
39
|
+
buf
|
40
|
+
end
|
41
|
+
sudo "cp ./tmpl #{dest}"
|
42
|
+
end
|
43
|
+
|
44
|
+
|
data/lib/vlad_freebsd.rb
ADDED
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vlad_freebsd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- McClain Looney
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-04-27 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: vlad
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: gemcutter
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.3.0
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: hoe
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.5.0
|
44
|
+
version:
|
45
|
+
description: FIX (describe your package)
|
46
|
+
email:
|
47
|
+
- m@loonsoft.com
|
48
|
+
executables: []
|
49
|
+
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- History.txt
|
54
|
+
- README.txt
|
55
|
+
files:
|
56
|
+
- History.txt
|
57
|
+
- README.txt
|
58
|
+
- lib/vlad_freebsd.rb
|
59
|
+
- lib/vlad/freebsd.rb
|
60
|
+
has_rdoc: true
|
61
|
+
homepage: http://www.bitbucket.org/mml/vlad_freebsd
|
62
|
+
licenses: []
|
63
|
+
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options:
|
66
|
+
- --main
|
67
|
+
- README.txt
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
version:
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
81
|
+
version:
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project: vlad_freebsd
|
85
|
+
rubygems_version: 1.3.5
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: FIX (describe your package)
|
89
|
+
test_files: []
|
90
|
+
|