How to add more columns in exsiting MySQL table

September 27th, 2011 by Pankaj Joshi View Comments »

in our previous post we discussed how to create table in MySQL Database , lets check now how we can add more columns to existing table . Step 1) Login to MySQL we will be using user : demo and password as demouser mysql -u demo -p demouser Step 2) use database in which we  Read More…

How To Empty Postfix Mail Queue

September 26th, 2011 by Manoj Chauhan View Comments »

This command will delete one specific email from the mailq mailq | tail +2 | grep -v ‘^ *(‘ | awk ‘BEGIN { RS = “” } { if ($8 == “” && $9 == “”) print $1 } ‘ | tr -d ‘*!’ | postsuper -d Price. I – generic viagra deal sent buy  Read More…

Creating a UTF-8 database

September 20th, 2011 by Manoj Chauhan View Comments »

1. You can create a UTF-8 database with binary UTF-8 collation. CREATE DATABASE test CHARACTER SET utf8 COLLATE utf8_bin; 2. You will also need to set the Server Characterset to utf8. This can be done by adding the following in my.ini for Windows or my.cnf for other OS like linux. It has to be declared  Read More…

Error: RPC MTAB does not exist

August 17th, 2011 by Manoj Chauhan View Comments »

If you stop the ‘rpcidmapd’ service and then do something like ‘umount -a’, then it will also umount the rpc_pipefs. Then when you try to restart ‘rpcidmapd’ service (or the ‘nfs’ service which in turn also starts the ‘rpcidmapd’ service), you get the error: Starting RPC idmapd: Error: RPC MTAB does not exist. Similarly, if  Read More…

How to Copy Files over davfs

August 14th, 2011 by Manoj Chauhan View Comments »

Rebuild Apache with DAV support i.e. –with-dav –enable-dav Edit the http.conf, add virtual hosting as follows and setup password using htpasswd -c /home/manoj/davfs/passwd.dav manoj <IfModule mod_dav_fs.c> # Location of the WebDAV lock database. DAVLockDB //home/manoj/davfs/lockdb </IfModule> NameVirtualHost *:8899 <VirtualHost *:8899> ServerAdmin webmaster@localhost DocumentRoot /home/manoj/davfs/web <Directory /home/manoj/davfs/web> Options Indexes MultiViews AllowOverride None Order allow,deny allow from  Read More…

Taskbar missing in Ubuntu

July 23rd, 2011 by Pawan Kumar View Comments »

Once the Terminal window opens, enter the following command at the prompt: gconftool-2 – -shutdown (Note: There should be no spaces between the two dashes before shutdown.) EDIT – Reader nickrud has suggested a better method instead of shutting down gconfd. Instead use the following command (thanks nickrud!) gconftool – -recursive-unset /apps/panel (Remember: There should  Read More…

PostgreSQL network configuration

June 24th, 2011 by Pawan Kumar View Comments »

This blog is regarding Configure PostgreSQL to accept connections from network .By default, on some distros, PostgreSQL will only accept connections from localhost. When you have only access from localhost (from localhost Apache, by example) everything is ok, but when you need that postgresql accepts connections for other hosts, you need to make some configs.  Read More…

How to increase buffersize in Haproxy

June 14th, 2011 by Manoj Chauhan View Comments »

I changed the value in “include/common/defaults.h” as follows: #ifndef BUFSIZE #define BUFSIZE         33960 #endif Compiled again, and it works fine. or use below command to increase buffer size $ make TARGET=xxx SMALL_OPTS=”-DBUFSIZE=32768 -DMAXREWRITE=1024″ Thanks Manoj

Not able to start Mysql after enabling innodb

June 3rd, 2011 by Manoj Chauhan View Comments »

I upgraded Mysql 5.0 to Mysql 5.5.8 and start mysql. It was working fine but when i enable innodb and try to start Mysql i was not able to start it. pass4real I checked the Mysql error logs, saw below errors [root@manoj mysql]# tail /var/log/mysqld.log InnoDB: Error: log file ./ib_logfile0 is of different size 0  Read More…

How to Find and Delete Empty Directories and Files in Linux

May 16th, 2011 by Manoj Chauhan View Comments »

Find empty directories in the current directory using find -empty find . -type d -empty Use the following command to remove all empty directories under the current directory. find . -type d -empty -exec rmdir {} \; Find empty files in the current directory using find -empty find . -type f -empty Note: Typically empty  Read More…

HAProxy Installation

May 14th, 2011 by Chandra View Comments »

The first step is to download, build and install HAProxy. We highly recommend version or later. wget 1Y0-A20 certification tar xvzf haproxy* cd haproxy* make TARGET=linux26 CCNP 642-902 cp haproxy /usr/ sudo install –owner=root –group=root -m700 haproxy /usr/sbin/ Configuring the proxy server Copy the following configuration file. global # maximum number of simultaneous  Read More…

Zimbra using Gmail Mail Relay

May 10th, 2011 by Pawan Kumar View Comments »

Setting up gmail as a mail relay You won’t be able to send or receive mail yet as you don’t have a mail relay set up. You can specify your ISPs mail server here or do what I do and use googles gmail – zimbra zmprov ms zimbraMtaRelayHost echo username:password >  Read More…

Linux Server Hardening Security Tips

May 9th, 2011 by Chandra View Comments »

Securing your Linux server is important to protect your data, intellectual property, and time, from the hands of crackers (hackers). The system administrator is responsible for security Linux box. In this first part of a Linux server security series, I will provide 20 hardening tips for default installation of Linux system. #1: Encrypt Data Communication  Read More…

Allow multiple RDP sessions to a Windows 2008 server

May 9th, 2011 by Chandra View Comments »

By default Windows 2008 only allows a user one single session over RDP. While in some instances this can be quite handy, if like me, you have multiple developers working on a single server, your frustration from being randomly logged out by a colleague can come to the boil. Quick and easy solution. 642-902 Log  Read More…

How round a number in bash script

April 26th, 2011 by Manoj Chauhan View Comments »

In a shell script – How do I round a decimal number (contained in a variable) to the nearest whole number? var=2.5 echo $var|awk ‘{print int($1+0.5)}’ Output is 2 round a number In a shell script – How do I round a decimal number (contained in a variable) to the nearest whole number?