Friday 23 December 2011

Nagios Script

System Process and Port check script for Nagios

#!/bin/bash
#
# Usage: .//check_system_pp
#
# Description:
# This plugin determines whether the server
# is running properly. It will check the following:
# * Are all required processes running?
# * Are all the required TCP/IP ports open?
#
# Created:      27.01.2006 (FBA)
#
# Changes:      28.01.2006      added yellow check (FBA)
#               29.01.2006      change "px -ef" to "ps -ax" (FBA). Problems with long arguments
#               31.01.2006      added all OK Status with all procs and ports (FBA)
#           15.07.2006      change "ps -ax" to "ps ax" (FBA). Also problems with long arguments under RedHat 3/4
#           17.07.2006  Plugin rewrite and bugfixes (Magnus Glantz)
#           19.07.2006  Removed utils.sh dependency.
#
#
#

##################################################################################
#
# Processes to check
PROCLIST_RED="bearerbox"
PROCLIST_YELLOW=""

# Ports to check
PORTLIST=""

##################################################################################

PATH="/usr/bin:/usr/sbin:/bin:/sbin"

STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4

print_gpl() {
    echo "This program is free software; you can redistribute it and/or modify"
    echo "it under the terms of the GNU General Public License as published by"
    echo "the Free Software Foundation; either version 2 of the License, or"
    echo "(at your option) any later version."
    echo ""
    echo "This program is distributed in the hope that it will be useful,"
    echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
    echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the"
    echo "GNU General Public License for more details."
    echo ""
    echo "You should have received a copy of the GNU General Public License"
    echo "along with this program; if not, write to the Free Software"
    echo "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA"
}

print_help(){
        echo ""
        echo "System process and port check script for Nagios."
      echo "Tested on RHE3/4, Fedora 4, Solaris 9"
      echo ""
        echo "Usage: ./check_system_pp"
        echo "Website: http://www.nagiosexchange.org"
      echo ""
      print_gpl
}

while test -n "$1"
do
        case "$1" in
          *) print_help; exit $STATE_OK;;
        esac
done

check_processes_red()
{
        PROCESS="0"
        ERROR_PROCS=""
        for PROC in `echo $PROCLIST_RED`; do
        if [ `ps -ef | grep $PROC | grep -v grep | wc -l` -lt 1 ]; then
                        PROCESS=1
                        ERROR_PROCS="$ERROR_PROCS""$PROC ";
        fi
        done

        if [ $PROCESS -eq "1" ]; then
                exit_red=$STATE_CRITICAL
      elif [ $PROCESS -eq "0" ]; then
            exit_red=$STATE_OK
        fi
}

check_processes_yellow()
{
        PROCESS="0"
        WARNING_PROCS=""
        for PROC in `echo $PROCLIST_YELLOW`; do
        if [ `ps -ef | grep $PROC | grep -v grep | wc -l` -lt 1 ]; then
                        PROCESS=1
                        WARNING_PROCS="$WARNING_PROCS""$PROC ";
        fi
        done

        if [ $PROCESS -eq "1" ]; then
                exit_yellow=$STATE_WARNING
        elif [ $PROCESS -eq "0" ]; then
            exit_yellow=$STATE_OK
      fi
}

check_ports()
{
        PORTS="0"
        ERROR_PORTS=""
        for NUM in `echo $PORTLIST`; do
                if [ `netstat -an | grep LISTEN | grep $NUM | grep -v grep | wc -l` -lt 1 ]; then
                        PORTS=1
                        ERROR_PORTS="$ERROR_PORTS""$NUM ";
                fi
        done

        if [ $PORTS -eq "1" ]; then
                exit_ports=$STATE_CRITICAL
        elif [ $PORTS -eq "0" ]; then
            exit_ports=$STATE_OK
      fi
}

check_processes_red
check_ports
check_processes_yellow

final_exit=`expr $exit_ports + $exit_red + $exit_yellow`

if [ $final_exit -eq "0" ]; then
      echo "Bearerbox  is running"
      exitstatus=$STATE_OK
elif [ $final_exit -eq "1" ]; then
        echo "Bearerbox is down"
      exitstatus=$STATE_WARNING
elif [ $final_exit -ge "1" ]; then
      echo "Bearerbox is Down"
      exitstatus=$STATE_CRITICAL
fi

exit $exitstatus
 

Saturday 17 December 2011

HDR Photography


Photoshop HDR and Photomatix Tone Mapping
Introduction:
In this tutorial we will take a look at HDR photography. HDRI (High Dynamic Range Imaging) was originally used in 3D and is now in full force in photography. Basically it's the process of taking multiple exposures and merging them together into a single 32 bit image. Let me explain: A camera is capable of capturing a limited amount of tones in a single photo. Typically we sacrifice elements in a photo when we press the shutter. For example there is a powerful cloudscape and some cliffs. If we expose for the clouds the cliffs become dark. If we set the camera's exposure to capture detail in the cliffs, the brighter sky is blown out and detail is lost. This is because the human eye can see a larger range of tones than the camera can capture on the chip or film in a single photograph.
The solution is to take more than one photograph and bracket the photos. Shoot normal exposure, then under-expose a shot to capture highlights and over-expose a shot to capture shadow detail. Finally, merge these photos together to produce a single image with a larger range of tones that can now show all the details in the shadows and highlights. This tutorial will show you how to complete this process with the minimum fuss.
            First we need to get our source images. (You could begin with a 32 bit 3D image and then skip to step 6). Typically we will capture these with our camera. You will need to shoot a minimum of 2 photos with different exposure settings.
            It’s been recommended by Adobe to limit the bracketing by 1 stop and this will help reduce banding. You may also take 5 or more shots with a smaller gap in the bracketing. I personally get good results from 3 shots. I like to over expose and under expose by 2 stops. I know this is a bigger bracket than most people are comfortable with, but for the type of HDR images I like to create (cityscapes), this works great. If you’re shooting people, you may want to reduce this to even 3rd stops.
            (Note: You can't use a single raw image and exposure it several times as some people suggest, for a true HDR photo. This is known as pseudo-HDR. Photoshop will not allow you to merge these because there isn't sufficient tone detail captured).
Step 1:
Start with 3 images. One normal exposure, the second underexposed and the third overexposed. In this case I used 2 stop bracketing. As I shoot a lot of city scapes I can get away with 2 stops, because I'm mainly shooting flat surfaces and banding and posterization isn't such a problem. If your shooting rounded and curved surfaces you will want to lower your bracketing to get smoother gradients.
            I set the bracketing on my camera to 2 stops. Then I set the shooting mode to burst. When I hold the shutter down, 3 photos will be captured. I shoot in RAW mode for the widest possible dynamic range. You can still create HDR if your camera doesn't support RAW. Make sure you shoot in Aperture Priority or in Manual. You want to bracket the exposure time, not the Aperture. If you change the aperture, the depth of field won't be consistent and you'll get blurring. Also avoid any moving subjects in the photo or you'll get ghosting.

Step 2:
Time to merge the photos together into a single 32 bit image.
            Choose File>Automate >Merge to HDR. This works on Photoshop CS2 and CS3. (CS2 Doesn't have auto align). Choose either images or folder. I organize each set of photos in its own folder so I used the folder option. Select your photos to merge. Turn on Auto Align in Photoshop CS3. Click OK. (Photoshop CS3 uses new Auto-align technology that even allows you to create HDR without the use of a tripod!)


Step 3:
            Your images will now be merged into a single photo. You can turn off individual photos by un checking their boxes on the left filmstrip. If you get some blurring caused by camera shake in the longest exposure, you may want to turn off that photo.


Step 4:
            The merged result is a floating-point 32 bit image. You can adjust the overall tones by sliding the White Point slider. Easy with it, a little movement goes a long way!


Step 5:
            Click OK to merge the photos into a 32 bit image. Now is a good time to save your file.


Step 6:
            In order to use the photos, you'll need to convert them t 16 or 8 bit images. When we convert them we will create what I call interpretations of the photo. The reason I say this is because we have unlimited ways we can make the photo look. While we have this huge dynamic range available in 32 bit, we will no longer have those options after conversion. Always work from the saved 32 bit version, and then convert and save versions (personal interpretations). Avoid overwriting the 32 bit image, it's our master and we may want to go back to it many times.
            Choose Image>Mode>16 bit (or 8 bit). Now we get to play with some fun options. You're now at the tone mapping part of the process. This is were all the creativity can ooze.
            (If you want to make the adjustments without converting, choose view>32 Bit Preview Options. You can use several of Photoshop's tools in the Image>Adjustments menu. The most important of these is the Exposure control)
            You'll see an HDR Conversion Dialog box. Exposure and Gamma is the default option. Best way to approach this? Set the gamma first, then adjust the exposure to suit. If you want an image with lots of contrast, lower the gamma. For less contrast raise the gamma. Finally, adjust the exposure to get the desired brightness. If you want more control, read on... otherwise press OK to convert.


Step 7:
            Change the Method to Local Adaption. (There are 4 available methods, but these are the only 2 with user input).
            With local Adaption, you can adjust the curves. Set these like you would normally work in curves, but don't be afraid to clip the histogram a little. You can clip because your working with a larger dynamic range than you're used to. Bring out the detail in the image, but don't forget to put some shadow in there or it will look washed out and fake. Once your happy with the curve, adjust the radius and Threshold sliders to make sure there are no halos in the photo. (Badly converted HDR images have a glow around the areas of contrast.) The radius controls the mask blur while the threshold decides what gets blurred and what doesn't.
            Click ok to convert.


Step 8:
            Here we have a merged image from HDR. The second image is a variation. In the second variation, I applied exposure, curves and sharpening settings while in 32-bit mode (Highlight Compression Method). Photoshop is great for producing very realistic HDR images.


            Step 9:
            If you desire a more surreal result there is different plug-ins that you can use. My favourite is Photomatix pro from HDR soft. You can just get the tone mapping plug in for Photoshop which works great. Use the coupon code Photoshop cafe to save 15%.
            Using photomatix tone mapping plugin allows you to get highly detailed textures in your photographs. You merge in Photoshop as shown in this tutorial. Then choose Filter>Photomatix to apply tone mapping. Convert and save as normal.


            Step 10:
            This image shows an image after tone mapping using Photomatix pro.


Step 11:
          Here you can see comparisons between single images; subtle Photoshop HDR and a radical Photomatix effect (Click for larger image). Whatever result you’re after, hopefully this tutorial has helped demystify the HDR process.


Step 12:
            Here is another HDR shot of mine. This is a night scene converted to grayscale.


            I hope you enjoyed this tutorial!

Friday 16 December 2011

eth up/down

Up another LAN interface if one is link down
#!/bin/bash

# Periodically check a interface for link up.
# If found the current interface link down,
# up another interface and down the current interface.
# It consume about 0.3% of CPU and 0.1% of Memory.

while :
do

if [[ $(ip link show | grep eth0 | cut -d ',' -f 3) = UP ]]
then
echo eth0 Up > /dev/null
else
        if [[ $(ip link show | grep eth1 | cut -d ',' -f 3) = UP ]]
        then
        echo eth1 already Up > /dev/null
        else
        /sbin/ifup eth1 &> /dev/null
        /sbin/ifdown eth0 &> /dev/null
        fi
fi

sleep 1

if [[ $(ip link show | grep eth1 | cut -d ',' -f 3) = UP ]]
then
echo eth1 Up > /dev/null
else
        if [[ $(ip link show | grep eth0 | cut -d ',' -f 3) = UP ]]
        then
        echo eth0 already Up > /dev/null
        else
        /sbin/ifup eth0 &> /dev/null
        /sbin/ifdown eth1 &> /dev/null
        fi
fi

sleep 1

done

Friday 11 November 2011

Math Calculator

Basic Math Calculator

#!/bin/bash
echo "**** My calculator ****"
echo "M A I N - M E N U"
echo "1. Addition"
echo "2. Multiplication"
echo "3. Subtraction"
echo "4. Remainder"
echo "5. Divide"
echo -n "Please select your choice (1-5) : "
read choice
echo -n "Enter your first number : "
read n1
echo -n "Enter your second number : "
read n2
if [ $choice -eq 1 ]
then
        answer="$n1 + $n2 = $(( $n1 + $n2 ))"
elif [ $choice -eq 2 ]
then
        answer="$n1 x $n2 = $(( $n1 * $n2 ))"
elif [ $choice -eq 3 ]
then
        answer="$n1 - $n2 = $(( $n1 - $n2 ))"
elif [ $choice -eq 4 ]
then
        answer="$n1 % $n2 = $(( $n1 % $n2 ))"
elif [ $choice -eq 5 ]
then
        answer="$n1 / $n2 = $(( $n1 / $n2 ))"
else
        echo "Sorry please select number between 1-5 only"
        exit 1
fi
echo $answer




Sunday 6 November 2011

Useful Linux Commands


1. Find and Replace text in VI editor:
:%s/wallpaper/screensaver/g
It will change all "wallpaper" word to "screensaver" in the file.

2. To delete / free page-cache, den tries and inodes:
 # echo 3 >> /proc/sys/vm/drop_caches

3. To Make a empty large file:
# dd if=/dev/zero of=bigfile bs=1G count=4
It create a 4GB of empty file. 

4. Show information of Hard Disk:
# hdparm -I /dev/sda
# iostat -dx 2

5. To check Processor 32bit or 64bit:
# getconf LONG_BIT               (It show full hardware configuration)
# lshw                                           (Recquire to install this package)

6. Which service is listening on each port:
# nmap -T4 -A -v 127.0.0.1 -p 1-65535
                -T4: For faster execution.
                -A: To enable OS and version detection
                -v: To enable verbose mode
                -p: Port range for scan only specified ports

 7. Show which program are opening/listening on those ports:
# netstat -tulp      or,
# netstat --tcp --udp --listening --program

8. Delete RAID Metadata from Hard Drives:
# cat /dev/zero /dev/sdb           (Where "sdb" is device or target name for SCSI/SATA)

9. Kill process by using port number:
# fuser 8080/tcp -k                    (It will kill 8080 port) 

10. Change wav audio format to a-law (wav) format:
# sox input.wav -A -c 1 -r 8000 output.wav

11. Mount an ISO image under Linux:
# mount -o loop disk.iso /mnt/cdrom

12. Find partition UUID (Universally Unique Identifier)
# blkid

13. Find and move larger than 30 Mb files to destination directory:
 # find ./ -size +30M -exec mv {} /Pack/ \;

14. Force delete temp files older than 30 days:
# find /tmp -mtime +30 -exec rm -f {} \;

15. Show System Hardware information: The "dmidecode" is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description  of  the  system’s  hardware  components 
DMI TYPES: The SMBIOS specification defines the following DMI types:
       Type   Information
       ----------------------------------------
          0   BIOS
          1   System
          2   Base Board
          3   Chassis
          4   Processor
          5   Memory Controller
          6   Memory Module
          7   Cache
          8   Port Connector
          9   System Slots
         10   On Board Devices
         11   OEM Strings
         12   System Configuration Options
         13   BIOS Language
         14   Group Associations
         15   System Event Log
         16   Physical Memory Array
         17   Memory Device
         18   32-bit Memory Error
         19   Memory Array Mapped Address
         20   Memory Device Mapped Address
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
         24   Hardware Security
         25   System Power Controls
         26   Voltage Probe
         27   Cooling Device
         28   Temperature Probe
         29   Electrical Current Probe
         30   Out-of-band Remote Access
         31   Boot Integrity Services
         32   System Boot
         33   64-bit Memory Error
         34   Management Device
         35   Management Device Component
         36   Management Device Threshold Data
         37   Memory Channel
         38   IPMI Device
         39   Power Supply
         40   Additional Information
         41   Onboard Device
# dmidecode -t 16 --type 17
# dmidecode -t 16,17
# dmidecode -t memory
# dmidecode --type MEMORY



Sunday 2 October 2011

Recovery


Recovery in Linux

1. Repairing Linux ext2 or ext3 file system

            1. File system must be unmounted, we cannot repair it while it is running. Take system down to runlevel one (make sure to run all command as root user):
# init 1
            2. Unmount file system, for example if it is /home (/dev/sda3) file system then type command:
# umount /home     or
# umount /dev/sda3
            3. Now run fsck on the partition:
# fsck /dev/sda3
            However be sure to specify the file system type using -t option.
# fsck -t ext3 /dev/sda3     or
# fsck.ext3 /dev/sda3
            If we don't know our file system type then typing mount command will display file system type.
# mount
            The fsck will check the file system and ask which problems should be fixed or corrected. If we don't want type “y” every time then we can use pass -y option to fsck.
# fsck -y /dev/sda3
            Please not if any files are recovered then they are placed in /home/lost+found directory by fsck command.
            4. Once fsck finished, remount the file system:
# mount /home
            5. Go to multiuser mode
# init 3
            Read man page of fsck for more information. Make sure we replace “/dev/sda3” with our actual device name which filesystem is curupted.


2. Recover Root filesystem

            1. Try the fsck /dev/hda2 command to check the filesystem out.

            If that doesn't work. Try mke2fs -S /dev/hda2 which should write a new superblock without writing new inodes.
            Warning: Depending upon what the damage is, this (mkefs) command may make the missing data unsalvagable.

            2. We can try running this command that will run a check of your filesystem.

# /sbin/fsck -C -a /dev/hda2

            3. Open a terminal window.
# su -                                      (To switch to the root user)
# init 1                                                (To bring the system down to run level one)
            This only allows root access with no network access or daemons running.
# umount /dev/sda2                       (Unmount “/dev/sda2" file system, or partition, that we want to repair)
            Replace "/dev/sda2" with the correct device name for the partition. If the partition contains a single file system such as "/home", we can type the command "umount /home".
# fsck -y /dev/sda2             (To repair the file system)
# fsck -y -t ext3 /dev/sda2 (To repair the ext3 file system)
            This will ensure the file system is not corrupted by using the wrong file system type. The "-y" option will cause fsck to automatically fix any problems that are found.
            Repeat the "fsck" command until no more errors are reported.
# mount /dev/sda2             (To remount the file system)
# init 3                                                (To bring the system back to multi user mode)


3. Recover grub.conf boot loader file

            Step1: Insert Linux installer disk and boot with it. Go to Linux Rescue mode by firing this command.
boot: linux rescue

            Press Enter twice then select No and press Enter, then again press Enter for continue and finally press Enter for OK.  The sh prompt has appear.
sh-3.1# chroot /mnt/sysimage                (For make system the root environment)

            Step2: If we don’t know which is the boot directory, then fire bellow command? This will search and show the devices which contain the file.
sh-3.1# grub
grub> find /boot/grub/stage1 or,
grub> find /grub/stage1
            (hd0,0)
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
           
Step3: Creating grub.conf file:
sh-3.1# ls /boot/ > /boot/grub/grub.conf
sh-3.1# vi /boot/grub/grub.conf

            Delete all lines except vmlinuz-x.x.xx-x.xxx and initrd-x.x.xx-x.xxx.img also add and edit some lines. Here we add only minimum and necessary entries for booting Linux OS.

title Red Hat Enterprise Linux (2.6.18-8.el5)
            root (hd0,0)
            kernel /boot/vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet
            initrd /boot/initrd-2.6.18-8.el5.img

:wq
Descriptions:
            First line: This is the title which display during booting. You may change any title name.
            Second line: This is the boot directory. It includes hdd and its partition number.
            Third line: This is the kernel file path with its version number.  It include “ro” means read only, “root=LABLE=/” set / lable for root partition, rhgb means Red Hat Graphical Boot.

sh-3.1#          exit
            Remove Installer disk and boot system normally.


          Second Method
            You may boot Red Hat Linux which are Corrupted or Deleted grub.conf file without installere disk and also recovergrub.conf.
            Follow these steps:
            Boot the system normally.
grub> root (hd0,0)
grub> kernel /boot/vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet
grub> initrd /boot/initrd-2.6.18-8.el5.img
grub> boot

            After fire boot command the system is going to boot. After that create or edit the grub.conf file with vi editor.


4. Reinstall Grub in Linux Using a Live CD

            "Grub" is the bootloader most commonly used by Linux operating systems, allowing the loading of both the Linux OS as well as Windows and Mac-based systems. If the Grub bootloader becomes corrupted or the boot file is otherwise damaged, Linux or any other operating systems loaded by Grub will not be able to launch. Fortunately, a Grub bootloader installation is easy to fix if it becomes damaged; all we need is a "live CD" of the Linux installation that installed Grub, which is a special version of the operating system that is designed to run directly from a CD or DVD.

            Instructions:
            1. Insert the Linux live CD in our computer's CD or DVD drive, then reboot the computer. When the first BIOS page appears, press the key indicated to access the "Boot Menu" or "Boot Options."
            2. Select the drive that contains our Linux live CD. When prompted, press a key to allow computer to boot from the disc.
            3. Wait while the live CD loads the version of Linux that is installed on it. Once it has loaded, access the terminal (this is done in Linux distros such as Ubuntu by opening the "Applications" menu, selecting the "Accessories" folder, then choosing "Terminal" from the list of accessories.)
            4. Type "sudo grub" and press "Enter" key. This will set the operating system to "Grub mode" so that it can edit the bootloader.
            5. Type "find /boot/grub/stage1" and press "Enter" to locate the hard drive and partition where bootloader is located. Once we have find this information, type "root (hdX,Y)" and press "Enter" to access that partition; "X" should be the number of the hard drive and "Y" should be the number of the partition for the bootloader.
            6. Type "setup (hdX)" with "X" being the hard drive number and press "Enter." This will set up a new copy of the Grub bootloader in the partition. Once this is finished, type "quit" and press the "Enter" key again to quit the terminal.
            7. Remove the live CD from our computer and reboot it. The Grub bootloader should load as normal without the need for the live CD.


5. ext3 Filesystem Bad Superblock Recovery

            First, obtain the size of the damaged filesystem. If our system still has df functioning, we can run df and grab the filesystem size that way. The output reports the number of 1K (1,024 bytes) blocks the filesystem is using.
            Next, find a working system if the box with the broken filesystem has lost its root filesystem. Now, invoke the magic of dd. For example, my filesystem showed up as using 101,086 blocks. So I used the following command:
# dd if=/dev/zero of=/tmp/temp bs=1024 count=101086
            Now, we’re nearly finished. Finally, build an ext3 filesystem on our new file.
# mkfs.ext2 /tmp/temp
mke2fs 1.32 (09-Nov-2002)
/tmp/temp is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
25272 inodes, 101086 blocks
5054 blocks (5.00%) reserved for the super user
First data block=1
13 block groups
8192 blocks per group, 8192 fragments per group
1944 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729
            (Not here I used “mkfs.ext2”, but the results are the same.)
            Look, our missing superblocks are revealed!
            Now, to recover, call fsck.ext3 on the damaged system.
# /sbin/fsck.ext3 -b 57345 /dev/sda1
            Carefully evaluate the prompts and decide if we want to allow fsck to proceed with filesystem repairs. If the backup superblock is also invalid, try another or follow the steps above again and double check the numbers.
            But what if we don’t have enough space to create a file as big as our lost partition? If that is the case or the partition is so huge we don’t want to wait that long for dd to complete, there is another option. The superblock locations vary depending on the blocksize used. The ext3 filesystem varies between 1024, 2048, and 4096 bytes depending on the size of the filesystem. Since the locations are neither magic or random, we can create, say, a 500MB partition and force the blocksize to match that of the damaged filesystem.
# /sbin/mkfs.ext3 -j -b 4096 /tmp/temp
            The presence or absence of a journal does not effect the location of the backup superblocks.

6. Recovering deleted /etc/shadow file

Boot system in single user mode.
sh-3.1# pwconv                              (It create shadow file from passwd file)
sh-3.1# passwd                              (For change root password)
            Enter new root password twice.
sh-3.1# startx                                   (Start system in run level 5)
            After that restore original shadow file from the backup.

Boot to UEFI Mode or legacy BIOS mode

Boot to UEFI Mode or legacy BIOS mode Choose UEFI or legacy BIOS modes while installing Windows. After Windows is installed, if you nee...