HA for Linux Box

February 3rd, 2010

Install hearbeat

then create files “haresources” ,”/etc/ha.d/ha.cf”,

### My configuration file *****
# haresources
[root@druid ha.d]# pwd
/etc/ha.d
[root@druid ha.d]# cat haresources
druid 192.168.21.84 asterisk
[root@druid ha.d]#
// ie ‘hostname of primary server ‘ ‘floating IP address’ ‘names of service to be executed during failover
*** ha.cf ******
debugfile /var/log/ha- debug
logfile /var/log/ha- log
keepalive 2
deadtime 10
bcast eth0
node druid elastix
auto_failback off
############ ######### #####
***** /etc/hosts ********
cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdoma in localhost
127.0.0.1 asterisk
192.168.21.158 druid druid
192.168.21.156 elastik elastik

To setup sudo users in Fedora or CentOS

February 3rd, 2010
To setup user “joseph” as sudo user
echo ‘joseph ALL=(ALL) ALL’ >> /etc/sudoers
This will prompt for password , If u do not want it to prompt U need to make entry as
echo ‘joseph ALL=(ALL) NOPASSWD:ALL’ >> /etc/sudoers

To setup user “joseph” as sudo user
echo ‘joseph ALL=(ALL) ALL’ >> /etc/sudoers
This will prompt for password , If u do not want it to prompt U need to make entry as
echo ‘joseph ALL=(ALL) NOPASSWD:ALL’ >> /etc/sudoers

A command that will find all sleep processes running on the system and kill them

February 3rd, 2010

ps -eaf|cut -d f2|tr -s ” “|kill

Disable IPV6 module on default kernels

February 3rd, 2010
On Fedora /CentOS /RHEL
Edit “/etc/modprobe.conf”
and add the follwing lines
“alias net-pf-10 off”
For Ubuntu
By default it is enables and in the file
“/etc/modprobe.d/aliases” it is given as
alias net-pf-10 ipv6
edit the aboce line back to
alias net-pf-10 off

On Fedora /CentOS /RHELEdit “/etc/modprobe.conf”and add the follwing lines”alias net-pf-10 off”
For Ubuntu
By default it is enables and in the file ”/etc/modprobe.d/aliases” it is given as
alias net-pf-10 ipv6
edit the aboce line back to alias net-pf-10 off

To read Malayalam news papper

February 3rd, 2010
1> Download the font from http://www.manoramaonline.com/mmfont/Manorama.ttf
2> In the user home dir create a dir named “.fonts”
3> copy the Manorama.ttf to /usr/share/fonts/
The font will be installed once you reboot. But if you don’t want to do that open your terminal.
To read deepika
1> Download the font from http://www.deepika.com/mlkr0ntt_TTF.ttf
2> Save it to /usr/share/fonts/
The font will be installed once you reboot. But if you don’t want to do that open your terminal.

1> Download the font from http://www.manoramaonline.com/mmfont/Manorama.ttf2> In the user home dir create a dir named “.fonts” 3> copy the Manorama.ttf to /usr/share/fonts/ The font will be installed once you reboot. But if you don’t want to do that open your terminal.

To read deepika 1> Download the font from http://www.deepika.com/mlkr0ntt_TTF.ttf2> Save it to /usr/share/fonts/The font will be installed once you reboot. But if you don’t want to do that open your terminal.

To get the character positions 5-10 from a text file

February 3rd, 2010
cat sajifile.txt | cut -c 5-10
cat <filename> | cut -c 5 -20