Skip to content

Instantly share code, notes, and snippets.

@octosteve
Created September 22, 2010 21:39
Show Gist options
  • Save octosteve/592635 to your computer and use it in GitHub Desktop.
Save octosteve/592635 to your computer and use it in GitHub Desktop.
stdin, stdout, stderr, pid = Open4::popen4 "pgp --key-list"
pgps = stderr.select {|x| x.chomp if x =~ /0x/ }
# to parse Key list
@orgs = pgps.inject([]){|enum, pgp| enum << {:hex_id =>pgp[29..38], :org_id => pgp[40..pgp.length].chomp} }
@orgs.each.with_index{ |org, index| puts "#{index}. #{org[:hex_id]} belongs to #{org[:org_id]}" }
@hamin
Copy link

hamin commented Sep 22, 2010

Alright... that shit is like money in the bank ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment