Pages

Wednesday, December 19, 2007

no space left on /var/lock/subsys while restarting a application Postifix

Found Postifix is giving an error saying no space left on /var/lock/subsys and Postfix stoped running, failing to create files onto /var/.

culprit was no free Inode left on /var ( use command to find Inode Status "tune2fs","df -hi" )

solution is delete /var/lib/amavis/spam* files ( keep in mind what to be deleted )

Tuesday, December 11, 2007

linux command's

linux commands to get use of OS



apropos - search the manual page names and descriptions


example:

localhost:~# apropos network
/etc/network/interfaces (5) [interfaces] - network interface configuration for ifup and ifdown
dhclient-script (8) - DHCP client network configuration script
ifconfig (8) - configure a network interface
ifdown (8) - take a network interface down
ifup (8) - bring a network interface up
interfaces (5) - network interface configuration for ifup and ifdown
nameif (8) - name network interfaces based on MAC addresses
netdevice (7) - Low level access to Linux network devices
netstat (8) - Print network connections, routing tables, interface
statistics, masquerade connections, and multicast memberships
networks (5) - network name information
nmap (1) - Network exploration tool and security scanner
ping (8) - send ICMP ECHO_REQUEST to network hosts
ping6 (8) - send ICMP ECHO_REQUEST to network hosts
pngtopnm (1) - convert a Portable Network Graphics file into portable anymap
pnmtopng (1) - convert a portable anymap into a Portable Network Graphics file
pppoe-sniff (8) - examine network for non-standard PPPoE frames
services (5) - Internet network services list
slattach (8) - attach a network interface to a serial line
wget (1) - The non-interactive network downloader.
X (7x) - a portable, network-transparent window system



df -hi

This command will gives statistic of Filesystem, Inodes,IUsed, IFree, IUse% and Mounted on.

tune2fs - adjust tunable filesystem parameters on ext2/ext3 filesystems

dumpe2fs - dump ext2/ext3 filesystem information
slocate - Security Enhanced version of the GNU Locate

rename - renames multiple files

Wednesday, December 5, 2007

shell script to mirror data on network using rsync , ssh-key

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ssh keys
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

First of all we need to generate ssh key on localhost and copy the key to remote machine. so in future communication happen without supply password to remote machine.

here steps follows to genereate ssh keys :

localhost # ssh-keygen -t dsa

localhost # file ~/.ssh/id_dsa

localhost # file ~/.ssh/id_dsa.pub

localhost # ssh-copy-id -i /root/.ssh/id_dsa.pub root@192.168.0.50

locahost # ssh root@192.168.0.50


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
how to rsync ( man rsync )
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I love rsync to mirror data , just cos of its wast features that it provides.here goes some sample of how to use rsync.note that more than this can be done with rsync.

localhost# rsync -avz /home/file root@192.168.0.50:/home/.

above rsync program copies /home/file to targeted machine .

-a, --archive
-v, --verbose
-z, --compress

localhost# rsync -avz -e ssh /home/file root@192.168.0.50:/home/.

-e, --rsh=COMMAND specify the remote shell to use

localhost# rsync -avz --delete /home/dir/ root@192.168.0.50:/home/dir/.

Note : be careful to use --delete option .this will exactly sync source and target dir and keep exactly copy of source to target deleting rest of modufyied files into that dir.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
shell script to run in cron for regular updates
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#!/bin/bash

echo " ">>nohup.out
echo " ">>nohup.out

echo "*******Start of `date` ***********" >>nohup.out
echo "Start of /var/spool/mail directory " `date` >>nohup.out
nohup rsync -az --delete /var/spool/mail/ root@192.168.0.50:/var/mail
echo "End of /var/spool/mail directory " `date` >>nohup.out
echo "===================================" >>nohup.out

echo " ">>nohup.out
echo "Start of /home directory " `date` >>nohup.out
nohup rsync -az --delete /home/ root@192.168.0.50:/home
echo "End of /home directory " `date` >>nohup.out
echo "===================================" >>nohup.out

echo " ">>nohup.out
nohup rsync -avz /etc/group root@192.168.0.50:/etc/mailhost
nohup rsync -avz /etc/passwd root@192.168.0.50:/etc/mailhost
nohup rsync -avz /etc/shadow root@192.168.0.50:/etc/mailhost

echo "*********End of `date` *************" >>nohup.out

echo " ">>nohup.out
echo " ">>nohup.out

Tuesday, December 4, 2007

httpd default charset

While migrating web server (apache2 ) from desktop server to blade server. was found a problem in my web pages. was not able to view charset other than default UTF-8. And got to know that we can make use of different charset my enabling AddDefaultCharset on in httpd.conf.here follows step to change to default charset UTF-8 to new charset.

leo@gnu # vi /etc/httpd/conf/httpd.conf

do as follows

#AddDefaultCharset UTF-8 ( comment out this line and add following line )
AddDefaultCharset on