web of unni

About | GuestBook | Add WebOfUnni to Google ToolBar

Download Day

November 27, 2007

Parsing html as php

Filed under: apache, iis, php, windows — unni @ 9:50 pm

Some times we need to parse html files as php. You do the following for the same.

1. Apache
in the website document root create a directory called .htaccess and add the following to that file.

=================================
AddType application/x-httpd-php .inc .php .phtml .html
AddType application/x-httpd-php-source .phps
==================================

Now yout html files will be parsed as php

2. Windows IIS

* Go to IIS manager ( Start >> Programs >> Administrative tools >> IIS manger )
* Right click on the website and get the properties. In the Home directory tab click on application configuration.
* Get the executable path corresponding to php extension.
* Click on add new application extension
* Enter the executable path as that you got from php extension. Enter the extension as .html
* Click Ok.
Now your windows machine will parse your html files as php

November 25, 2007

What If Gmail Had Been Designed by Microsoft?

Filed under: Gmail, Microsoft, google — unni @ 10:31 pm

How will Gmail look like if it is designed by Microsoft. Here is a humerus explanation of the Gmail design by Microsoft with the screen shots.

November 20, 2007

Firefox 3 beta 1 released

Filed under: firefox — unni @ 5:41 pm

firefoxlogo2.png

New beta release of Firefox 3 is available. Lets taste it . Here is a good review .

November 18, 2007

Mount LVM Partitioned Disk

Filed under: linux, lvm — vivek @ 10:27 am

1. Check the LVM partitioned disk

fdisk -l

Example

[root@server ~]# fdisk -l

Disk /dev/hda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14         267     2040255   82  Linux swap
/dev/hda3             268       10011    78268680   83  Linux

Disk /dev/hdc: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1          13      104391   83  Linux
/dev/hdc2              14       10011    80308935   8e  Linux LVM

Clearly from the last line /dev/hdc2 had partitioned in lvm format

Note: The module dm-mod should be compiled in with the kernel to support lvm format, check this using

lsmod

and if not present add the modules using

modprobe dm-mod

(When configuring the kernel, make sure to configure the kernel to support LVM)
2. Check for volume groups (VG)

vgscan

Example

[root@server ~]# vgscan
 Reading all physical volumes.  This may take a while…
 Found volume group “VolGroup00″ using metadata type lvm2

Here the available volume group is VolGroup00, it may be different (say vg0 ) as setup in a disk. If there are more than one volume group they may be named as VolGroup01 or vg1, VolGroup02 or vg2 …
3. Check for physical volumes (PV)

pvscan

Example

[root@server ~]# pvscan
  PV /dev/hdc2   VG VolGroup00   lvm2 [76.56 GB / 32.00 MB free]
  Total: 1 [76.56 GB] / in use: 1 [76.56 GB] / in no VG: 0 [0   ]

4. Activate the volume group

vgchange VolGroup00 -a y

Example

[root@server ~]# vgchange VolGroup00 -a y
  2 logical volume(s) in volume group “VolGroup00″ now active

The above command actually make the volume group VolGroup00 known to the kernel and after this the device is mapped to the logical volumes in volume groups. If there are more than one volume group and want to activate all, we have to modify the command as below

vgchange -a y

As per the output in the above example two logical volumes are active, we can verify as follows

[root@server ~]# cd /dev/VolGroup00/
[root@server VolGroup00]# ll
total 0
lrwxrwxrwx  1 root root 31 Jun 29 10:33 LogVol00 -> /dev/mapper/VolGroup00-LogVol00
lrwxrwxrwx  1 root root 31 Jun 29 10:33 LogVol01 -> /dev/mapper/VolGroup00-LogVol01

5. Mount the partition

mkdir /mnt/old
mount /dev/VolGroup00/LogVol00 /mnt/old

Example

[root@server ~]# mount /dev/VolGroup00/LogVol00 /mnt/old/
[root@server ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3              74G   16G   55G  22% /
/dev/hda1              99M   17M   77M  18% /boot
/usr/tmpDSK           485M   13M  447M   3% /tmp
/tmp                  485M   13M  447M   3% /var/tmp
/dev/mapper/VolGroup00-LogVol00
                       74G   16G   54G  23% /mnt/old

Created and maintained by Unnikrishnan
Hosted by Host cats