Send a ping to each IP on a subnet

Is there a command line based way to send pings to each computer in a subnet? Like for(int i = 1; i < 254; i++) ping(192.168.1.i); to enforce arp resolution? Answer Not all machines have nmap available, but it’s a wonderful tool for any network discovery, and certainly better than iterating through independent ping commands. … Read more

OpenCV – Apply mask to a color image

How can I apply mask to a color image in latest python binding (cv2)? In previous python binding the simplest way was to use cv.Copy e.g. cv.Copy(dst, src, mask) But this function is not available in cv2 binding. Is there any workaround without using boilerplate code? Answer Here, you could use cv2.bitwise_and function if you … Read more

SVG shadow cut off

The SVG I’m working with has a drop shadow via feGaussianBlur filter. The shadow itself is displayed properly, but gets cut off on top and bottom edges. Like so: The SVG in question is: <?xml version=”1.0″ standalone=”no” ?> <!DOCTYPE svg PUBLIC ‘-//W3C//DTD SVG 1.1//EN’ ‘http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd’> <svg height=”600″ version=”1.1″ width=”700″ xml:space=”preserve” xmlns=”http://www.w3.org/2000/svg” xmlns:xlink=”http://www.w3.org/1999/xlink”> <defs/> <filter id=”SVGID_0″> … Read more

PHP: Why isn’t exec() returning output?

I’m writing a PHP script to be used to check for network connections with Linux shell command ping calling it with PHP’s exec(): <?php // Bad IP domain for testing. $domain_bad = “lksjdflksjdf.com”; $ip_address = $domain_bad; exec(“ping -c 1 $domain_bad”, $output, $return_var); var_dump($return_var); echo “return_var is: $return_var” . “\n”; var_dump($output); exit; ?> I’m not getting … Read more

How to ping ubuntu guest on VirtualBox [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 6 years ago. Improve this question I have an VM (VirtualBox) with Ubuntu. Host machine is Windows 7. How can I ping my Ubuntu from … Read more

How to ping an IP address

I am using this part of code to ping an ip address in java but only pinging localhost is successful and for the other hosts the program says the host is unreachable. I disabled my firewall but still having this problem public static void main(String[] args) throws UnknownHostException, IOException { String ipAddress = “127.0.0.1”; InetAddress … Read more

Ping a site in Python?

How do I ping a website or IP address with Python? Answer See this pure Python ping by Matthew Dixon Cowles and Jens Diemer. Also, remember that Python requires root to spawn ICMP (i.e. ping) sockets in linux. import ping, socket try: ping.verbose_ping(‘www.google.com’, count=3) delay = ping.Ping(‘www.wikipedia.org’, timeout=2000).do() except socket.error, e: print “Ping Error:”, e … Read more