[Privacy] Disable transmission of the referer header in Firefox

You know what the HTTP referer(yes, it is misspelled) header is, right?

It contains the website which you have used to arrive to a specific website/webserver.

Let’s exemplify this:

Read the rest of this entry »

How to get the process id after running an application from Java under Linux

Use the following sample code to get the pid(process id) on *nix variants, after running it as a command from Java using Runtime.exec() .

The command variable, in my case, was running another Java application.

try {

Process  process=Runtime.getRuntime().exec(new String [] {"sh","-c",command+"  &  echo $!"} );
BufferedReader br=new BufferedReader(new InputStreamReader(process.getInputStream()));

String ps=br.readLine();
int pid=Integer.valueOf(ps);
} catch (IOException e2) {
// TODO Auto-generated catch block