beautiful_public_key 0.0.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.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in beautiful_public_key.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Gabe Kopley
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ # BeautifulPublicKey
2
+
3
+ ## Find a beautiful public key
4
+
5
+ Script repeatedly generates SSH keypairs until you find one whose public key randomart you like
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'beautiful_public_key'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install beautiful_public_key
20
+
21
+ ## Usage
22
+
23
+ Run binary and follow instructions a la ssh-keygen
24
+
25
+ $ bpk
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = "beautiful_public_key"
5
+ gem.version = "0.0.1"
6
+ gem.authors = ["Gabe Kopley"]
7
+ gem.email = ["gabe@coshx.com"]
8
+ gem.description = %q{Find a beautiful public key}
9
+ gem.summary = %q{Script repeatedly generates SSH keypairs until you find one whose public key randomart you like}
10
+ gem.homepage = ""
11
+
12
+ gem.files = `git ls-files`.split($/)
13
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
15
+ gem.require_paths = ["lib"]
16
+
17
+ gem.add_dependency 'sshkey', '1.4.0'
18
+ gem.add_dependency 'highline'
19
+ end
data/bin/bpk ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "sshkey"
4
+ require "highline/import"
5
+
6
+ puts "Generating public/private rsa key pair."
7
+ default_file_name = File.join(Dir.home, ".ssh", "id_rsa")
8
+ file_name = ask("Enter file in which to save the key: ") do |q|
9
+ q.default = default_file_name
10
+ end
11
+
12
+ passphrase = ask("Enter passphrase (empty for no passphrase): ") do |q|
13
+ q.echo = false
14
+ q.verify_match = true
15
+ q.gather = {:password => "", :password_confirmation => ""}
16
+ q.responses[:ask_on_error] = ""
17
+ end
18
+
19
+ unless passphrase.length == 0 || passphrase.length > 4
20
+ puts "passphrase too short: have #{passphrase.length} bytes, need > 4"
21
+ puts "Saving the key failed: #{file_name}."
22
+ exit(-1)
23
+ end
24
+
25
+ file_name = File.expand_path(file_name)
26
+
27
+ opts = {}
28
+ opts.merge!(:passphrase => passphrase) if passphrase.length > 0
29
+ begin
30
+ k = SSHKey.generate(opts)
31
+ puts k.randomart
32
+ char = ask('Press "y" if happy, any other key to try again: ') do |q|
33
+ q.character = true
34
+ end
35
+ end while char != 'y'
36
+
37
+ File.open(file_name, 'w') {|f| f.write(k.encrypted_private_key) }
38
+ File.open(file_name+".pub", 'w') {|f| f.write(k.ssh_public_key) }
39
+
40
+ puts "Your identification has been saved in #{file_name}."
41
+ puts "Your public key has been saved in #{file_name}.pub."
42
+ puts "The key fingerprint is:"
43
+ puts k.md5_fingerprint
44
+ puts "The key's randomart image is:"
45
+ puts k.randomart
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: beautiful_public_key
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Gabe Kopley
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sshkey
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.4.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - '='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.4.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: highline
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'
46
+ description: Find a beautiful public key
47
+ email:
48
+ - gabe@coshx.com
49
+ executables:
50
+ - bpk
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - Rakefile
59
+ - beautiful_public_key.gemspec
60
+ - bin/bpk
61
+ homepage: ''
62
+ licenses: []
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 1.8.24
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: Script repeatedly generates SSH keypairs until you find one whose public
85
+ key randomart you like
86
+ test_files: []