A simple Java program to ping multiple IP addresses simultaneously

I wrote a simple Java program to ping multiple IP addresses / host names at the same time.

It’s a multi-threaded program involves the Windows system’s “cmd” and “ping” commands to complete the ping tasks.

How to use it?
1. Download the compiled Java program from my SkyDrive: Download SimpleMultiplePing
2. Unzip and update ip-list.txt with your IP addresses or host names
3. Run the Java program by invoking command: java SimpleMultiplePing
* Please note you need Java runtime to run this program

Here is the screen that I ran it in Eclipse
A simple Java program to ping multiple IP addresses simultaneously

Java source code:

* A simple Java program to ping multiple IP addresses simultaneously
* File: SimpleMultiplePing.java
* Author: Colin - http://www.colinblog.com
* Date: Feb 2, 2014
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

public class SimpleMultiplePing implements Runnable {
private String addr;

public static void main(String[] args) throws Exception{
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream file = classLoader.getResourceAsStream("ip-list.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(file));
String line;
while ((line = br.readLine()) != null) {
new Thread(new SimpleMultiplePing(line)).start();

public SimpleMultiplePing(String address) {
addr = address;

public void run() {
StringBuffer buf = new StringBuffer(String.format("%-15s", addr) + "\t");
String s;
Process process;
try {
process = Runtime.getRuntime().exec("cmd /c " + "ping " + addr);
BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
while ((s = br.readLine()) != null) {
if (s.indexOf("Average") != -1)

} catch (Exception ex) {

Install HTC Desire ADB driver for Windows 8

I couldn’t find the official / formal HTC Desire ADB driver for Windows 8. But there is a way to re-use the Google USB Driver which comes along with the Android SDK.

Here are the steps.

1. To re-use the Google USB Driver, you need to download the Android SDK 1st, and update the android_winusb.inf file which is located in the Android SDK e.g. \adt-bundle-windows-x86_64\sdk\extras\google\usb_driver

Backup and open the file, and then add below code to the file in the [Google.NTamd64] section

;HTC Desire
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C87&MI_01

Reference: http://ailoo.net/2011/06/htc-desire-windows-7-64-bit-adb-driver/

2. Disable Driver Signature Enforcement in Windows 8, otherwise you won’t be able to install the amended driver.

From the Metro Start Screen, open Settings (move your mouse to the bottom-right-corner of the screen and wait for the pop-out bar to appear, then click the Gear icon).
Click ‘Change PC Settings’.
Click ‘General’.
Scroll down, and click ‘Restart now’ under ‘Advanced startup’.
Wait a bit.
Click ‘Troubleshoot’.
Click ‘Advanced Options’
Click ‘Windows Startup Settings’
Click Restart.

Reference: http://forum.xda-developers.com/showthread.php?t=1766220

3. Install the driver from the Device Manager (Tip: press Win+X to launch the menu)

Travel in Sabah Malaysia – Mobile phone and internet service

Travel time:Nov 6~11, 2011
People: 6
City: Kota Kinabalu (KK)

There were no problems with the telephone calls, but problems with the internet surfing during my travel in Sahab. So here is my experience for your reference.

Mobile service providers in Malaysia
There are several mobile service providers in Malaysia, and general you can find the advertisements of Maxis, Celcom, Digi, U Mobile, Tune Talk in KK. I tried 2 SIM cards in Sabah, at first it’s a Tune Talk card, later I replaced it with a Digi card.

Both Tune Talk and Digi have the WCDMA networks, so my HTC Desire was working fine with these two networks, “3G”, “H”(HSDPA) icons were displayed in my phone.

Your passport is required to register the SIM card.

The prepaid SIM card for Malaysia with a world cell phone is the most convenient and economical solution for staying in touch while in Malaysia. All incoming calls while in Malaysia are FREE, regardless of where they originate.

Prices to buy the cards:
Tune Talk: RM 5.00 (1RM ~= 0.32 USD), with RM 2.00 available after activation
Digi: RM 8.50, with RM 5.00 available after activation.

IDD call rate:
Tune Talk: RM 0.16/min to USA
Digi: RM 0.18/min to USA

Tune Talk: Thought “H”(HSDPA) was displayed in my phone, but actually it’s too slow to open any web pages. SO, DON’T BUY THE TUNE TALK IF YOU NEED TO USE THE INTERNET.

Digi: It’s much faster, the speed is about 50KB/s. To use its 3G internet service, it’s strongly suggested to subscribe its weekly 250MB package at RM15.

Where to buy the SIM cards and Top up
Tune Talk: You’re able to buy Tune Talk cards when you’re on the Air Asia’s plane, and in the KK airport (don’t be too late, the shop closes early). You can top up your card easily in 7-11s, the minimum top up amount is RM10.00

DiGi: You can buy DiGi cards and top up easily in many shops in KK, the minimum top up amount is RM5.00.

About WiFi:
I lived in 2 hotels in KK, both had free wifi, but unstable, and the speed was slow.

About smart phone internet sharing
Many Android phones and iPhone can share the internet connections to others. With the DiGi card I shared the internet connections to my friends during my travel in Sabah.

Jetty 7 – How to enable aliases for static content

I was looking for a simplest way to setup an HTTP server for publishing some static content, then I found jetty.

I can just start the jetty, and simply put my static content into the /javadoc folder, and then it can be viewed through a browser.

But I encounter a problem that the URL is case sensitive. That means if the file is test.pdf, and I cannot find it via TEST.PDF, but I really need it.

After searching in goolge for a long time, I find that most of the articles about jetty aliases are out-dated, they are not suitable for jetty 7.

But finally, I found the answer from jetty 7’s javadoc – ResourceHandler.setAliases(), and it redirected me to ContextHandler.isAliases()

Here is the update I made to make it work:
1. Open the javadoc.xml in the contexts folder
2. Add below line into the <Configure>:

<Set name=”aliases”>true</Set>

3. Start jetty