Skip to content

Instantly share code, notes, and snippets.

@MacoTasu
Last active December 14, 2016 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MacoTasu/0f40c86e47f14cc5310576be3f2e46f4 to your computer and use it in GitHub Desktop.
Save MacoTasu/0f40c86e47f14cc5310576be3f2e46f4 to your computer and use it in GitHub Desktop.
githubに登録しているpubkeyをauthrized_keysにひたすら入れる君
#! /usr/bin/env ruby
require 'net/http'
require 'fileutils'
users = ["MacoTasu"] #ここにユーザを追加してね
users.each do |user|
uri = URI.parse("https://github.com/#{user}.keys")
File.open('authrized_keys','a') do |file|
Net::HTTP.get(uri).split("\n").each do |key|
file.puts("#{key}")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment