Feb 26, 2013

How to find a system 32 or 64 bit

In any Linux variants either one of this should work ( Redhat, Cent-Os, Ubuntu, Hp-ux, Solaris etc )

[mohan@chinna ~]$ arch
x86_64
[mohan@chinna ~]$ uname -m
x86_64
[mohan@chinna ~]$ getconf LONG_BIT
64


As you can guess, 64 / x86_64 is 64bit system, whereas 32 / i386 / i686  denotes its a 32 bit sytem.


For windows
Right-click MyComputer->Properties

It will bring a window like below image, from that you can check the system type

Feb 25, 2013

How to edit iptables in linux

Problem:
sometimes you may receive below error like

The description for Event ID ( 0 ) in Source ( sshd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: sshd: PID 2992: Accepted publickey for build from 10.69.250.31 port 33344 ssh2.

Solution :
Either Turn off the firewall in linux or add the port 22 as exception in iptables

To disable selinux  edit /etc/sysconfig/selinux    and set SELINUX to disabled.

SELINUX=disabled

I've encountered such problems when the binaries and libraries were not
executable by SYSTEM.
"chmod 755 /usr/sbin/* /usr/bin/*" fixed the problem.

If the problem still exists, add the port to the iptables.

For adding port 22 to the iptables, from shell run

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

or

edit /etc/sysconfig/iptables
and append this line

-A INPUT -p tcp --dport 22 -j ACCEPT
Save and close the file. Restart iptables:
/etc/init.d/iptables restart
or
service iptables restart
Learn more about iptables by
man iptables

Feb 24, 2013

How to add Gnome to a CentOS 6 minimal install

Problem:
sometimes you may receive below error like

The description for Event ID ( 0 ) in Source ( sshd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: sshd: PID 2992: Accepted publickey for build from 10.69.250.31 port 33344 ssh2.

Solution :
Either Turn off the firewall in linux or add the port 22 as exception in iptables

To disable selinux  edit /etc/sysconfig/selinux    and set SELINUX to disabled.

SELINUX=disabled

I've encountered such problems when the binaries and libraries were not
executable by SYSTEM.
"chmod 755 /usr/sbin/* /usr/bin/*" fixed the problem.

If the problem still exists, add the port to the iptables.

For adding port 22 to the iptables, from shell run

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

or

edit /etc/sysconfig/iptables
and append this line

-A INPUT -p tcp --dport 22 -j ACCEPT

Feb 23, 2013

How to Sync Google Calendar, Outlook and iPhone Calendar

Please refer the below url
http://email.about.com/od/googlecalendartips/qt/Sync_Outlook_Google_Calendar_and_iPhone_Calendar.htm

Feb 22, 2013

How to create checksums for all files recursively

To create checksums for all files recursively

find . -type f -exec md5sum "{}" +;

Feb 21, 2013

How to find a machine whether its a physical machine or a Virtual machine in linux.

You can get this information by using a tool called dmidecode. dmidecode  is a tool for dumping a computerâs DMI (some say SMBIOS) ta-
       ble contents in a human-readable format. This table contains a descrip-
       tion  of  the  systemâs  hardware  components,  as well as other useful
       pieces of information such as serial numbers and BIOS revision.  Thanks
       to  this  table,  you  can  retrieve this information without having to
       probe for the actual hardware.

[root@server2 tmp]# /usr/sbin/dmidecode |grep -i "vm"
                Manufacturer: VMware, Inc.
                Product Name: VMware Virtual Platform
                Serial Number: VMware-24 34 c4 76 3b 1a 94 8d-99 08 5d cc 81 04                            17 25
                        VME (Virtual mode extension)
                        VME (Virtual mode extension)
                Description: VMware SVGA II
                String 1: [MS_VM_CERT/SHA1/27d66596a61c48dd323409dfd5126e33f59                           ae7]
               

               
For a physical machine it will be like below

[mohan@server2 storage]# sudo /usr/sbin/dmidecode |grep -i "vm"
                VME (Virtual mode extension)
                VME (Virtual mode extension)
               

Feb 20, 2013

Different options of reverting files in Perforce


p4 revert //...
Revert every file you have open, in every one of your pending changelists, to its pre-opened state.

p4 revert -c default //...
Revert every file open in the default changelist to its pre-opened state.

p4 revert -n *.txt
Preview a reversion of all open .txt files in the current directory, but don't actually perform the revert.

p4 revert -c 31 *.txt
Revert all .txt files in the current directory that were open in changelist 31.

p4 revert -a
Revert all unchanged files. This command is often used before submitting a changelist.