Tuesday, May 3, 2011

How to find a machine is 32 or 64 bit

Normally we confuse between whether a CPU or OS is 64/32 bits.. Here is some clarity. 

Linux :
=====
To find kernel is 64 or 32 bit:
-----------------------------
shell # uname -a
Linux vscn1u.rchland.ibm.com 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

If "x86_64" or "ia64" is mentioned, it means the kernel(OS) is 64 bit, otherwise its 32 bit.

To find whether a CPU is 64 or 32 bit :
---------------------------------------
1) shell # grep flags /proc/cpuinfo

    In the output if you see
    1. rm means: 16 bit processor
    2. tm means: 32 bit processor
    3. lm means: 64 bit processor

 2) shell # getconf LONG_BIT
     The output will say directly whether the processor is 32 or 64 bit.

Windows :
=======
To find whether the OS is 32 or 64 bit :
----------------------------------------
For Windows XP / Vista / Server 2003 :

For windows 7 :
1. Right click Computer -> Properties
    .. This will open up a window
2. Look at System Type field. It will directly say whether window 7 is 32 or 64 bit.

Monday, May 2, 2011

Linux Top command - Handy info

  • top -h for a condensed list of commands, 
  • man top for a much more verbose explanation of all available options.
  • It has a powerful interactive mode You can use a variety of commands in form of just letter key presses to manipulate what you are seeing. Here are a few examples.
  • To sort processes by memory usage simply press M (shift-m on the keyboard). 
  • To sort by CPU usage press P (shift-p). 
  • You can see a full list of fields by pressing f which will show the fields with their appropriate letter (which you can use to sort by that field).
  • With the key you can also opt to add a new field to display by pressing f and then the letter representing the key. For example if you want to add a code size field (CODE) press f and then r (as shown in the field list).
  • You can set the delay time for updates by just pressing s, putting in a desired number of seconds, and pressing enter. It will then update in that number of seconds, but you can update any time you want yourself by pressing the space bar. 
  • To change the number of processes shown just press n, put in the desired number and press enter.  
  • You can even kill processes from within top if you have a rogue process or a program of some kind wont quit or some process is using too many resources. To do so press k, enter the PID (Process ID, which you can read in top) of that process and press enter.
  • Linux top also supports the cumulative mode which can be simply toggled by pressing (shift-s). 
  • Start top with some options already set. 
  • For example, top -d 5 will cause top to refresh its data every five seconds (equivalent to s and 5 in the interactive mode). 
  • The top -q will display information without any delay, and run it with highest priority if top is run as a superuser (or root).
  • Top can also be started to show only a few updates and then quit automatically. Just run top -n 10, for instance, to have top show 10 iterations of information before quitting.
  • Another interesting command line option is top -b which runs top in a batch mode suitable for recording into a text file. Instead of just refreshing information on screen it prints it out in batches every specified number of seconds until all iterations run out (set by -n as mentioned above) or until it is quit. To write it out into a text file called top.txt stored in a local directory just run top -b > top.txt.
  • To quit top manually,just press the q key.

Thursday, February 10, 2011

Show Desktop Icon missing in Windows

The "Show Desktop" Icon is really helpful, when we have multiple windows open.. But sometimes, we may accidentally delete it.  Here is a way, how you can recreate it.  This tip can be used for Windows 2000, XP, Vista and Windows 7


 Follow these steps:
  1. Click on Start > Run
  2. Type: Notepad
  3. Press Enter
  4. Copy and paste these codes in your new text file:
    [Shell]
    Command=2
    IconFile=explorer.exe,3
    [Taskbar]
    Command=ToggleDesktop

   5. Save it as Show Desktop.scf
   6. Now right click on your taskbar and select “Unlock Taskbar”
   7. Drag the Show Desktop.scf file to the quick launch region!