Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
`rm accounts/*`
ips = File.readlines('ips.txt')
accounts = File.readlines('accounts.txt')
mapping = {}
accounts.each_with_index.map do |subdomain, i|
ip = ips[i % ips.size].strip
mapping[ip] ||= []
mapping[ip] << subdomain.strip
end
mapping.each do |ip, accounts|
File.open("accounts/#{ip}.txt",'w'){|f| f.write accounts * "\n" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment