January 3, 2011

November 22, 2010

Memory Usage in Linux

cat /proc/meminfo

Refer : http://www.redhat.com/advice/tips/meminfo.html
free -m

total used free shared buffers
cached
Mem: 7977 7752 224 0 174
5760
-/+ buffers/cache: 1818 6159
Swap: 7931 0 7931

'free' shows that most of the available memory is used by pagecache (disk cache), to avoid disk access and speed up file access. That memory can be reclaimed anytime if a process needs it.

If there is memory to spare, linux uses it for caching. It retains old programs in memory under the assupption they may be used again. Thus the first time you open ooffice it takes longer than the second. If that memory is needed by a running process, it is released from cache.

Worry if it starts swapping.
top -n 1
or
ps efax -o command,vsize,rss,%mem,size
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo

You can also examine some of your larger executables to see if they were built with the appropriate compiler and linker options. To identify the largest programs, try using a command such as this:
ls -s1 /bin /usr/bin /usr/bin/X11 | sort -n | tail

Memory use by which process Centos / RHEL /Fedora
#ps aux | awk '{if ($5 != 0 ) print $2,$5,$6,$11}' | sort –k2n

November 9, 2010

Command prompts for Windows

Here is a list of commands you can use under Microsoft Windows prearranged depending of their functionality :

* Control Panel
* Windows utility and applications
* Disk management
* Connection management
* Miscellaneous commands


Control Panel

* CONTROL: opens the control panel window
* CONTROL ADMINTOOLS: opens the administrative tools
* CONTROL KEYBOARD: opens keyboard properties
* CONTROL COLOUR: opens display properties.Appearance tab
* CONTROL FOLDERS: opens folder options
* CONTROL FONTS: opens font policy management
* CONTROL INTERNATIONAL or INTL.CPL: opens Regional and Language option
* CONTROL MOUSE or MAIN.CPL: opens mouse properties
* CONTROL USERPASSWORDS: opens User Accounts editor
* CONTROL USERPASSWORDS2 or NETPLWIZ: User account access restrictions
* CONTROL PRINTERS: opens faxes and printers available
* APPWIZ.CPL: opens Add or Remove programs utility tool
* OPTIONALFEATURES: opens Add or Remove Windows component utility
* DESK.CPL: opens display properties. Themes tab
* HDWWIZ.CPL: opens add hardware wizard
* IRPROPS.CPL: infrared utility tool
* JOY.CP: opens game controllers settings
* MMSYS.CPL: opens Sound and Audio device Properties. Volume tab
* SYSDM.CPL: opens System properties
* TELEPHON.CPL: Opens phone and Modem options
* TIMEDATE.CPL: Date and Time properties
* WSCUI.CPL: opens Windows Security Center
* ACCESS.CPL: opens Accessibility Options
* WUAUCPL.CPL: opens Automatic Updates
* POWERCFG.CPL: opens Power Options Properties
* AZMAN.MSC: opens authorisation management utility tool
* CERTMGR.MSC: opens certificate management tool
* COMPMGMT.MSC: opens the Computer management tool
* COMEXP.MSC or DCOMCNFG: opens the Computer Services management tool
* DEVMGMT.MSC: opens Device Manager
* EVENTVWR or EVENTVWR.MSC: opens Event Viewer
* FSMGMT.MSC: opens Shared Folders
* NAPCLCFG.MSC: NAP Client configuration utility tool
* SERVICES.MSC: opens Service manager
* TASKSCHD.MSC or CONTROL SCHEDTASKS: opens Schedule Tasks manager
* GPEDIT.MSC: opens Group Policy utility tool
* LUSRMGR.MSC: opens Local Users and Groups
* SECPOL.MSC: opens local security settings
* CIADV.MSC: opens indexing service
* NTMSMGR.MSC: removable storage manager
* NTMSOPRQ.MSC: removable storage operator requests
* WMIMGMT.MSC: opens (WMI) Window Management Instrumentation
* PERFMON or PERFMON.MSC: opens the Performance monitor
* MMC: opens empty Console
* MDSCHED: opens memory diagnostics tools
* DXDIAG: opens DirectX diagnostics tools
* ODBCAD32: opens ODBC Data source Administrator
* REGEDIT or REGEDT32: opens Registry Editor
* DRWTSN32: opens Dr. Watson
* VERIFIER: opens Driver Verifier Manager
* CLICONFG: opens SQL Server Client Network Utility
* UTILMAN: opens Utility Manager
* COLORCPL: opens color management
* CREDWIZ: back up and recovery tool for user passwords
* MOBSYNC: opens Synchronization center
* MSCONFIG: opens System Configuration Utility
* SYSEDIT: opens System Configuration Editor (careful while using this command)
* SYSKEY: Windows Account Database Security management (careful while using this command)


Windows utility and applications

* EPLORER: Opens windows Explorer
* IEXPLORER: Opens Internet explorer
* WAB: opens Contacts
* CHARMAP: opens Character Map
* WRITE: opens WordPad
* NOTEPAD: opens Notepad
* CALC: opens Calculator
* CLIPBRD: opens Clipbook Viewer
* WINCHAT: opens Microsoft Chat Interface
* SOUNDRECORDER: opens sound recording tool
* DVDPLAY: run CD or DVD
* WMPLAYER: opens Windows Media Player
* MOVIEMK: Opens untitled Windows Movie Maker
* OSK: opens on-screen Keyboard
* MAGNIFY: opens Magnifier
* WINCAL: opens Calendar
* DIALER: opens phone Dialer
* EUDCEDIT: opens Private Character Editor
* NDVOL: opens the mixer volume
* RSTRUI : opens Tool System Restore (For Vista only)
* %WINDIR%\SYSTEM32\RESTORE\rstrui.exe: opens Tool System Restore (for XP only).
* MSINFO32: Opens the System Information
* MRT : launches the utility removal of malware.
* Taskmgr : Opens the Windows Task Manager
* CMD: opens a command prompt
* MIGWIZ: Opens the tool for transferring files and settings from Windows (Vista only)
* Migwiz.exe: Opens the tool for transferring files and settings from Windows (for XP only)
* SIDEBAR: Open the Windows (Vista only)
* Sigverif : Opens the tool for verification of signatures of files
* Winver : Opens the window for your Windows version
* FSQUIRT: Bluetooth Transfer Wizard
* IExpress opens the wizard for creating self-extracting archives. Tutorial HERE
* MBLCTR: opens the mobility center (Windows Vista only)
* MSRA : Opens the Windows Remote Assistance
* Mstsc : opens the tool connection Remote Desktop
* MSDT: opens the diagnostic tools and support Microsoft
* WERCON: opens the reporting tool and solutions to problems (for Vista only)
* WINDOWSANYTIMEUPGRADE: Enables the upgrade of Windows Vista
* WINWORD : opens Word (if installed)
* PRINTBRMUI : Opens migration wizard printer (Vista only)


Disk management

* DISKMGMT.MSC: opens disk management utility
* CLEANMGR: opens disk drive clean up utility
* DFRG.MSC: opens disk defragmenter
* CHKDSK: complete analysis of disk partition
* DISKPART: disk partitioning tool


Connection management

* IPCONFIG: list the configuration of IP addresses on your PC (for more information type IPCONFIG/? in the CMD menu)
* INETCPL.CPL: opens internet properties
* FIREWALL.CPL: opens windows firewall
* NETSETUP.CPL: opens network setup wizard


Miscellaneous commands

* JAVAWS: View the cover of JAVA software (if installed)
* AC3FILTER.CPL: Opens the properties AC3 Filter (if installed)
* FIREFOX: Mozilla launches Firefox (if installed)
* NETPROJ: allow or not connecting to a network projector (For Vista only)
* LOGOFF: closes the current session
* SHUTDOWN: shut down Windows
* SHUTDOWN-A: to interrupt Windows shutdown
* %WINDIR% or %SYSTEMROOT%: opens the Windows installation
* %PROGRAMFILES%: Opens the folder where you installed other programs (Program Files)
* %USERPROFILE%: opens the profile of the user currently logged
* %HOMEDRIVE%: opens the browser on the partition or the operating system is installed
* %HOMEPATH%: opens the currently logged user C: \ Documents and Settings \ [username]
* %TEMP%: opens the temporary folder
* VSP1CLN: deletes the cache for installation of the service pack 1 for Vista
* System File Checker (Requires Windows CD if the cache is not available):
o SFC / scannow: immediately scans all system files and repairs damaged files
o SFC / VERIFYONLY: scans only those files system
o SFC / Scanfil = "name and file path": scans the specified file, and repaired if damaged
o SFC / VERIFYFILE = "name and file path": Scans only the file specified
o SFC / scanonce: scans the system files on the next restart
o SFC / REVERT: return the initial configuration (For more information, type SFC /? In the command prompt CMD.

November 8, 2010

How to back up and restore Outlook Express items

How to back up and restore Outlook Express items

Step 1: Copy message files to a backup folder

Step A: Locate the Store folder
1. Start Outlook Express.

2. Click Tools, and then click Options.

3. On the Maintenance tab, click Store Folder.

4. In the Store Location dialog box, copy the store location. To do this, follow these steps:

a. Put the mouse pointer at one end of the box under the Your personal message store is located in the following folder box.
b. Press and hold the left mouse button, and then drag the mouse pointer across the Your personal message store is located in the following folder box.
c. Press CTRL+C to copy the location.
5. Click Cancel, and then click Cancel again to close the dialog box.

Step B: Copy the contents of the Store folder

1. Click Start, click Run, press CTRL+V, and then click OK.
2. On the Edit menu, click Select All.
3. On the Edit menu, click Copy, and then close the window.

Step C: Create a backup folder

1. Create an new Folder.
2. Type Mail Backup for the folder name, and then press ENTER.

Step D: Paste the contents of the Store folder into the backup folder

1. Double-click the Mail Backup folder to open it.
2. Right-click inside the Mail Backup folder window, and then click Paste.

Step 2: Export the Address Book to a .csv file

To export the Address Book to a .csv file, follow these steps:
1. On the File menu, click Export, and then click Address Book.
2. Click Text File (Comma Separated Values), and then click Export.
3. Click Browse.
4. Select the Mail Backup folder that you created.
5. In the File Name box, type address book backup, and then click Save.
6. Click Next.
7. Click to select the check boxes for the fields that you want to export, and then click Finish.
8. Click OK, and then click Close.

How to restore Outlook Express items

Note To restore items when you use multiple identities in Outlook Express, you may have to re-create the identities before you follow these steps. Repeat each step as needed for each identity.

Step 1: Import messages from the backup folder

1. On the File menu, point to Import, and then click Messages.
2. In the Select an e-mail program to import from box, click Microsoft Outlook Express 5 or Microsoft Outlook Express 6, and then click Next.
3. Click Import mail from an OE5 store directory or Import mail from an OE6 store directory, and then click OK.
4. Click Browse, and then click the Mail Backup folder.
5. Click OK, and then click Next.
6. Click All folders, click Next, and then click Finish.

Or Just copy all the files in the Mail Backup to the Store Folder.

Step 2: Import the Address Book file

1. On the File menu, click Import, and then click Other Address Book.
2. Click Text File (Comma Separated Values), and then click Import.
3. Click Browse.
4. Select the Mail Backup folder, click the address book backup.csv file, and then click Open.
5. Click Next, and then click Finish.
6. Click OK, and then click Close.

November 6, 2010

Installation of a program in Safe Mode

In Safe Mode, Windows has reduced functionality, because only the core components have been loaded. In such an environment it is much easier to get rid of an application that has gone mad. Windows Safe Mode can be entered by pressing the F8 key before Windows boots up.


To edit Registry for your installer to work follow the steps below.

Start -> Run -> type CMD

In the window please type the below content
Code:

REG ADD HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\MSIServer” /VE /T REG_SZ /F /D "Service"

Reboot your system

Try again.

September 4, 2010

Recovering Password of Windows Server 2008

The following approach can be used only in cases where we have forgotten the password or it has been changed by a third party for reasons beyond us.

Note: Do NOT use this approach to backdoor any server in your work environment!

Tools used for this demonstration:
PING (Partimage Is Not Ghost)
Download: http://ping.windowsdream.com/ping/Releases/3.00.01/PING-3.00.iso (~22MB)

The workaround:

1) Boot with PING Linux distribution
2) fdisk -l | grep NTFS
3) mkdir -p /mnt/windows
4) mount -t ntfs-3g /dev/sda1 /mnt/windows
5) cd /mnt/windows/Windows/System32
6) mv Magnify.exe Magnify.bck
7) cp cmd.exe Magnify.exe and reboot


Booting into Windows Server 2008:

1) Click on Ease Of Access
2) Select “Make items on the screen larger (Magnifier)
3) Click OK
4) On Command Prompt type explorer

Interacting with Windows Explorer
From here you can change the password

The following approach can be used with Windows Vista and also by any other Ease Of Access tools or even by Ease Of Access itself by renaming “utilman.exe” to “cmd.exe”.

Further you can refer from this link:

July 8, 2010

RAID: Using Multiple Hard Drives for Performance and Reliability

Back in the late 1980's and early 1990's, computer information servers were encountering a dramatic increase in the amount of data they needed to serve and store. Storage technologies were getting very expensive to place a large number of high capacity hard drives in the servers. A solution was needed and thus RAID was born.

So what exactly is RAID? First of all, the acronym stands for Redundant Array of Inexpensive Disks. It was a system developed whereby a large number of low cost hard drives could be linked together to form a single large capacity storage device that offered superior performance, storage capacity and reliability over older storage solutions. It has been widely used and deployed method for storage in the enterprise and server markets, but over the past 5 years has become much more common in end user systems.

You Can follow the below for RAID Calculator to find the disk space.

http://www.ibeast.com/content/tools/RaidCalc/RaidCalc.asp


RAID 0

The lowest designated level of RAID, level 0, is actually not a valid type of RAID. It was given the designation of level 0 because it fails to provide any level of redundancy for the data stored in the array. Thus, if one of the drives fails, all the data is damaged.

RAID 0 uses a method called striping. Striping takes a single chunk of data like a graphic image, and spreads that data across multiple drives. The advantage that striping has is in improved performance. Twice the amount of data can be written in a given time frame to the two drives compared to that same data being written to a single drive.

Below is an example of how data is written in a RAID 0 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2
Block 1 1 2
Block 2 3 4
Block 3 5 6

Thus, if the 6 blocks of data above constitute a single data file, it can be read and written to the drive much faster than if it were on a single drive. Each drive working in parallel could read only 3 physical blocks while it would take a single drive twice as long because it has to read 6 physical blocks. The drawback of course is that if one drive fails, the data is no longer functional. All 6 data blocks are needed for the file, but only three are accessible.

Advantages:

* Increased storage performance
* No loss in data capacity

Disadvantages:

* No redundancy of data

RAID 1

RAID version 1 was the first real implementation of RAID. It provides a simple form of redundancy for data through a process called mirroring. This form typically requires two individual drives of similar capacity. One drive is the active drive and the secondary drive is the mirror. When data is written to the active drive, the same data is written to the mirror drive.

The following is an example of how the data is written in a RAID 1 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2
Block 1 1 1
Block 2 2 2
Block 3 3 3

This provides a full level of redundancy for the data on the system. If one of the drives fails, the other drive still has all the data that existed in the system. The big drawback of course is that the capacity of the RAID will only be as big as the smallest of the two drives, effectively halving the amount of storage capacity if the two drives were used independently.

Advantages:

* Provides full redundancy of data

Disadvantages

* Storage capacity is only as large as the smallest drive
* No performance increases
* Some downtime to change active drive during a failure

RAID 0+1

This is a hybrid form of RAID that some manufacturers have implemented to try and give the advantages of each of the two versions combined. Typically this can only be done on a system with a minimum of 4 hard drives. It then combines the methods of mirroring and striping to provide the performance and redundancy. The first set of drives will be active and have the data striped across them while the second set of drives will be a mirror of the data on the first two.

Below is an example of how data is written in a RAID 0+1 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2 Drive 3 Drive 4
Block 1 1 2 1 2
Block 2 3 4 3 4
Block 3 5 6 5 6

In this case, the data blocks will be striped across the drives within each of the two sets while it is mirrors between the sets. This gives the increased performance of RAID 0 because it takes the drive half the time to write the data compared to a single drive and it provides redundancy. The major drawback of course is the cost. This implementation requires a minimum of 4 hard drives.

Advantages:

* Increased performance
* Data is fully redundant

Disadvantages:

* Large number of drives required
* Effective data capacity is halved

RAID 10 or 1+0

RAID 10 is effectively a similar version to RAID 0+1. Rather than striping data between the disk sets and then mirroring them, the first two drives in the set are a mirrored together. The second two drives form another set of disks that is are mirror of one another but store striped data with the first pair. This is a form of nested RAID setup. Drives 1 and 2 are a RAID 1 mirror and drives 3 and 4 are also a mirror. These two sets are then setup as stripped array.

Below is an example of how data is written in a RAID 10 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2 Drive 3 Drive 4
Block 1 1 1 2 2
Block 2 3 3 4 4
Block 3 5 5 6 6

Just like the RAID 0+1 setup, RAID 10 requires a minimum of four hard drives to function. Performance is pretty much the same but the data is a bit more protected than the RAID 0+1 setup.

Advantages:

* Increased performance
* Data is fully redundant

Disadvantages:

* Large number of drives required
* Effective data capacity is halved

RAID 5

This is the most powerful form of RAID that can be found in a desktop computer system. Typically it requires the form of a hardware controller card to manage the array, but some desktop operating systems can create these via software. This method uses a form of striping with parity to maintain data redundancy. A minimum of three drives is required to build a RAID 5 array and they should be identical drives for the best performance.

Parity is essentially a form of binary math that compares two blocks a data and forms a third data block based upon the first two. The easiest way to explain it is even and odd. If the sum of the two data blocks is even, then the parity bit is even. If the sum of the two data blocks is odd, the parity bit is odd. So 0+0 and 1+1 both equal 0 while 0+1 or 1+0 will equal 1. Based on this form of binary math, a failure in one drive in the array will allow the parity bit to reconstruct the data when the drive is replaced.

With that information in mind, here is an example of how a RAID 5 array would work. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block. A "P" indicates a parity bit for two blocks of data.
Drive 1 Drive 2 Drive 3
Block 1 1 2 P
Block 2 3 P 4
Block 3 P 5 6

The parity bit shifts between the drives to increase the performance and reliability of the data. The drive array will still have increased performance over a single drive because the multiple drives can write the data faster than a single drive. The data is also fully redundant because of the parity bits. In the case of drive 2 failing, the data can be rebuilt based on the data and parity bits on the two remaining drives. Data capacity is reduced due to the parity data blocks. In practice the capacity of the array is based on the following equation where n is the number of drives and z is the capacity:

(n-1)z = Array Capacity

In the case of three 500 gigabyte hard drives, the total capacity would be (3-1)x500GB or 1000 gigabytes.

Hardware RAID 5 implementations can also have a function called hot swap. This allows for drives to be replaced while the array is still functioning to either increase the drives capacity or to replace a damaged drive. The drive controller then takes time while the array is running to rebuild the data array across the drives. This is a valuable feature for systems that require 24x7 operation.

Advantages:

* Increased storage array performance
* Full data redundancy
* Ability to run 24x7 with hot swap

Disadvantages

* High costs to implement
* Performance degrades during rebuilding

Drive Selection

For the best results, all hard drives in the array should be the same brand and model. This means that all of the hard drives will have the same capacity and performance levels. It is not a requirement that the drives be matched, but mismatching the drives can actually hurt the RAID array.

The capacity of the RAID array will depend upon the method implemented. In the case of RAID 0, the striping can only be done across an equal amount of space on the two drives. As a result, if an 80GB and 100GB drive are used to make the array, the final capacity of the array would only be 160GB. Similarly, in RAID 1 the drives can only mirror data equal to the smallest size. Thus based on the two drives mentioned before, the final data size would only be 80GB. RAID 5 is a bit more complicated because of the formula mentioned before. Once again the smallest capacity would be used. So if a 80GB, 100 GB and 120GB drive were used to make a RAID 5 array, the final capacity would be 160GB of data.

You can refer below links for more details.

http://compreviews.about.com/od/storage/l/aaRAIDPage1.htm
http://www.prepressure.com/library/technology/raid