Thursday, July 16, 2015

linux delete command from history

### histcontrol used to exclude commands from history: 
### add space before commands to exclude from history:




$HISTCONTROL=ignorespace

$ history -d 29



Note: the second command has a space preceded.

Wednesday, July 15, 2015

Linux delete millions of files - Argument list too long error [tested]

"Argument list too long" error


below command worked: [tested] 

find . -name "*.aud" -type f -print -delete


find /app/rdbms/audit/ -name "*.aud" -type f -print -delete

Or


Using For loop: (time consuming..)

for f in *.aud; do rm "$f"; done

Note: To improve performance, remove "-print"

Sunday, February 9, 2014

RHEL update

In practice you can just copy from dvd, the folders you need, such as

Server
Cluster

to a location you share through apache such as /var/www/html/RHEL5.10/Server and /var/www/html/RHEL5.10/Cluster

Then use the RHEL5 version of createrepo, present in the base channel, to create the repodata :

createrepo -v /var/www/html/RHEL5.10/Server
createrepo -v /var/www/html/RHEL5.10/Cluster


or change permissions for the directory, if you already configured:

# chown apache /var/www/html/RHEL5.10 -R
# chmod +r /var/www/html/RHEL5.10 -R
# find /var/www/html/RHEL5.10 -type d -exec chmod +rx {} \;


# yum clean all;
# yum repolist all;
# yum update;


-- After update:

[root@hsbcprhel033 log]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.10 (Tikanga)

[root@hsbcprhel033 log]# yum check-update
Loaded plugins: security
Skipping security plugin, no data

[root@hsbcprhel033 log]#


------------------------------------------------------------------------------------------

during "# yum update" you might get messages as below:
attention: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186 
rhel-x86_64-server-5/gpgkey                              | 1.1 kB     00:00      
Public key for device-mapper-multipath-0.4.7-34.el5.x86_64.rpm is not installed

In the same client machine (where you are installing RHEL update)

# rpm --import /etc/pki/rpm-gpg/RPM*
# rpm -qa gpg-pubkey*
# rpm -qi gpg-pubkey-37017186-45761324



Sunday, August 25, 2013

How to simulate linux server crash to test high availability cluster configuration?

How to kill a linux box?

# date ; echo 1 > /proc/sys/kernel/sysrq ; echo b > /proc/sysrq-trigger


This command just inform the kernel that the server crashed. So that the standby node can take over.


Monday, August 5, 2013

How to mount a cd in linux ?

[root@dev-hsbc-01a dev]# ls -l /dev/cdrom
lrwxrwxrwx. 1 root root 3 Mar 20 16:38 /dev/cdrom -> sr0

[root@dev-hsbc-01a dev]# mount /dev/sr0 /mnt/

[root@dev-hsbc-01a dev]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              39G  1.2G   36G   4% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/sda1             291M   37M  239M  14% /boot
/dev/sda3              20G  172M   19G   1% /crcrd
/dev/sr0              633M  633M     0 100% /mnt


Wednesday, June 5, 2013

How To Configure HP ILO - Integrated Lights Out (ILO) Step by Step



http://808techblog.com/2009/08/configure-hp-integrated-lights.html

after cofiguration using above steps,


How to access HP ILO ?

You can access ILO using http://192.168.5.5/  for the configuration done on this above document.