Random Noise

cat /dev/random >> /dev/dsp

Archive for August 2007

Creating a VMWare Image without VMWare Server

leave a comment »

Yesterday one of my friend wanted to know how to create a VMWare image. I thought it might be a good idea to write a post about this on my blog. Even though there are many blogs out there that have already explained how to make a VMWare image, it will be easy for me to just point my friends to this URL next time someone asks me about it.

The easiest way to create a vm image is to use easyvmx. Just start by creating a .vmx configuration file by simply filling out this online configuration form:

http://www.easyvmx.com/easyvmx.shtml.
Today we will create gentoo linux vm.

1. Baisc Info:
Remember that if you are going to use VMWare Player, you must specify
# of CPUs = 1, as VMWare Player does not support more than 1 CPU. The Guest OS can be a 64bit machine as well, but I haven’t tested it yet though.

2. Network configuration:
I have tried Intel Pro/1000 and vlance with NAT and Bridged network and they both seem to work fine.

3. Disk configuration: I generally use 10GB for my VM because nowadays 4.7GB seems little less for modern OSes. I have also read that making the disk SCSI type will improve your VMWare disk performance.

4. CD ROM: You will probably need two of them one for mounting/loading ISO images and another for loading physical CDs/DVDs. NOTE: When using VMWre player, you’ll need to change the ISO image in the configuration file manually to load an ISO image. For example you can set the ISO to install-x86-minimal-2007.0-r1.iso and boot the vm to install gentoo from this iso.The physical cdrom is used to load CDs from your existing cdrom/dvd drive.

You can leave rest of the options un-touched. and Click the “Create Virtual Machine” button. Download the configuration that we created here:

http://www.mediafire.com/?5f9d3711d6m (Gentoo_2007.zip, 77Kb).

Also, for people who don’t want to go through all this configuration and then installing the OS itself, there’s a completely configured Gentoo 2007.0 vmware image ready to use. You can download it from here:

http://thepiratebay.org/tor/3723438/Gentoo_2007.0_VMWare_Image(gentoo.zip, 1.95 GB torrent).

Once you download either of the above you must either get theVMWare Player (free version) or the VMWare Server or VMWare Workstation (retail versions can create, manage, compress vmware images and much more). For a n00b I would recommend to get the VMWare Player. Then open the .vmx file from the zip file above using VMWare Player (or VmWare Server).

Written by Vivek Unune

August 17, 2007 at 3:19 pm

Signing a JAR file with .spc and .pvk file

with 2 comments

0. You must have a .spc(Certificate) file and a .pvk(Key) file

1. Download pvkimprt.exe from here.

And yes don’t forget to install the downloaded exe!!

2. To generate a .pfx file run:

pvkimprt -PFX myspcfile.spc mypvkfile.pvk

type in the password and give a pathname

3. Import this file from Firefox

4. Export the certificate from Firefox to a .p12 file

5. This file can be used with jarsigner

6. We also need to know the alias of the .p12 file, so copy the .p12 file to the Java bin directory and run:

keytool -list -storetype pkcs12 -keystore mycert-p12.p12

7. Enter the password

8. Then you will see output like this:

Keystore type: pkcs12

Keystore provider: SunJSSE

Your keystore contains 1 entry

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx, Aug 13, 2007, keyEntry,

Certificate fingerprint (MD5):

hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh

9. The xxxx-xxx… number is the alias for the key

10. To sign a jar run:
jarsigner -storetype pkcs12 -keystore mycert-p12.p12 myjar.jar \
“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx”

Update 18th April 2008:

You can also sign the jar using pkcs12 or .p12 certificate using this:

jarsigner -keystore mycert.p12 -storepass mystorepass -keypass mykeypass -storetype “pkcs12” -signedjar myjar-signed.jar myjar.jar “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx”

To verify your signed jar do:

jarsigner -verify -verbose -keystore mycert.p12 -storepass mystorepass -keypass mykeypass -storetype “pkcs12” myjar-signed.jar

Written by Vivek Unune

August 14, 2007 at 2:58 am

Posted in Java

Tagged with , , ,