Last active
September 2, 2016 05:52
-
-
Save AbdallaZaki/e51d23ff016c53bd9df4ae5dd5b6fcbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'securerandom' | |
def get_ips ips_file | |
content="" | |
File.open(ips_file,"r") {|file| content = file.read } | |
result="" | |
content.scan(/(((([0-9]{1,3}\.){3}[0-9])|(([0-9a-f]{1,4}\:){3}\:))\/[0-9]{2})/) { |match| result += "#{match[0]}\n" } | |
File.open("#{ips_file}-#{SecureRandom.uuid}.txt","w") {|file| file.write(result)} | |
end | |
get_ips ARGV[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool!