About a week ago, I decided to format the whole harddisk and start anew.
Of course, this meant losing the triple-boot configuration and Wubi along with it. I was fine with losing the windows, but didn’t want to lose the Wubi Ubuntu installation.
April 11, 2010 at 1:34 pm (Linux, Linux Distros)
Tags: /dev/disk/by-uuid, alert, backup, bcdedit, boot, boot.ini, configuration, distro, does not exist, Linux, manager, mbr, partition, problem, restore, root, ubuntu, uuid, wubi, wubildr
About a week ago, I decided to format the whole harddisk and start anew.
Of course, this meant losing the triple-boot configuration and Wubi along with it. I was fine with losing the windows, but didn’t want to lose the Wubi Ubuntu installation.
July 19, 2009 at 11:05 am (Java, Linux)
Tags: code, command, command line, console, exec, input stream, Java, jstack, Linux, output, pid, process, runtime, sample, stack trace, thread dump
Of course; I was trying to get a thread dump using jstack here. You would need to change the command that Runtime.exec() executes to your liking.
Process threadDump=Runtime.getRuntime().exec("jstack -l "+pid);
BufferedReader br=new BufferedReader(new InputStreamReader(threadDump.getInputStream()));
while(true)
{
String line=br.readLine();
if(line==null)
break;
else {
//Do whatever you want
}
July 19, 2009 at 11:00 am (Java, Linux)
Tags: *nix, application, code, command, echo, exec, get, id, input stream, Java, Linux, pid, process, runtime, sample, shell, unix
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
e2.printStackTrace();
}