Postfix V2.1 supports a “sender_bcc_maps” and “recipient_bcc_maps” functions. If you are using postfix then use following steps :- [root@map007]# vi /etc/postfix/main.cf Add following line to get a bcc copy to your email id when some one send a mail :- sender_bcc_maps = hash:/etc/sender_bcc Add following line to get a bcc copy to your email id Read More…
Zero-Downtime Restarts of backend servers with HAProxy
March 20th, 2011 by Manoj Chauhan View Comments »Zero-Downtime with HAProxy Putting up a maintenance page while you are doing an update and restarting your application servers is good practice, but it definitely hurts the user experience. setup a html page and check url – e.g. /haproxy_check.html. It will check the haproxy_check.html every 2 seconds and check the string OK inside the the Read More…
Using pipe in Varnish
March 15th, 2011 by Manoj Chauhan View Comments »Using pipe In most cases, the pipe action is not used for anything. However, if you want to stream objects, particularly large ones like videos, big zip files, you can use pipe. Using pipe means Varnish stops inspecting each request and just shuffles bytes to the backend. This can lead to multiple failure modes, from Read More…
Some examples of using LINUX/UNIX find command
March 13th, 2011 by Manoj Chauhan View Comments »Introduction The find command allows the Linux/Unix users to process a set of files and/or directories in a file subtree. You can specify the following: * where to search (pathname) * what type of file to search for (-type: directories, data files, links) * how to process the files (-exec: run a process against a Read More…
Backend Declarations in Varnish
March 12th, 2011 by Manoj Chauhan View Comments »A backend declaration creates and initializes a named backend object: backend www { .host = “www.manoj.com”; .port = “http”; } The backend object can later be used to select a backend at request time: if (req.http.host ~ “^(www.)?manoj.com$”) { set req.backend = www; } The timeout parameters can be overridden in the backend declaration. The Read More…
SMTP authentication using Mysql
March 10th, 2011 by Pawan Kumar View Comments »There are times when you need to have users authenticate their SMTP sessions. Perhaps you have roaming users and you don’t want to be an open relay, but you cannot predict where these users are. You need a way for them to say to your SMTP server “hey I belong here, let me send email”. Read More…
How to Export A MySQL Multiples Databases Structures Only
March 10th, 2011 by Manoj Chauhan View Comments »If you no longer need the data inside the database’s tables (unlikely), simply add –no-data switch to export only the tables’ structures. mysqldump –no-data -u root -p –databases db1 db2 db3 db3 db4 > /tmp/mysql_backup.txt
Install MySQL 5.5 on Ubuntu
March 8th, 2011 by Manoj Chauhan View Comments »I followed the steps on this page to install MySQL 5.5 on Ubuntu. To install and use a MySQL binary distribution, the basic command sequence looks like this: shell> groupadd mysql shell> useradd -r -g mysql mysql shell> cd /usr/local shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> chown -R Read More…
Mail Archival with zimbra
March 7th, 2011 by Pawan Kumar View Comments »Archiving email using Zimbra Desktop A good solution to store messages offline are localfolders Use the Local Folders feature in Zimbra Desktop to archive individual messages (or entire folders) to local storage. This new feature takes select email out of your online mailbox, providing a convenient way to reduce the size of your online mailbox Read More…
mysqld_safe A mysqld process already exists
March 5th, 2011 by Pankaj Joshi View Comments »Today I faced issue again with MySQL running of NFS .I was trying to shutwon mysql using /etc/rc.d/init.d/mysql stop MySQL shutdown was successful . after making changes in my.cnf file I tried to start MySQL using /usr/bin/mysqld_safe –defaults-file=/etc/my.cnf & I got error mysqld_safe A mysqld process already exists I checked that no other instance is Read More…
How to Install and Configure Cacti
March 4th, 2011 by Chandra View Comments »Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database. Required softwares to install Cacti. You need to install the following software to install cacti. a) MySQL Server : Store cacti data b) NET-SNMP server – SNMP (Simple Network Read More…
No package ‘libpcre’ found
March 3rd, 2011 by Manoj Chauhan View Comments »I was getting “No package ‘libpcre’ found” error during Varnish compiling, so fixed it by installing gcc lib. using below command yum install gcc* -y
How Quickly find what directories are using up space on your disk in Linux
March 2nd, 2011 by Manoj Chauhan View Comments »The df -h command will tell you disk usage from a mount-point perspective, but the command du tells you from a directory perspective. Use the command: du -h / –max-depth=1 To show disk usage for each individual directory on the system, or go lower down to see usage on a particular directory: du -h /var/log Read More…
find and replace string in vi
March 2nd, 2011 by Manoj Chauhan View Comments »To perform a find and replace with all entries of a file, enter the colon to invoke Esc. from vi. Then, from there, enter :%s/find_string/replace_string/g For example: %s/manoj/manoj chauhan/g There are many other ways to do this, but I prefer this method.

How comment lines in vi
March 2nd, 2011 by Manoj Chauhan View Comments »If you need to comment the next 10 lines within vi, execute the command within the command mode: :.,+10s/^/# It will comment the next 10 lines, you can change the number accordingly.
View Comments »
Posted in CentOS, Linux
Tags: How comment lines in vi using vi