Created
June 5, 2019 11:17
-
-
Save ik5/4b02d3560f743bb89c0c15506daafd76 to your computer and use it in GitHub Desktop.
short script to convert 32 bit integer to IPv4
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'ipaddr' | |
ARGV.each do |int| | |
puts "#{int} = #{IPAddr.new(int.to_i, Socket::AF_INET).to_s}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment