Skip to content

Instantly share code, notes, and snippets.

@Thamrius
Thamrius / ping.rb
Created February 4, 2019 04:12
ruby ping-sweep
#!/usr/bin/env ruby
finished = []
ips = []
range = 1..254
range.each do |i|
ip_address = "10.11.1.#{i}"
Thread.new do
`ping -q -c1 -W1 #{ip_address}`.split(/\n+/)[2].split(/,\s*/)[1].to_i > 0 and ips << ip_address

Keybase proof

I hereby claim:

  • I am thamrius on github.
  • I am thamrius (https://keybase.io/thamrius) on keybase.
  • I have a public key ASDUEZF6651N19YlDwg-jZQkn0kAooQZHb9NGWOlk_onGwo

To claim this, I am signing this object: