How to Create A Bootable Windows 7 Installation USB from Linux

Thanks to Gunthers at serverfault, I was able to create a USB and start the Startup Repair tool from there to repair my Windows 7 boot.

Probably the only thing you need to know is how to make the USB bootable as I assume you know that you need an NTFS partition on the USB including the installation files (copied over from a DVD or a backup ISO file).

Well, after all that pretty regular stuff, you need to grab ms-sys from here and install it to be able to write Microsoft compatible boot records. (It could also exist in your repositories, so do a check first if you want with your favorite package management tool. (e.g. apt-get, aptitude, yum etc.)

To write a Windows 7 MBR onto the USB device; just do a

Read the rest of this entry »

Advertisements

How to backup/restore a Wubi installation

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.

Read the rest of this entry »

How to get the output of a console application from Java

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
}

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
e2.printStackTrace();
}

Oracle OCI8 Database Connection Problem #2 [Linux]

Hello folks,

Recently, I had another problem connecting to an Oracle 10g R2 database with the Oracle Call Interface. Well, this was not about the driver actually. Having passed 2 weeks from my first problem, this time I was deploying the servlet, Tomcat 6 and Oracle 10g R2 to a OpenSUSE 10.3 machine. It still was stopping at this line:

connection = DriverManager.getConnection(url, username, password);

Read the rest of this entry »

Pardus 2008

Pardus 2008 is out! The turkish linux distro has released a new version on June 27!

I haven’t had a chance to try it out yet; but I surely downloaded it 🙂

Website: http://www.pardus.org.tr/

Download: http://www.pardus.org.tr/indir.html