<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Derwynd&#039;s Weblog &#187; Uncategorized</title>
	<atom:link href="http://derwynd.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://derwynd.com</link>
	<description>Derwynd&#039;s Weblog</description>
	<lastBuildDate>Thu, 22 Jul 2010 08:01:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='derwynd.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/476e114da567d2d92b9627dab0dd2f97?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Derwynd&#039;s Weblog &#187; Uncategorized</title>
		<link>http://derwynd.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://derwynd.com/osd.xml" title="Derwynd&#039;s Weblog" />
	<atom:link rel='hub' href='http://derwynd.com/?pushpress=hub'/>
		<item>
		<title>Linux disk cache</title>
		<link>http://derwynd.com/2010/07/22/linux-disk-cache/</link>
		<comments>http://derwynd.com/2010/07/22/linux-disk-cache/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 07:02:13 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=94</guid>
		<description><![CDATA[Linux has a supposedly good memory management feature that will use up any &#8220;extra&#8221; RAM you have to cache stuff. Accessed file&#8217;s content gets cached in RAM for fast access eventhough we might not need it later in RAM. $ free -m total used free shared buffers cached Mem: 1504 1490 14 0 24 809 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=94&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Linux has a supposedly good memory management feature that will use up any &#8220;extra&#8221; RAM you have to cache stuff.<br />
Accessed file&#8217;s content gets cached in RAM for fast access eventhough we might not need it later in RAM.</p>
<p>$ free -m<br />
             total       used       free     shared    buffers     cached<br />
Mem:          1504       1490         14          0         24        809<br />
-/+ buffers/cache:        656        848<br />
Swap:            0          0          0</p>
<p>In Linux, you can clear the cache of the memory by using</p>
<p><strong>$ sync; echo 3 &gt; /proc/sys/vm/drop_caches; echo 0 &gt; /proc/sys/vm/drop_caches</strong><br />
or<br />
<strong>$ sync; sysctl -w vm.drop_caches=3; sysctl -w vm.drop_caches=0</strong></p>
<p>$ free -m<br />
             total       used       free     shared    buffers     cached<br />
Mem:          1504        650        854          0          1         67<br />
-/+ buffers/cache:        581        923<br />
Swap:            0          0          0</p>
<p>sync should be run because this is a non-destructive operation, and dirty objects are not freeable. So you run sync in order to make sure all cached objects are freed.</p>
<p>Doing echo 3 is clearing pagecache, dentries and inodes but you could choose <strong>echo 1 to free pagecache</strong> only or <strong>echo 2 to free dentries and inodes.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=94&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/07/22/linux-disk-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>redhat/centos build kernel rpm</title>
		<link>http://derwynd.com/2010/07/17/redhatcentos-build-kernel-rpm/</link>
		<comments>http://derwynd.com/2010/07/17/redhatcentos-build-kernel-rpm/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 08:42:43 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=84</guid>
		<description><![CDATA[Preparing System $ yum install gcc make bison ncurses-devel rpm-build Downloading the kernel source linux-2.6.30.10.tar.gz from http://kernel.org $ nohup wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.10.tar.gz &#38; After you have done it, extract to /usr/src $ tar zxvf linux-2.6.30.10.tar.gz -C /usr/src enter to /usr/src create a symlink to source code called linux, do this: $ cd /usr/src $ ln -sf [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=84&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Preparing System</strong></p>
<p>	$ yum install gcc make bison ncurses-devel rpm-build</p>
<p><strong>Downloading the kernel source</strong> linux-2.6.30.10.tar.gz from http://kernel.org</p>
<p>	$ nohup wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.10.tar.gz  &amp;</p>
<p>After you have done it, extract to /usr/src</p>
<p>	$ tar zxvf linux-2.6.30.10.tar.gz -C /usr/src</p>
<p>enter  to /usr/src<br />
create a symlink to source code called linux, do this:</p>
<p>	$ cd /usr/src<br />
	$ ln -sf linux-2.6.30.10   linux<br />
		drwxr-xr-x  3 root root 4096 Jul 16 14:09 kernels<br />
		lrwxrwxrwx  1 root root   12 Jul 16 16:18 linux -&gt; linux-2.6.31<br />
		drwxr-xr-x 23 root root 4096 Sep 10  2009 linux-2.6.31<br />
		drwxr-xr-x  7 root root 4096 Jul 16 14:11 redhat</p>
<p>Copying the stock config into the dir<br />
	$ cd /usr/src/linux<br />
	$ cp /boot/config-`uname -r` .config</p>
<p><strong>Compiling the kernel</strong><br />
	$ cd /usr/src/linux<br />
	$ make clean<br />
	$ make menuconfig</p>
<p>If you want to add a custom tag that will identify the new kernel (if you want or skip this) , to accomplish this, do that:<br />
I did not enter anything here and skipped this step</p>
<p>    * On initial screen, go to General setup  —&gt;<br />
	    * Select Local version – append to kernel release</p>
<p>┌─────────────── Local version &#8211; append to kernel release ────────────────┐<br />
│  Please enter a string value. Use the  key to move from the input                       |<br />
│  field to the buttons below it.                                                                       │<br />
│ ┌─────────────────────────────────────────────────────────────────────┐<br />
│ │                                                                                                                             │<br />
│ └─────────────────────────────────────────────────────────────────────┘                     </p>
<p>With this done, the resulting kernel.rpm will have the tag identifying it.<br />
	It is time to customize the kernel configuration to fit with your hardware.</p>
<p>After this quit menuconfig and start the compilation.</p>
<p>While you get out the configuration, you will be asked to save the changes. Answer Yes.</p>
<p><strong>Run make rpm</strong></p>
<p>	$ make rpm</p>
<p>The compilation will start, good time to grab a coffee cause this is going to be long<br />
WROTE:&#8230;&#8230;.<br />
	/usr/src/redhat/SRPMS/kernel-2.6.30.10-1.src.rpm<br />
	/usr/src/redhat/RPMS/x86_64/kernel-2.6.30.10-1.x86_64.rpm</p>
<p><strong>Take a backup</strong> of /boot dir for safety </p>
<p>	$ tar czvf boot.tgz /boot/ /etc/grub.conf</p>
<p>Installing the new kernel rpm<br />
	$ rpm -ivh rpm -ivh /usr/src/redhat/RPMS/x86_64/kernel-2.6.30.10-1.x86_64.rpm<br />
Preparing&#8230;                ########################################### [100%]<br />
   1:kernel                 ########################################### [100%]</p>
<p>Confirming that alls ok<br />
	$ ls /boot<br />
config-2.6.18-128.el5  grub    message   System.map-2.6.18-128.el5  vmlinux-2.6.30.10.bz2   vmlinuz-2.6.30.10<br />
config-2.6.30.10  initrd-2.6.18-128.el5.img  lost+found symvers-2.6.18-128.el5.gz  System.map-2.6.30.10 vmlinuz-2.6.18-128.el5</p>
<p><strong>Hmmm no initrd-2.6.30.10.img  </strong></p>
<p>To create the dependencies for the modules:</p>
<p>	$ depmod  2.6.30.10</p>
<p>Create a new initrd with mkinitrd </p>
<p>	$ mkinitrd -v /boot/initrd-2.6.30.10.img 2.6.30.10<br />
Creating initramfs<br />
Looking for deps of module ehci-hcd<br />
Looking for deps of module ohci-hcd<br />
Looking for deps of module uhci-hcd<br />
Looking for deps of module ext3: jbd<br />
Looking for deps of module jbd<br />
Found root device hda2 for LABEL=/<br />
Looking for driver for device hda2<br />
Looking for deps of module ide:m-disk<br />
Looking for driver for device hda3<br />
Looking for deps of module ide:m-disk<br />
Looking for deps of module ips: scsi_mod<br />
Looking for deps of module scsi_mod<br />
Looking for deps of module sd_mod: scsi_mod<br />
Looking for deps of module ata_piix: scsi_mod libata<br />
Looking for deps of module libata: scsi_mod<br />
Looking for deps of module ide-disk<br />
Looking for deps of module dm-mem-cache<br />
No module dm-mem-cache found for kernel 2.6.30.10, aborting.</p>
<p><strong>Opps errors &#8230;&#8230; Need to fix this </strong><br />
	$ echo &#8220;DMRAID=no&#8221; &gt; /etc/sysconfig/mkinitrd/noraid<br />
	$ chmod 755 /etc/sysconfig/mkinitrd/noraid<br />
	$ mkinitrd -v /boot/initrd-2.6.30.10.img 2.6.30.10</p>
<p>Creating initramfs<br />
Looking for deps of module ehci-hcd<br />
Looking for deps of module ohci-hcd<br />
Looking for deps of module uhci-hcd<br />
Looking for deps of module ext3: jbd<br />
Looking for deps of module jbd<br />
Found root device hda2 for LABEL=/<br />
Looking for driver for device hda2<br />
Looking for deps of module ide:m-disk<br />
Looking for driver for device hda3<br />
Looking for deps of module ide:m-disk<br />
Looking for deps of module ips: scsi_mod<br />
Looking for deps of module scsi_mod<br />
Looking for deps of module sd_mod: scsi_mod<br />
Looking for deps of module ata_piix: scsi_mod libata<br />
Looking for deps of module libata: scsi_mod<br />
Looking for deps of module ide-disk<br />
Using modules:  /lib/modules/2.6.30.10/kernel/drivers/usb/host/ehci-hcd.ko /lib/modules/2.6.30.10/kernel/drivers/usb/host/ohci-hcd.ko /lib/modules/2.6.30.10/kernel/drivers/usb/host/uhci-hcd.ko /lib/modules/2.6.30.10/kernel/fs/jbd/jbd.ko /lib/modules/2.6.30.10/kernel/fs/ext3/ext3.ko /lib/modules/2.6.30.10/kernel/drivers/scsi/scsi_mod.ko /lib/modules/2.6.30.10/kernel/drivers/scsi/sd_mod.ko /lib/modules/2.6.30.10/kernel/drivers/scsi/ips.ko /lib/modules/2.6.30.10/kernel/drivers/ata/libata.ko /lib/modules/2.6.30.10/kernel/drivers/ata/ata_piix.ko<br />
/sbin/nash -&gt; /tmp/initrd.w19233/bin/nash<br />
/sbin/insmod.static -&gt; /tmp/initrd.w19233/bin/insmod<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/usb/host/ehci-hcd.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/ehci-hcd.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/usb/host/ohci-hcd.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/ohci-hcd.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/usb/host/uhci-hcd.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/uhci-hcd.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/fs/jbd/jbd.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/jbd.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/fs/ext3/ext3.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/ext3.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/scsi/scsi_mod.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/scsi_mod.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/scsi/sd_mod.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/sd_mod.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/scsi/ips.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/ips.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/ata/libata.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/libata.ko&#8217; [elf64-x86-64]<br />
copy from `/lib/modules/2.6.30.10/kernel/drivers/ata/ata_piix.ko&#8217; [elf64-x86-64] to `/tmp/initrd.w19233/lib/ata_piix.ko&#8217; [elf64-x86-64]<br />
Adding module ehci-hcd<br />
Adding module ohci-hcd<br />
Adding module uhci-hcd<br />
Adding module jbd<br />
Adding module ext3<br />
Adding module scsi_mod<br />
Adding module sd_mod<br />
Adding module ips<br />
Adding module libata<br />
Adding module ata_piix</p>
<p>Checking &#8230;&#8230;.</p>
<p>	$ ls /boot/initrd-2.6.30.10.img<br />
initrd-2.6.30.10.img</p>
<p><strong>Editing grub</strong></p>
<p>Final phase, it remains only edit the grub.conf to use the new kernel.</p>
<p>Add the lines in and change default to boot with new kernel</p>
<p>title CentOS (2.6.30.10)<br />
        root (hd0,0)<br />
        kernel /vmlinuz-2.6.30.10 ro root=LABEL=/ rhgb quiet noacpi irqpoll acpi=off<br />
        initrd /initrd-2.6.30.10.img</p>
<p><strong>Reboot. </strong>and check<br />
	$ reboot</p>
<p>After reboot<br />
	$ uname -a<br />
Linux localhost.localdomain 2.6.30.10 #1 SMP Sat Jul 17 13:25:46 IST 2010 x86_64 x86_64 x86_64 GNU/Linux</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=84&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/07/17/redhatcentos-build-kernel-rpm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>KVM on centos5</title>
		<link>http://derwynd.com/2010/07/14/kvm-on-centos5/</link>
		<comments>http://derwynd.com/2010/07/14/kvm-on-centos5/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 09:56:43 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=79</guid>
		<description><![CDATA[Disable Selinux Make sure that SELinux is disabled. Open /etc/selinux/config&#8230; $ vi /etc/selinux/config &#8230; set SELINUX to disabled: $ reboot or Run $ setenforce 0 [edit] Installing KVM check if your CPU supports hardware virtualization $ egrep &#8216;(vmx&#124;svm)&#8217; &#8211;color=always /proc/cpuinfo flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=79&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Disable Selinux</p>
<p>Make sure that SELinux is disabled. Open /etc/selinux/config&#8230;</p>
<p>$ vi /etc/selinux/config</p>
<p>&#8230; set SELINUX to disabled:</p>
<p>$ reboot</p>
<p>or</p>
<p>Run</p>
<p>$ setenforce 0<br />
[edit] Installing KVM</p>
<p>check if your CPU supports hardware virtualization</p>
<p>$ egrep &#8216;(vmx|svm)&#8217; &#8211;color=always /proc/cpuinfo</p>
<p>flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm</p>
<p>install KVM and virtinst</p>
<p>$ yum install zlib-devel alsa-lib-devel SDL-devel gnutls-devel dev86 texi2html glibc-devel kvm qemu\<br />
 libvirt python-virtinst virt-manager libvirt libvirt-python python-virtinst qemu </p>
<p>$ yum install kvm qemu libvirt python-virtinst<br />
$ yum install virt-manager libvirt libvirt-python python-virtinst</p>
<p>In case rpmforge repo is recquired for qemu</p>
<p>$ rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm</p>
<p>[edit] Service Starting</p>
<p>Then start the libvirt daemon:</p>
<p>$ /etc/init.d/libvirtd start </p>
<p>To check if KVM has successfully been installed, run</p>
<p>$ virsh -c qemu:///system list</p>
<p> Id Name                 State<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Next we need to set up a network bridge on our server so that our virtual machines can be accessed from other hosts as if they were physical systems in the network.</p>
<p>$ yum install bridge-utils</p>
<p>&#8230; and configure a bridge. Delete the system startup links for NetworkManager and create system startup links for network:</p>
<p>$ chkconfig &#8211;del NetworkManager<br />
$ chkconfig &#8211;levels 235 network on </p>
<p>[edit] Networking</p>
<p>Then create the file /etc/sysconfig/network-scripts/ifcfg-br0 (please use the BOOTPROTO, DNS1 (plus any other DNS settings, if any), GATEWAY, IPADDR, NETMASK and SEARCH values from the /etc/sysconfig/network-scripts/ifcfg-eth0 file):</p>
<p>$ vi /etc/sysconfig/network-scripts/ifcfg-br0</p>
<p>DEVICE=br0<br />
TYPE=Bridge<br />
BOOTPROTO=static<br />
DNS1=192.168.2.234<br />
GATEWAY=192.168.2.234<br />
IPADDR=192.168.40.112<br />
NETMASK=255.255.0.0<br />
ONBOOT=yes</p>
<p>Modify /etc/sysconfig/network-scripts/ifcfg-eth0 by keeping these lines and hashing everything else</p>
<p>DEVICE=eth0<br />
HWADDR=00:1E:C9:B5:0D:51<br />
ONBOOT=yes<br />
BRIDGE=br0</p>
<p>Then reboot the system:</p>
<p>$ reboot </p>
<p>[edit] Starting Hosts</p>
<p>Use graphical installation and run &#8220;Creating guests with virt-manager&#8221;</p>
<p>$ virt-manager &amp;</p>
<p>Open the File -&gt; Open Connection. The dialog box below appears. . Select a hypervisor and click the Connect button</p>
<p>       OR</p>
<p>$ virt-install &#8211;accelerate &#8211;hvm &#8211;connect qemu:///system &#8211;network bridge:br0 &#8211;name rhel5support &#8211;ram=512 &#8211;file=/xen/rhel5support.img &#8211;file-size=6 &#8211;vnc &#8211;cdrom=/dev/cdrom </p>
<p>Using virt-install with KVM to create a Red Hat Enterprise Linux 5 guest using cdrom &#8211;hvm (full virt)</p>
<p>$ virt-install &#8211;name fedora11 &#8211;ram 512 &#8211;file=/var/lib/libvirt/images/fedora11.img &#8211;file-size=3 &#8211;vnc &#8211;cdrom=/var/lib/libvirt/images/fedora11.iso</p>
<p>Using virt-install to create a fedora 11 guest</p>
<p>[edit] Info</p>
<p>the xml files are loacted at</p>
<p>$ cd /etc/libvirt/qemu/</p>
<p>Starting the virt machines</p>
<p>$ virsh create kvm2.xml</p>
<p>List domains</p>
<p>$ virsh -c qemu:///system list<br />
 Id Name                 State<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
  1 kvm2                 running<br />
  2 kvm1                 running</p>
<p>Connect to kvm</p>
<p>$ virsh console kvm1</p>
<p>[edit] Managing Virtual Machines from the command line with `virsh`</p>
<p>Virtual machines can be managed on the command line with the virsh utility. The virsh utility is built around the libvirt management API and has a number of advantages over the traditional Xen xm tool:</p>
<p>     virsh has a stable set of commands whose syntax &amp; semantics will be preserved across updates to Xen.<br />
     virsh can be used as an unprivileged user for read-only operations (eg listing domains, getting info, etc)<br />
     virsh will (in future) be able to manage QEMU, VMWare, etc machines in additional to Xen, since libvirt is hypervisor agnostic.</p>
<p>To start a new virtual machine from an XML vm definition:</p>
<p>      $ virsh create  </p>
<p>To list the virtual machines currently running, use:</p>
<p>       $ virsh list</p>
<p>To gracefully power off a guest use:</p>
<p>      $ virsh shutdown </p>
<p>To save a snapshot of the machine to a file of your choosing:</p>
<p>      $ virsh save  </p>
<p>To restore a previously saved snapshot:</p>
<p>      $ virsh restore </p>
<p>To export the XML config associated with a virtual machine:</p>
<p>      $ virsh dumpxml &lt;virtual machine (name | id | uuid)</p>
<p>For a complete list of commands available for use with virsh run:</p>
<p>      $ virsh help</p>
<p>Or consult the manual page virsh(1) </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=79&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/07/14/kvm-on-centos5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>File Password Protection</title>
		<link>http://derwynd.com/2010/03/05/file-password-protection/</link>
		<comments>http://derwynd.com/2010/03/05/file-password-protection/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 07:04:41 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=73</guid>
		<description><![CDATA[A &#62; How do I password protect / encrypt a file within Linux using OpenSSL ? The file we will encrypt will be the file secretfile.txt.As you can see it is just a plain text file. Encrypt File Use the openssl comand to encrypt your file and then test the new file is fully encrypted. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=73&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><strong>A &gt; <em>How do I password protect / encrypt a file within Linux using OpenSSL ?</em></strong></p>
<p>The file we will encrypt will be the file secretfile.txt.As you can see it is just a plain text file.</p>
<p><strong>Encrypt File</strong></p>
<p>Use the openssl comand to encrypt your file and then test the new file is fully encrypted.</p>
<p>$ openssl aes-256-cbc -salt -in secretfile.txt -out secretfile.txt.aes<br />
enter aes-256-cbc encryption password:<br />
Verifying &#8211; enter aes-256-cbc encryption password:</p>
<p>$  cat  secretfile.txt.aes<br />
binary data</p>
<p><strong>Decrypt File</strong></p>
<p>Decrypt the file and then confirm the decypted file is readable.</p>
<p>$  openssl aes-256-cbc -d -salt -in secretfile.txt.aes -out secretfile.txt<br />
enter aes-256-cbc decryption password:</p>
<p>$ cat secretfile.txt<br />
This is a secret file that we do not want anyone to read.</p>
<p><strong>B &gt; <em>How do I password protect / encrypt a file within Linux using Mcrypt ?</em></strong></p>
<p><strong>Encrypt File</strong></p>
<p>Use the mcrypt comand to encrypt your file and then test the new file is fully encrypted.</p>
<p>$ mcrypt secretfile.txt </p>
<p>Output:<br />
Enter the passphrase (maximum of 512 characters)<br />
Please use a combination of upper and lower case letters and numbers.<br />
Enter passphrase:<br />
Enter passphrase:</p>
<p>A new file is created with the extension .nc</p>
<p>$ ls secretfile.txt.nc </p>
<p><strong>Decrypt File</strong></p>
<p>Decrypt the file and then confirm the decypted file is readable.</p>
<p>$ mcrypt -d secretfile.txt.nc</p>
<p>Output:</p>
<p>Enter passphrase:<br />
File secretfile.txt.nc was decrypted.</p>
<p><strong>C &gt;<em> How do I password protect / encrypt a file within Linux using GPG ?</em></strong></p>
<p><strong>Encrypt File</strong></p>
<p>Use the gpg comand to encrypt your file and then test the new file is fully encrypted.</p>
<p>$ gpg -c secretfile.txt</p>
<p>Output:<br />
Enter passphrase:<br />
Repeat passphrase:</p>
<p>This will create a secretfile.txt.gpg file.</p>
<p><strong>Decrypt File</strong></p>
<p>Decrypt the file and then confirm the decypted file is readable.</p>
<p>$ gpg secretfile.txt.gpg</p>
<p>Decrypt file and write output to file </p>
<p>$ gpg secretfile.txt.gpg -o somefile.txt</p>
<p><strong><br />
Easier method is to create a file using vim with the -x flag</strong></p>
<p>vim -x  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=73&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/03/05/file-password-protection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Building modules for rhel5 kernel</title>
		<link>http://derwynd.com/2010/01/14/building-modules-for-rhel5-kernel/</link>
		<comments>http://derwynd.com/2010/01/14/building-modules-for-rhel5-kernel/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 13:45:34 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=71</guid>
		<description><![CDATA[Build modules for kernel instead of building the whole kernel Download the kernel rpm $ rpm -ivh kernel-2.6.18-x.x.x.el5.src.rpm $ cd /usr/src/redhat/SPECS/ $ rpmbuild -bp kernel-2.6.spec will take some time but less than rebuilding the entire kernel hopefully $ cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64 $ cp /boot/config-2.6.18-x.x.x.el5 .config $ make menuconfig Here for examplepurpose i&#8217;m taking xfs and reiserfs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=71&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Build modules for kernel instead of building the whole kernel</p>
<p>Download the kernel rpm<br />
    $ rpm -ivh kernel-2.6.18-x.x.x.el5.src.rpm<br />
    $ cd /usr/src/redhat/SPECS/<br />
    $  rpmbuild -bp kernel-2.6.spec</p>
<p>will take some time but less than rebuilding the entire kernel hopefully<br />
    $ cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64<br />
    $ cp /boot/config-2.6.18-x.x.x.el5 .config<br />
    $ make menuconfig</p>
<p>Here for examplepurpose i&#8217;m taking xfs and reiserfs module hopefully it works with whatever you chose<br />
* For xfs/reiserfs make sure to chose xfs and reiserfs as the module<br />
    $ make fs/xfs/xfs.ko<br />
In case of error run<br />
    $ make SUBDIRS=fs/xfs/ modules<br />
and rerun<br />
    $ make fs/xfs/xfs.ko<br />
    $ mkdir -p /lib/modules/`uname -r`/kernel/fs/xfs<br />
Copy the module into the /lib/modules/`uname -r`/kernel/fs/xfs<br />
    $ cp fs/xfs/xfs.ko /lib/modules/`uname -r`/kernel/fs/xfs<br />
    $ make fs/reiserfs/reiserfs.ko<br />
In case of error run<br />
    $ make SUBDIRS=fs/reiserfs/ modules<br />
and rerun<br />
    $ make fs/reiserfs/reiserfs.ko<br />
    $ mkdir -p /lib/modules/`uname -r`/kernel/fs/reiserfs<br />
Copy the module into the /lib/modules/`uname -r`/kernel/fs/reiserfs<br />
    $ cp fs/xfs/xfs.ko /lib/modules/`uname -r`/kernel/fs/reiserfs</p>
<p>Change permissions<br />
    $ chmod 744 /lib/modules/`uname -r`/kernel/fs/reiserfs/reiserfs.ko<br />
    $ chmod 744 /lib/modules/`uname -r`/kernel/fs/xfs/xfs.ko</p>
<p>insmod the required module<br />
    $ insmod /lib/modules/`uname -r`/kernel/fs/reiserfs/reiserfs.ko<br />
    $ insmod /lib/modules/`uname -r`/kernel/fs/xfs/xfs.ko<br />
Make entry into /etc/modules.conf<br />
    $ echo &#8220;install reiserfs /sbin/insmod /lib/modules/2.6.18-x.x.x.el5/kernel/fs/reiserfs/reiserfs.ko &#8221; &gt;&gt; /etc/modules.conf<br />
    $ echo &#8220;install xfs /sbin/insmod /lib/modules/2.6.18-x.x.x.el5/kernel/fs/xfs/xfs.ko &#8221; &gt;&gt; /etc/modules.conf</p>
<p>    $ modprobe reiserfs<br />
    $ modprobe xfs<br />
    $ depmod -a<br />
Should be done hopefully </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=71&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/01/14/building-modules-for-rhel5-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Open SSL help</title>
		<link>http://derwynd.com/2010/01/14/open-ssl-help/</link>
		<comments>http://derwynd.com/2010/01/14/open-ssl-help/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 11:23:15 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=67</guid>
		<description><![CDATA[General OpenSSL Commands These commands allow you to generate CSRs, Certificates, Private Keys and do other miscellaneous tasks. * Generate a new private key and Certificate Signing Request # openssl req -out CSR.csr -pubkey -new -keyout privateKey.key * Generate a self-signed certificate # openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout privateKey.key -out certificate.crt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=67&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>General OpenSSL Commands</p>
<p>These commands allow you to generate CSRs, Certificates, Private Keys and do other miscellaneous tasks.</p>
<p>    * Generate a new private key and Certificate Signing Request</p>
<p>     #  openssl req -out CSR.csr -pubkey -new -keyout privateKey.key</p>
<p>    * Generate a self-signed certificate</p>
<p>     # openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout privateKey.key -out certificate.crt</p>
<p>    * Generate a certificate signing request (CSR) for an existing private key</p>
<p>     # openssl req -out CSR.csr -key privateKey.key -new</p>
<p>    * Generate a certificate signing request based on an existing certificate</p>
<p>     # openssl x509 -x509toreq -in certificate.crt -out CSR.csr -signkey privateKey.key</p>
<p>    * Remove a passphrase from a private key</p>
<p>     # openssl rsa -in privateKey.pem -out newPrivateKey.pem</p>
<p>Checking Using OpenSSL</p>
<p>If you need to check the information within a Certificate, CSR or Private Key, use these commands. You can also check CSRs and check certificates using our online tools.</p>
<p>    * Check a Certificate Signing Request (CSR)</p>
<p>     #  openssl req -text -noout -verify -in CSR.csr</p>
<p>    * Check a private key</p>
<p>     #  openssl rsa -in privateKey.key -check</p>
<p>    * Check a certificate</p>
<p>      # openssl x509 -in certificate.crt -text -noout</p>
<p>    * Check a PKCS#12 file (.pfx or .p12)</p>
<p>     #  openssl pkcs12 -info -in keyStore.p12</p>
<p>Debugging Using OpenSSL</p>
<p>If you are receiving an error that the private doesn’t match the certificate or that a certificate that you installed to a site is not trusted, try one of these commands. If you are trying to verify that an SSL certificate is installed correctly, be sure to check out the SSL Checker.</p>
<p>    * Check an MD5 hash of the public key to ensure that it matches with what is in a CSR or private key</p>
<p>    #  openssl x509 -noout -modulus -in certificate.crt | openssl md5openssl rsa -noout -modulus -in privateKey.key | openssl md5openssl req -noout -modulus -in CSR.csr | openssl md5</p>
<p>    * Check an SSL connection. All the certificates (including Intermediates) should be displayed</p>
<p>     # openssl s_client -connect www.paypal.com:443</p>
<p>Converting Using OpenSSL</p>
<p>These commands allow you to convert certificates and keys to different formats to make them compatible with specific types of servers or software. For example, you can convert a normal PEM file that would work with Apache to a PFX (PKCS#12) file and use it with Tomcat or IIS. Use our SSL Converter to convert certificates without messing with OpenSSL.</p>
<p>    * Convert a DER file (.crt .cer .der) to PEM</p>
<p>       # openssl x509 -inform der -in certificate.cer -out certificate.pem</p>
<p>    * Convert a PEM file to DER</p>
<p>      # openssl x509 -outform der -in certificate.pem -out certificate.der</p>
<p>    * Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM</p>
<p>      # openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes</p>
<p>      You can add -nocerts to only output the private key or add -nokeys to only output the certificates.<br />
    * Convert a PEM certificate file and a private key to PKCS#12 (.pfx .p12)</p>
<p>      # openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt</p>
<p>    * To test SSL connections to a mail server, use the openssl command with the s_client parameter:</p>
<p>      # openssl s_client -connect smtp.myhost.com:25 -starttls smtp</p>
<p>This essentially opens a telnet-like connection to smtp.myhost.com on port 25 using the STARTTLS extension. This is an interactive session, so you can send commands to the remote SMTP server as well as view the certificate used, view the details of the SSL session, and more. To test SMTP over SSL, don&#8217;t use the -starttls option:</p>
<p>      # openssl s_client -connect smtp.myhost.com:465</p>
<p>    * The above can also be used to connect to any service that uses SSL, such as HTTPS (port 443), POP3 over SSL (port 995), and so forth.</p>
<p>    * The openssl command can also be used to create digests of a file, which can be used to verify that a file has not been tampered with:</p>
<p>      # echo &#8220;test file&#8221;&gt; foo.txt</p>
<p>      # openssl dgst -md5 foo.txt</p>
<p>      MD5(foo.txt)= b05403312f66bdc8ccc597fedf6cd5fe</p>
<p>      # openssl dgst -sha1 foo.txt</p>
<p>      SHA1(foo.txt)= 0181d93fff60b818g3f92e470ea97a2aff4ca56a</p>
<p>    * To view the other message digests that can be used, look at the output of openssl list-message-digest-commands.</p>
<p>    * You can also use openssl to encrypt files. To view the list of available ciphers, use openssl list-cipher-commands. Once you&#8217;ve chosen a cipher to use, you can encrypt the file using the following commands:</p>
<p>      # openssl enc -aes-256-cbc -salt -in foo.txt -out foo.enc</p>
<p>      enter aes-256-cbc encryption password:</p>
<p>      Verifying &#8211; enter aes-256-cbc encryption password:</p>
<p>      # file foo.enc</p>
<p>      foo.enc: data</p>
<p>      # cat foo.enc</p>
<p>      Salted__yvi{!e????i&#8221;Yt?;(Ѱ e%<br />
      # openssl enc -d -aes-256-cbc -in foo.enc</p>
<p>      enter aes-256-cbc decryption password:</p>
<p>      test file</p>
<p>In the above example, the file foo.txt was encrypted using 256-bit AES in CBC mode, the encrypted copy being saved as the file foo.enc. Looking at the contents of the file provide gibberish. Decrypting the file is done using the -d option; however, keep in mind that not only do you need to remember the password, you also need to know the cipher used.</p>
<p>As you can see, OpenSSL provides more than just a library for other applications to use, and the openssl command-line binary is a powerful program in its own right, allowing for many uses.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=67&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/01/14/open-ssl-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Extracting certificates from java keystore to use in apache.conf</title>
		<link>http://derwynd.com/2010/01/14/extracting-certificates-from-java-keystore-to-use-in-apache-conf/</link>
		<comments>http://derwynd.com/2010/01/14/extracting-certificates-from-java-keystore-to-use-in-apache-conf/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 11:14:53 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=65</guid>
		<description><![CDATA[So you have a javakeystore and want to extract the certificate&#8230;. heres what I did .. of course I had the passphrase Downloaded &#8230;. $ java-1.6.0-openjdk-1.6.0.0-0.25.b09.el5.x86_64.rpm $ rpm -ivh java-1.6.0-openjdk-1.6.0.0-0.25.b09.el5.x86_64.rpm $ cd /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/keytool and $ ./keytool -importkeystore -srckeystore /opt/certs/final/NetworthKeyStore -destkeystore /tmp/mystore.p12 -srcstoretype JKS -deststoretype PKCS12 -noprompt Enter destination keystore password: Re-enter new password: Enter source [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=65&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>So you have a javakeystore and want to extract the certificate&#8230;.</p>
<p>heres what I did .. of course I had the passphrase </p>
<p>Downloaded &#8230;.<br />
$ java-1.6.0-openjdk-1.6.0.0-0.25.b09.el5.x86_64.rpm</p>
<p>$ rpm -ivh java-1.6.0-openjdk-1.6.0.0-0.25.b09.el5.x86_64.rpm	</p>
<p>$ cd /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/keytool</p>
<p>and<br />
$ ./keytool -importkeystore -srckeystore /opt/certs/final/NetworthKeyStore -destkeystore /tmp/mystore.p12 -srcstoretype JKS -deststoretype PKCS12   -noprompt</p>
<p>Enter destination keystore password:<br />
Re-enter new password:<br />
Enter source keystore password:<br />
Entry for alias networthpnbkey successfully imported.<br />
Import command completed:  1 entries successfully imported, 0 entries failed or cancelled</p>
<p>where KeyStore is the java keystore name</p>
<p>So I got a  /tmp/mystore.p12 with everything  great<br />
 now for some ssl magic<br />
$ openssl pkcs12 -info -in /tmp/mystore.p12</p>
<p>Enter Import Password:<br />
MAC Iteration 1024<br />
MAC verified OK<br />
PKCS7 Data<br />
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 1024<br />
Bag Attributes<br />
    friendlyName: pubkey<br />
    localKeyID: 52 69 3D 69 50 41 22 69 33 34 36 36 32 34 34 36 30 35<br />
Key Attributes:<br />
Enter PEM pass phrase:<br />
Verifying &#8211; Enter PEM pass phrase:</p>
<p>Copy the following from output&#8230;&#8230;.</p>
<p>&#8212;&#8211;BEGIN RSA PRIVATE KEY&#8212;&#8211;<br />
Proc-Type: 4,ENCRYPTED<br />
DEK-Info: DES-EDE3-CBC,FE731BD9D499A31B</p>
<p>d12tLvqVX0a3FxOba+uwCiJIxEC8dESEI9GI5Doz1hieu8pZKoz3bwozDBLfLlFA<br />
lvPj4Qi2FmazrZWRTNHQOUcv4aVQ1TmauRtw/LMoieR0b4+VkqTzk/eAe6d3pfr/<br />
BoZxs40f0YaYsgMyYj0HWOIFXmCZnfEgzQBVZPIqcUzBxrV4g7xwjbLBXHJ+wAv+<br />
p+3/ejYvxz/lfn+Nd00TlUZu770wPlRzQT4hwjWuNVfmadA+FpBMk4uW8dDSEMMc<br />
KyW2Qg2nLfXlxMxLIb7DB86eJUS5W5bAHi1S5RNiSNRxXkFZP4xIKnoamsQqoGg7<br />
o1zlVjRo3R/wh7idgLKDSUXX07qHhfOObEem3lbAbu6WuvpPW1Qy8Cr8N4aqHhBW<br />
VvBzyvwajE0yBD9cQSPDZnLhWqu4z9MpQLexSHV398Yd/iOnnTmWnxVxhuINaJr0<br />
40aZ9YsU7EpuCsaJ4Ifuu4Zu5LdC2G+KqRw/RvcLyPc5ie7AB2/mox1qH14W9d60<br />
FZFCd8ZDpS7eNkUMx2qyWRKoaBdkPLp1baY8BWLZR2N7z59RkjGMfQsUpSCArgE/<br />
63+BdMMSqFsRWKfWAWIqFshp/Q7AUdr0Dgftj9A3Ao6i6qA9HGB2MwomH/LXaoxl<br />
759dFjWBMcJ3Fj1+eqoRZWw/+MdZhADhIyTEiksP8FJ8EXrEmalT+jIqVaxVPH51<br />
WnQhGmTXvu3YU99NCpgyTjUo7z3OPyAT5z4QT6PdcPOXM5wR90ExR1YnxTnHLuwE<br />
KhictV+isaH8xAPGB3okffvtYqS/xSubJ88MP5VPfEOvUkGAmqFj4A==<br />
&#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211;</p>
<p>&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;<br />
MIIB4DCCAUkCAQAwgZ8xCzAJBgNVBAYTAkdCMRYwFAYDVQQIEw1XZXN0IE1pZGxh<br />
bmRzMREwDwYDVQQHEwhDb3ZlbnRyeTETMBEGAAUEChMKUGxhbmV0bGFyZzEUMBIG<br />
HBiePsg26oDwlQ5XOvi+jslQN+u6CQo2rlzMn4OoKrBufp3g2IgRrrwRSxOLpJeX<br />
A1UECxMLSURDIHN1cHBvcnQxFzAVBgNVBAMTDnd3dy5kb21haW4uY29tMSEwHwYJ<br />
KoZIhvcNAQkBFhJpZGNAcGxhbmV0bGFyZy5uZXQwgZ8wDQYJKoZIhvcNAQEBBQAD<br />
gY0AMIGJAoGBAMQt4q36X3KQ5795HeQSl5D57TAHOeRGw9kEb8WWjZCaCNCFeXU4<br />
XB4ZleozGJVvlhcua1fSSWuEhZOWms5y628sMud5YuxG/rrXrDM4tkNHwsLob3yo<br />
2+5fZyZvopWnWs9Z+Vz/GbOJJvtgkngnVm3rP3cbHEmaWXCzIVgUWPYJAgMBAAGg<br />
ADANBgkqhkiG9w0BAQUFAAOBgQB2rRr2bc+3iQEGvc5zSr9/nw1YBCGJBfMThe+V<br />
KoZIhvcNAQkBFhJpZGNAcGxhbmV0bGFyZy5uZXQwgZ8wDQYJKoZIhvcNAQEBBQAD<br />
A1UECxMLSURDIHN1cHBvcnQxFzAVBgNVBAMTDnd3dy5kb21haW4uY29tMSEwHwYJ<br />
ADANBgkqhkiG9w0BAQUFAAOBgQB2rRr2bc+3iQEGvc5zSr9/nw1YBCGJBfMThe+V<br />
bmRzMREwDwYDVQQHEwhDb3ZlbnRyeTETMBEGAAUEChMKUGxhbmV0bGFyZzEUMBIG<br />
WdIpJN6cONDEF8hXtEKbpSmeu7ioUsLWDiQJ/Vab/XR9Uz9gsjs7ztm6ZTFhlYUD<br />
HBiePsg26oDwlQ5XOvi+jslQN+u6CQo2rlzMn4OoKrBufp3g2IgRrrwRSxOLpJeX<br />
KaAO32si+7euiprm79a3CcRrWSjpfKX6FhkGIu9BbQ==<br />
&#8212;&#8211;END CERTIFICATE&#8212;&#8211;</p>
<p>Go ahead and import in your apache config</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=65&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/01/14/extracting-certificates-from-java-keystore-to-use-in-apache-conf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>What is bonding?</title>
		<link>http://derwynd.com/2010/01/06/what-is-bonding/</link>
		<comments>http://derwynd.com/2010/01/06/what-is-bonding/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 09:55:27 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=61</guid>
		<description><![CDATA[What is bonding? The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical &#8220;bonded&#8221; interface. The behavior of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring may be performed. ie you can aggregate three megabits [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=61&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>What is bonding?<br />
The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical &#8220;bonded&#8221; interface.<br />
The behavior of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services.<br />
Additionally, link integrity monitoring may be performed. </p>
<p>ie you can aggregate three megabits ports (1 mb each) into a three-megabits trunk port.<br />
That is equivalent with having one interface with three megabits speed.</p>
<p>This small howto will try to cover the most used bonding types.<br />
The following script will configure a bond interface (bond0) using two ethernet interface (eth0 and eth1). </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
#!/bin/bash<br />
set -x<br />
# 1: Create a bond0 configuration file<br />
touch /etc/sysconfig/network-scripts/ifcfg-bond0<br />
echo &#8220;DEVICE=bond0<br />
IPADDR=192.168.x.x<br />
NETWORK=192.168.0.0<br />
NETMASK=255.255.255.0<br />
USERCTL=no<br />
BOOTPROTO=static<br />
ONBOOT=yes&#8221; &gt; /etc/sysconfig/network-scripts/ifcfg-bond0</p>
<p># 2: Modify eth0 and eth1 config files:<br />
echo &#8220;USERCTL=no<br />
MASTER=bond0<br />
SLAVE=yes&#8221; &gt;&gt; /etc/sysconfig/network-scripts/ifcfg-eth0<br />
echo &#8220;USERCTL=no<br />
MASTER=bond0<br />
SLAVE=yes&#8221; &gt;&gt; /etc/sysconfig/network-scripts/ifcfg-eth1<br />
sed -i &#8216;s/ONBOOT=.*/ONBOOT=yes/g&#8217; /etc/sysconfig/network-scripts/ifcfg-eth0<br />
sed -i &#8216;s/ONBOOT=.*/ONBOOT=yes/g&#8217; /etc/sysconfig/network-scripts/ifcfg-eth1<br />
sed -i &#8216;s/BOOTPROTO=.*/BOOTPROTO=static/g&#8217; /etc/sysconfig/network-scripts/ifcfg-eth0<br />
sed -i &#8216;s/BOOTPROTO=.*/BOOTPROTO=static/g&#8217; /etc/sysconfig/network-scripts/ifcfg-eth1</p>
<p># 3: Load bond driver/module<br />
echo &#8220;alias bond0 bonding<br />
options bond0 mode=1 miimon=100&#8243; &gt;&gt; /etc/modprobe.conf</p>
<p># 4: Test configuration<br />
modprobe bonding<br />
service network restart<br />
sleep 2<br />
cat /proc/net/bonding/bond0<br />
echo &#8221; ifconfig  for bonding&#8221;<br />
/sbin/ifconfig | grep bond</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>You can set up your bond interface mode according to your needs. Changing one parameter (mode=X) in /etc/modeprobe.conf you can have the following bonding types:</p>
<p>* mode=0 (balance-rr or 0)<br />
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.</p>
<p>* mode=1 (active-backup or 1)<br />
Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond&#8217;s MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.</p>
<p>* mode=2 (balance-xor or 2)<br />
XOR policy: Transmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.</p>
<p>* mode=3 (broadcast or 3)<br />
Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.</p>
<p>* mode=4 (802.3ad or 4)<br />
IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.</p>
<p>	Pre-requisites:<br />
	1. Ethtool support in the base drivers for retrieving<br />
	the speed and duplex of each slave.<br />
	2. A switch that supports IEEE 802.3ad Dynamic link<br />
	aggregation.<br />
	Most switches will require some type of configuration<br />
	to enable 802.3ad mode.</p>
<p>* mode=5 (balance-tlb or 5)<br />
Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.</p>
<p>	Prerequisite:<br />
	Ethtool support in the base drivers for retrieving the<br />
	speed of each slave.</p>
<p>* mode=6 (balance-alb or 6)<br />
Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.</p>
<p>The contents of the ifcfg-bondX file is as follows:</p>
<p>BOOTPROTO=&#8221;static&#8221;<br />
BROADCAST=&#8221;10.0.2.255&#8243;<br />
IPADDR=&#8221;10.0.2.10&#8243;<br />
NETMASK=&#8221;255.255.0.0&#8243;<br />
NETWORK=&#8221;10.0.2.0&#8243;<br />
REMOTE_IPADDR=&#8221;"<br />
STARTMODE=&#8221;onboot&#8221;<br />
BONDING_MASTER=&#8221;yes&#8221;<br />
BONDING_MODULE_OPTS=&#8221;mode=active-backup miimon=100&#8243;<br />
BONDING_SLAVE0=&#8221;eth0&#8243;<br />
BONDING_SLAVE1=&#8221;bus-pci-0000:06:08.1&#8243;</p>
<p>Replace the sample BROADCAST, IPADDR, NETMASK and NETWORK values with the appropriate values for your network.</p>
<p>Notes:<br />
	* For later versions of initscripts, such as that found with Fedora 7 and Red Hat Enterprise Linux version 5 (or later), it is possible, and, indeed, preferable, to specify the bonding options in the ifcfg-bond0 file, e.g. a line of the format:</p>
<p>BONDING_OPTS=&#8221;mode=active-backup arp_interval=60 arp_ip_target=+192.168.1.254&#8243;</p>
<p>    * To restore your slaves MAC addresses, you need to detach them from the bond (`ifenslave -d bond0 eth0&#8242;). The bonding driver will then restore the MAC addresses that the slaves had before they were enslaved.<br />
    * The bond MAC address will be the taken from its first slave device.<br />
    * Promiscous mode: According to your bond type, when you put the bond interface in the promiscous mode it will propogates the setting to the slave devices as follow:<br />
          o for mode=0,2,3 and 4 the promiscuous mode setting is propogated to all slaves.<br />
          o for mode=1,5 and 6 the promiscuous mode setting is propogated only to the active slave.<br />
            For balance-tlb mode the active slave is the slave currently receiving inbound traffic, for balance-alb mode the active slave is the slave used as a &#8220;primary.&#8221; and for the active-backup, balance-tlb and balance-alb modes, when the active slave changes (e.g., due to a link failure), the promiscuous setting will be propogated to the new active slave.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=61&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/01/06/what-is-bonding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Xen rescue paravirtualization</title>
		<link>http://derwynd.com/2010/01/06/xen-rescue-paravirtualization/</link>
		<comments>http://derwynd.com/2010/01/06/xen-rescue-paravirtualization/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 08:11:06 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=58</guid>
		<description><![CDATA[===Rescue=== Shut down the GuestOS safely by logging into the GuestOS and issuing the command poweroff or $ xm shutdown alfa Copy or download the &#8221;&#8217;initrd.img&#8221;&#8217; and &#8221;&#8217;vmlinuz&#8221;&#8217; files from /images/xen/ directory of Red Hat Enterprise Linux install media tree to Red Hat Enterprise Linux Virtualization Host. In this test case these files are copied [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=58&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>===Rescue===</p>
<p>Shut down the GuestOS safely by logging into the GuestOS and issuing the command poweroff or </p>
<pre>
$ xm shutdown alfa
</pre>
<p>Copy or download the &#8221;&#8217;initrd.img&#8221;&#8217; and &#8221;&#8217;vmlinuz&#8221;&#8217; files from /images/xen/ directory of Red Hat Enterprise Linux install media tree to Red Hat Enterprise Linux Virtualization Host. In this test case these files are copied to the directory &#8221;&#8217;/var/lib/xen/images/tmp/&#8221;&#8217; of the Virtualization host.</p>
<p>Modify the GuestOS configuration file on the Virtualization Host itself to enable boot it from rescue environment. In this test case the GuesOS in question is called alfa and its configuration file is /etc/xen/alfa</p>
<p>1. copy the config file &#8221;&#8217;/etc/xen/alfa&#8221;&#8217; to &#8221;&#8217;/etc/xen/alfa_rescue&#8221;&#8217;</p>
<p>2. In the config file &#8221;&#8217;/etc/xen/alfa_rescue&#8221;&#8217;, comment the bootloader line: </p>
<pre>#bootloader="/usr/bin/pygrub"</pre>
<p>3. Append the following to the configuration before the &#8221;&#8217;disk =&#8221;&#8217; line file temporarily and save it.</p>
<pre>
kernel = "/var/lib/xen/images/tmp/vmlinuz"
ramdisk = "/var/lib/xen/images/tmp/initrd.img"
extra = "rescue"
</pre>
<p>4. Sample</p>
<pre>
name = "alfa"
uuid = "96b6da3e-70a7-a0a0-7c68-67a0f83d8264"
maxmem = 512
memory = 512
vcpus = 1
#bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [  ]
kernel = "/var/lib/xen/images/tmp/vmlinuz"
ramdisk = "/var/lib/xen/images/tmp/initrd.img"
extra = "rescue"
disk = [ "tap:aio:/var/lib/xen/images/alfa.img,xvda,w" ]
vif = [ "mac=00:16:3e:13:62:2f,bridge=xenbr0" ]
</pre>
<p>5. Re-create (start) the GuestOS with xm command </p>
<pre>
 xm create -c alfa_rescue
</pre>
<p>6.</p>
<pre>
                   +---------+ Choose a Language +---------+
                   |                                       |
                   | What language would you like to use   |
                   | during the installation process?      |
                   |                                       |
                   |       Catalan                ^        |
                   |       Chinese(Simplified)    :        |
                   |       Chinese(Traditional)   #        |
                   |       Croatian               :        |
                   |       Czech                  :        |
                   |       Danish                 :        |
                   |       Dutch                  :        |
                   |       English                v        |
                   |                                       |
                   |                +----+                 |
                   |                | OK |                 |
                   |                +----+                 |
                   |                                       |
                   |                                       |
                   +---------------------------------------+
</pre>
<p>7. Chose HTTP</p>
<pre>
               +---------------+ Rescue Method +----------------+
               |                                                |
               | What type of media contains the rescue image?  |
               |                                                |
               |                  Local CDROM                   |
               |                  Hard drive                    |
               |                  NFS image                     |
               |                  FTP                           |
               |                  HTTP                          |
               |                                                |
               |        +----+                 +------+         |
               |        | OK |                 | Back |         |
               |        +----+                 +------+         |
               |                                                |
               |                                                |
               +------------------------------------------------+
</pre>
<p>8. Set IP</p>
<pre>
             +----------------+ Configure TCP/IP +----------------+
             |                                                    |
             | [*] Enable IPv4 support                            |
             |        ( ) Dynamic IP configuration (DHCP)         |
             |        (*) Manual configuration                    |
             |                                                    |
             | [ ] Enable IPv6 support                            |
             |        (*) Automatic neighbor discovery (RFC 2461) |
             |        ( ) Dynamic IP configuration (DHCP)         |
             |        ( ) Manual configuration                    |
             |                                                    |
             |          +----+                  +------+          |
             |          | OK |                  | Back |          |
             |          +----+                  +------+          |
             |                                                    |
             |                                                    |
             +----------------------------------------------------+
</pre>
<pre>
         +--------------+ Manual TCP/IP Configuration +---------------+
         |                                                            |
         | Enter the IPv4 and/or the IPv6 address and prefix          |
         | (address / prefix).  For IPv4, the dotted-quad netmask     |
         | or the CIDR-style prefix are acceptable. The gateway and   |
         | name server fields must be valid IPv4 or IPv6 addresses.   |
         |                                                            |
         | IPv4 address: 192.168.y.yy__ / 255.255.255.0_____          |
         | Gateway:      192.168.z.zz____________________________    |
         | Name Server:  192.168.z.zz____________________________    |
         |                                                            |
         |            +----+                      +------+            |
         |            | OK |                      | Back |            |
         |            +----+                      +------+            |
         |                                                            |
         |                                                            |
         +------------------------------------------------------------+
</pre>
<p>9. Http setting</p>
<pre>
    +---------------------------+ HTTP Setup +----------------------------+
    |                                                                     |
    |           Please enter the following information:                   |
    |                                                                     |
    |               o the name or IP number of your Web server            |
    |               o the directory on that server containing             |
    |                 Red Hat Enterprise Linux Server for                 |
    |           your architecture                                         |
    |                                                                     |
    | Web site name:                             192.168.x.x___________ |
    | Red Hat Enterprise Linux Server directory: rhelxxx_________________ |
    |                                                                     |
    |              +----+                           +------+              |
    |              | OK |                           | Back |              |
    |              +----+                           +------+              |
    |                                                                     |
    |                                                                     |
    +---------------------------------------------------------------------+
</pre>
<p>10. Rescue</p>
<pre>
            +---------------------+ Rescue +----------------------+
            |                                                     |
            | The rescue environment will now attempt to find   ^ |
            | your Linux installation and mount it under the    # |
            | directory /mnt/sysimage.  You can then make any   : |
            | changes required to your system.  If you want     : |
            | to proceed with this step choose 'Continue'.      : |
            | You can also choose to mount your file systems    : |
            | read-only instead of read-write by choosing       : |
            | 'Read-Only'.                                      : |
            |                                                   : |
            | If for some reason this process fails you can     : |
            | choose 'Skip' and this step will be skipped and   : |
            | you will go directly to a command shell.          v |
            |                                                     |
            |   +----------+      +-----------+      +------+     |
            |   | Continue |      | Read-Only |      | Skip |     |
            |   +----------+      +-----------+      +------+     |
            |                                                     |
            |                                                     |
            +-----------------------------------------------------+
</pre>
<pre>
                  +---------------+ Rescue +----------------+
                  |                                         |
                  | Your system has been mounted under      |
                  | /mnt/sysimage.                          |
                  |                                         |
                  | Press  to get a shell. If you   |
                  | would like to make your system the      |
                  | root environment, run the command:      |
                  |                                         |
                  |         chroot /mnt/sysimage            |
                  |                                         |
                  | The system will reboot automatically    |
                  | when you exit from the shell.           |
                  |                                         |
                  |                 +----+                  |
                  |                 | OK |                  |
                  |                 +----+                  |
                  |                                         |
                  |                                         |
                  +-----------------------------------------+
</pre>
<pre>
Your system is mounted under the /mnt/sysimage directory.
When finished please exit from the shell and your system will reboot.

sh-3.2#
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=58&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2010/01/06/xen-rescue-paravirtualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
		<item>
		<title>flash player on firefox 64 bite</title>
		<link>http://derwynd.com/2009/12/05/flash-player-on-firfox-64-bit/</link>
		<comments>http://derwynd.com/2009/12/05/flash-player-on-firfox-64-bit/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 04:58:48 +0000</pubDate>
		<dc:creator>derwynd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://derwynd.com/?p=56</guid>
		<description><![CDATA[After upgrading my firefox found out the flash was not working. Downloaded libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz from Adobe site This contains libflashplayer.so Just copy it to /usr/lib64/mozilla/plugins/ Restart browser and check.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=56&subd=derwynd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>After upgrading my firefox found out the flash was not working.</p>
<p>Downloaded libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz from Adobe site<br />
This contains libflashplayer.so</p>
<p>Just copy it to /usr/lib64/mozilla/plugins/<br />
Restart browser and check.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/derwynd.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/derwynd.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/derwynd.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/derwynd.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/derwynd.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/derwynd.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/derwynd.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/derwynd.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/derwynd.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/derwynd.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=derwynd.com&blog=4330525&post=56&subd=derwynd&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://derwynd.com/2009/12/05/flash-player-on-firfox-64-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/89de0963d0123cd6c2d3b997a3ac44d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">derwynd</media:title>
		</media:content>
	</item>
	</channel>
</rss>