Monday, June 13, 2011

Daily command in linux server

Enable auto run on service guard package

    cmmodepkg -v -e packagename
   
New user creation file with password "Colt1234"defaulty

    useradd -p PHVI86MeOtRlg

userdbget/userdbset in Cluster Servers for failure logins

    userdbget -i -u <username>
    userdbset -d -u <username> AUTH_MAXTRIES

How to check big files under any filesystem

    find . -xdev -size +10000000c -exec ls -lrt {} \;

How to compress files in larger size

while :;do read L;T=/tmp/p1;gzip -9 <$L >$T && tail -1000 $L >$T-2 && cat $T-2 >$L && mv $T $L.`date +"%d%m%Y"`.gz;rm -f $T-2; echo ok;done
du - sk * | sort -n

nfs options that we user by default

cd /stage <on the required server>

# showmount -e <server name>
# mount -o soft,intr,rsize=32768,wsize=32768,timeo=30,retrans=999,retry=999 lonunx01:/dbarecovery /stage


To find a word / string value in a file /dir in Linux / HP-UX

# grep <word/string value> *

To Enable Packages on Cluster Server in HP-UX

Login with root : su –
Password: xxxxxxxxx
<root># cmviewcl
# cmmodpkg –v –e <package name>


To find utilization of folder size in file system
# du -sk * | sort -n

To search whether the pacakage is installed / not in HP-UX
# swlist -l product | gerp -i <package name>

To search a file in a complete filesystem in HP-UX
# find / |grep <filename>

To search a file # whereis <filename>

To copy a file/dir from one server to another in both unix
# scp <file/dir> <username>@remotehost:<destination path>

To change ownership of a file/dir in Both Unix
# chown <ownername>:<groupname> <filename>
# chown -R <ownername>:<groupname> <dir name>



portnumbers in servers

port number                application
21                         ftp
22                         ssh
23                         telnet
25                          smtp mail port
53                         dns port
67                         dhcp server
79                         finger command for smtp mail server ETRN finger port
80                         http port
110                        pop3 port
115                       sftp port
123                       network time protocal port
143                       imap4 port
177                       xmanager port tcp
389                       ldap port
443                       hhtp port (ssl)
445                       microsoft active directory and smb protocal port
465                       google mail outgoing mail server
636                       ldap(ssl)
993                       secure internet message access protocalport
1433                      sql server port
1434                      sql  server monitoring port
1521                      oracle port
2000                      cisco ip phone port
3306                      default mysql port
3389                      remote desktop port and terminal server port
5900                      real vnc default remote control port
6000                     tcp port for xmanager port
8080                     http internet traffic port

Sunday, June 12, 2011

NFSv4 New Features

File system name space
NFSv4 provides a different model file system name-space model than did previous versions. Servers, rather than exporting multiple file systems, export a single "pseudo file system," formed from multiple actual file systems, and potentially customized for each client.

NFSv4 as a stateful protocol
Previous NFS protocols were stateless in the sense that the NFS server maintained no information or state about its clients.NFSv4, however, is stateful; the NFSv4 server maintains information about its clients, the files they hold open, and locks.Using stateful design enhance performance and scalability.

Delegation
Clients may perform operations on files with minimal interaction with the server. NFSv4 introduces file delegation. An NFSv4 server can allow an NFSv4 client to access and modify a file in it's own cache without sending any network requests to the server, until the server indicates via a callback that another client wishes to access a file. This reduces the amount of traffic between NFSv4 client and server considerably in cases where no other clients wish to access a set of files concurrently.

Security
A strong security model is mandated, where client/server interactions are done using the GSS-API framework. Three security mechanisms are needed: Kerberos, LIPKEY, and SPKM-3. Which one is actually used is negotiated between client and server. Security principals are now given as strings (e.g., user@domain) rather than as user IDs as was done in the earlier versions. Authorization uses both standard UNIX-like permissions as well as Windows ACLs.

How to Recover from Corrupted RPM Database

When installing rpm packages or using up2date to update packages  on Oracle / RedHat Enterprise Linux, you may get the following error,

$ sudo up2date --nox --register
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30978) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30978)
error: cannot open Packages database in /var/lib/rpm
An error has occurred:
exceptions.TypeError
See /var/log/up2date for more information

This error is caused by a corrupted RPM database, run the following commands to recover the database.
# cd /var/lib/rpm
# rm -f __db.*
# rpm --rebuilddb

The "--rebuilddb" rebuilds the database indices from the installed RPM package headers.

Saturday, June 11, 2011

Gnome Network Manager VPN Tab Disabled on linux

I've the NetworkManager service is installed and started under Linux desktop. The applet is running. The NetworkManager can display available network hardware and wireless networks. But, I'm unable to add VPN support as the Add tab is greyed out. I need to use both PPTP and Cisco vpn clients. How do I fix this problem under Debian or Ubuntu Linux?

The Gnome NetworkManager has pluggable support for VPN software, including Cisco compatible VPNs (using vpnc), openvpn, and Point-to-Point Tunneling Protocol (PPTP). You need to simply install the NetworkManager VPN plugin and configure the user's machines with the VPN's settings. The first time they connect, the user will be asked for their passwords.
Gnome Network Manager Cisco PPTP VPN Connections
Fig.01: Gnome Network Manager Cisco PPTP VPN Connections
The Add tab is greyed out when required plugins are not installed for Gnome NetworkManager. The following plugins should be installed under Debian / Ubuntu Linux:

  1. network-manager-openvpn and network-manager-openvpn-gnome - network management framework OpenVPN plugin GNOME GUI
  2. network-manager-pptp and network-manager-pptp-gnome - network management framework PPTP plugin GNOME GUI
  3. network-manager-strongswan - network management framework strongSwan ipsec vpn plugin
  4. network-manager-vpnc and network-manager-vpnc-gnome - network management framework (VPNC plugin GNOME GUI)
To install all of the above plugins use the apt-get command as follows:
$ sudo apt-get install network-manager-openvpn network-manager-pptp network-manager-vpnc
The following plugins should be installed under RHEL / Fedora / CentOS / Scientific Linux / Red Hat Enterprise Linux desktop systems:
  1. NetworkManager-openvpn : NetworkManager VPN plugin for OpenVPN
  2. NetworkManager-pptp : NetworkManager VPN plugin for pptp
  3. NetworkManager-vpnc : NetworkManager VPN plugin for vpnc
To install all of the above plugins use the yum command as follows:
# yum install NetworkManager-vpnc NetworkManager-pptp NetworkManager-openvpn
Now, you can add vpn connection to your system using NetworkManager itself. You may need to restart the NetworkManager as follows:
# /etc/init.d/network-manager restart

Fig.02: Linux Gnome Desktop Cisco PPTP VPN Client Support Added

Sunday, June 5, 2011

kill all users session under Linux


You need to use the pkill command which will look up or signal processes based on name. It can send the specified signal to each process.
# pkill -9 -u username
In this example, list all process owned by a user called lighttpd, enter:

# ps -fp $(pgrep -d, -u lighttpd)
To kill all process owned by lighttpd user, enter:
# pkill -9 -u lighttpd

Find Out CPU Architecture Information on Linux


 You can use /proc/cpuinfo file or use the lscpu command to get info about CPU architecture.

$ less /proc/cpuinfo

Or

$ lscpu