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 to Kill zombie processes
March 2nd, 2011 by Manoj Chauhan View Comments »Kill those persistent and annoying zombie processes. ps -e -o ppid,stat | grep Z | cut -d” ” -f2 | xargs kill -9
How print series of numbers or letters using Bash Loop
March 2nd, 2011 by Manoj Chauhan View Comments »Bash scripting is great tool in Linux for System Admin. Here is a quick trick to print a series of numbers (or letters) into a variable, and thus an argument of a script: #!/bin/bash for a in {1..18} do echo “The number $a” done #!/bin/bash for a in {a..z} do echo ” The letter $a Read More…
How to find hosts which cause most hits in Varnish
March 2nd, 2011 by Manoj Chauhan View Comments »If your Varnish server is under constant high load and you are wondering who causes that varnishlog is a helpful tool. Start off by logging IP addresses for a while. varnishlog -c -i RxHeader -I X-Forwarded-For > varnish.log After you have collected enough information use the following line to find out which IP caused the Read More…
Tomcat Security
March 2nd, 2011 by Chandra View Comments »1) Tomcat run as Unprivileged User. Create tomcat user which owns everything under tomcat folder “tomcat_home” change ownership for tomcat folder where application is running: chown -R tomcat:tomcat /usr/share/tomcat 2) Restrict access to critical files. Configuration file should be read only permission for tomcat user. under the tomcat directory. 3) Remove Default Tomcat Applications. ● Read More…
Redirect to www
March 1st, 2011 by Manoj Chauhan View Comments »Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.manoj.com The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed) Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^manoj.com Read More…
Redirect Old domain to New domain
March 1st, 2011 by Manoj Chauhan View Comments »Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain. The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed) Options Read More…
How to Leverage browser caching
March 1st, 2011 by Manoj Chauhan View Comments »Leverage browser caching Overview Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network. Details HTTP/S supports local caching of static resources by the browser. Some of the newest browsers (e.g. IE 7, Chrome) Read More…
Enabling compression in php
March 1st, 2011 by Manoj Chauhan View Comments »You can enable compression in php by adding below lines in the common php files if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], ‘gzip’)) ob_start(“ob_gzhandler”); else ob_start(); In my article I have recommend some methods on How Optimize and Tweak High-Traffic Servers.

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