Archive

Archive for the ‘Linux Tricks’ Category

How To Find The Version of Linux You Are Using

February 12th, 2009 No comments

Sometimes you need to know what version of the Operating system is installed on your server. This is extremely useful when you order a dedicated server and want to know what is the version of OS on it. A simple command will help you as usual:

cat `ls /etc/*{-,_}{release,version} 2>/dev/null | head -n 1`

This will show you something like

The picture below shows the difference between common commands: one shown above and uname -a. Sometimes you don’t need the kernel version, just the operating system name. This command should help you to do that.

How to View Last Lines of a Big File in Linux

November 27th, 2008 No comments

This post is dedicated to Linux newbies as those who use it for everyday needs should know about this command. If not… I think this will be useful for you in any way.

When you’re a system administrator, you should often deal with logs. On a Linux server logs are permanently updated, that’s why we need to see last written lines of such a file. If you open it useing cat or more, you won’t see how it changes. A simple command will help you to do this.

tail -f error_log

This will show you last lines of error_log file. For a complete list of options you’re welcome to go here: or just type man tail in your console.

Hope this command will help you to monitor your server and increase its uptime :)

How to Install g++ on CentOS 4 and CentOS 5

November 19th, 2008 2 comments

g++ is often necessary for building various packages. But It’s quite hard to install it in CentOS if you don’t know a simple thing: yum install g++ will not work here. yum install compat-g++and yum install gcc-g++ won’t give any result too.  The only command for yum to install g++ on CentOS is the following:

yum install gcc-c++

You might also want to install it with some more useful packages. Then your command will be:

yum install gcc-c++ compat-gcc-32 compat-gcc-32-c++

Hope this helps you to install g++ under CentOS

How to Set Up Key Authentification in Putty without user password

November 19th, 2008 No comments

Yesterday I’ve purchased my first communicator. Certainly, I need it to have SSH access to my servers. As my passwords are not so simple, I’ve decided to read about key authentification in order to prevent entering long user passwords without the loss of security.

I’ve found two good articles and I won’t copy their content to my site: they are too great for this and contain all the necessary screenshots. Following this guides you won’t have any problems setting up your key authentification.

Here are these great links: Public Key Authentication With PuTTY and Key Authentication with PuTTY. I’ve followed the second one to tune it on my home PC and then transferred to my communicator. Hope these articles will help you to secure your connections too.