Top 5 most useful commands or tools for Linux administrators

There are plenty such tools which are definitely very useful for Linux admins. Here I am just trying to figure out 5 of such useful tools which are used by a normal Linux administrator in day to day operations. A tool which I think is most useful may not fit in your usage and its definitely possible that you know some awesome tool which I forgot to include here, for such case, I am requesting hereby to please mention the tool in comments. One more thing, I am mentioning here tools which are somewhat optional and not absolutely required for everybody and excluding tool which have no viable alternative and every Linux admin have to use them.. such as SSH, SCP etc.

Setting up mutiple MySQL Database servers on a single linux machine

One of my friend requested to setup two independent MySQL DB servers in his CentOS 5.4 server box. One MySQL (5.0.77) service was already running on the machine, So I had to install another one. Though, I dont recommend running multiple instances on a single server, instead due to cheap hardware you may better setup a MySQL cluster for best performance. In this case, after initial investigation, I’ve found that there are few ways to implement this. The idea of using MySQL Sandbox interested me most. At the end of day, there was two server running simultaneously on the using different ports for connections. Here are the steps, I took to install and configure multiple MySQL servers:

Quickly sync/update time from a time server

A good server machine should always tick its clock with correct time. The best way to keep it in shape is to sync with a time server.

You can use any preferred time server to sync. I’m using public time servers here:

$ ntpdate pool.ntp.org
5 Feb 11:17:00 ntpdate[3332]: step time server 220.225.252.202 offset -585.969659 sec

Network time update command (ntpdate) will contact the available time server from public pool and sync time with it. Here in above example, offset is denoting that the clock was running ahead of time in my server.

To remain updated, you should put a cron entry to sync with time server every midnight:

Optimize and fix Mysql Server, running slow without any load

I got stuck in a weird problem yesterday, where a newly installed MySQL Server was responding slow. I’ve fixed the issue after detecting a small spelling mistake in file which is entirely not related to MySQL at first instance. Here are some tips, if you’re also on the same boat where Server itself doesnt showing any error, but your user’s lodging complaints of being slow.

1. Check MySQL Configurations:

Install perl Net::SFTP module in linux

When installing perl Net::SFTP module in CentOS 5 box:

# perl -MCPAN -e 'install Net::SSH::Perl'

It got stuck at:

t/01-compile.t…..ok
t/02-buffer.t……ok
t/03-packet.t……1/10

then I tried installation with force so that it can skip tests if any of them failed:

# perl -MCPAN -e 'force install Net::SSH::Perl'

The module seems installed ok but while using in a script, error occured:
Can’t locate Net/SSH/Perl/Buffer.pm in @INC …

that means, the module still not installed/configured properly. To get it done, I searched for rpms and found rpmforge repository http://dag.wieers.com/rpm/packages/rpmforge-release/ have all the sufficient rpms: