Avoid Comcast DNS Hijacking in Ubuntu
Recently I switched to Comcast from AT&T because of an interesting deal on internet. Today I was on my Ubuntu machine in a different network and ran into the issue of not being able to connect to internet. After doing bit of looking into I figured that DNS is not working properly. I was getting a reply that had "hsd1.in.comcast.net" when I tried to do a host lookup (e.g. host -a google.com).Then when I opened the /etc/resolv.conf I found that Comcast has inserted its nameservers into that and after removing those entries and setting the nameserver to Google's 8.8.8.8 I was able to connect and browse as usual.
Hope this helps someone in a similar situation!
Get PID from Java
This may not be elegant, but it works !public static String getPid() throws IOException {
byte[] bo = new byte[100];
String[] cmd = {"bash", "-c", "echo $PPID"};
Process p = Runtime.getRuntime().exec(cmd);
p.getInputStream().read(bo);
return new String(bo);
}
Subscribe to:
Posts
(
Atom
)
No comments :
Post a Comment