Showing posts with label System. Show all posts
Showing posts with label System. Show all posts

Wednesday, May 25, 2011

RAM DISK --- 2nd Porcedure

you can create RAM disk or temporary file system using the following command

mount -t tmpfs -o size=32M tmpfs /var/lib/asterisk/

the above command will mount /var/lib/asterisk/ directory in the RAM and its size will be 32Mb.

you normally use RAM disk for the applications that require intensive io operation. using ram disk will increase hardisk life and also increase performance of application by reducing access time.







Monday, October 18, 2010

bash script for Qmail&Vpopmail Uers Quota Refresh - Version 2


#!/bin/sh
#Author: Tanveer Hussain Khan(tanveerhk@hotmail.com)
#Function:Referesh User Quota for all user and domain for qmmail and vpopmail #output=$(/usr/local/bin/mysql --password=rootpassword --exec="select pw_name,pw_domain,pw_shell from vpopmaildb.vpopmail")

/bin/date
echo "Going Referesh Quota For All Users & Domains"
output=$(/usr/bin/mysql --exec="select pw_name,pw_domain,pw_shell from vpopmaildb.vpopmail")

array=$(echo $output | tr " " "\n")
record=""
x=0
for a in $array
do
      record[x]=$a
      let "x+=1"
done

let "count=$x-1"
for ((i=3;i<=$count;i+=3))
do
      let "name=$i"
      let "domain=$i+1"
      let "quota=$i+2"
#     echo "Setting Quota To ${record[$quota]} For User ${record[$name]}@${record[$domain]}"
#     echo ${record[$name]}@${record[$domain]} ${record[$quota]}
#     echo "/var/qmail/vpopmail/bin/vsetuserquota ${record[$name]}@${record[$domain]} ${record[$quota]}"
      /var/qmail/vpopmail/bin/vsetuserquota ${record[$name]}@${record[$domain]} ${record[$quota]} done

/bin/date
echo "Quota Refereshed For All Users & Domains"
echo "***********************************************************"

Saturday, October 2, 2010

bash script for Qmail&Vpopmail Uers Quota Refresh

#!/bin/sh
#Author: Tanveer Hussain Khan
#Function:Referesh User Quota for all user and domain for qmmail and vpopmail
#output=$(/usr/local/bin/mysql --password=rootpassword --exec="select pw_name,pw_domain,pw_shell from vpopmaildb.vpopmail")
output=$(/usr/bin/mysql --exec="select pw_name,pw_domain,pw_shell from vpopmaildb.vpopmail")

array=$(echo $output | tr " " "\n")
record=""
x=0
for a in $array
do
        record[x]=$a
        let "x+=1"
done

let "count=$x-1"
echo $count
for ((i=3;i<=$count;i+=3))
do
        let "name=$i"
        let "domain=$i+1"
        let "quota=$i+2"
        echo "Setting Quota To ${record[$quota]} For User ${record[$name]}@${record[$domain]}"
#       echo ${record[$name]}@${record[$domain]} ${record[$quota]}
#       echo "/var/qmail/vpopmail/bin/vsetuserquota ${record[$name]}@${record[$domain]} ${record[$quota]}
        /var/qmail/vpopmail/bin/vsetuserquota ${record[$name]}@${record[$domain]} ${record[$quota]}
done

Tuesday, June 8, 2010

Install Xwindow, KDE, GNOME, VNC using Yum

you can use yum groupinstall command to install these package at once. but for that you need a good internet connection. here is the complete command.

yum -y groupinstall "X Window System" "GNOME Desktop Environment" "KDE Desktop Environment"


if you have internet connection then it a magic :-) command and will install all dependencies at one and you dont need much struggle to run the Graphical Desktop Environment(KDE/GNOME).

Wednesday, May 26, 2010

RAM Disk Creation & Mount

What Is RAM Disk? RAM disk is the portion for ram which acts as the hard disk. For that we allocate some portion for ram and then mount it. below are the configurations tested on CentOS 5.2

You can configure and mount RAM Disk using the following procedure.

1. In /etc/grub.conf add the option that is highlited in the below kernel line.

title CentOS (2.6.18-164.el5PAE)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-164.el5PAE ro root=LABEL=/ rhgb quiet ramdisk_size=524288
        initrd /initrd-2.6.18-164.el5PAE.img

2. now edit the /etc/rc.d/rc.local and put the below line
####### RAM DISK #######################
mkfs -t ext3 /dev/ram0 # it will formate the ramdisk
mount -t ext3 /dev/ram0 /var/spool/asterisk/monitor # it will mount ramdisk to mount point /var/spool/asterisk/monitor