Category Archives: Linux Tricks

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

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++… Read More »

How to Set Up Key Authentification in Putty without user password

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:… Read More »

How to Truncate a File to Zero Length in Linux

Sometimes you need to truncate a file to zero bytes. For example you have a big file that contains various logs and its size is too big to open it easily. Of course, you can revome this file and touch it again. But this way you’ll have to deal with permissions and file ownership. There is a simple… Read More »

How to Check Whether a Package is Installed in Linux

Today I come with a short and simple command that will be useful for Linux newbies. What to do if you need to find out whether the package you need is already installed or not? There is a short command that will allow you to do this. rpm -qa | grep <package> What does this do? This command… Read More »

How to Create a Gzip Archive in Linux

This post should be useful for those who haven’t used Linux for a long time. I am going to tell you how to create gzip archives in linux. That’s greatly useful when you’re creating some backups, or anything for download, especially if your Internet is quite slow. So, let’s start… Gzip archives are often used with tar files.… Read More »

How to Deny Access To Your Server From a Certain IP Using iptables

I you’re running a web server, you should have noticed that some IP addresses can be found trying to crack your passwords or issuing different queries trying to find a vulnerability in your scripts. If your main Linux firewall is iptables, there are lots of opportunities to enable/disable access using different conditions. We will close incoming connections for… Read More »

How to Change Last Modified Date Of The File to a Time in The Past in Linux

Today we’ll talk about a simple trick that could be used to change last modified date of a file. Certaainly, you’re welcome to use touch command to do it under Linux, and it will be the most simple way. But… if you don’t know what does this command do, you can try to do it under MS Windows.… Read More »

How to Hide Midnight Commander Window and Show The Command Line

Just a simple trick that is often used. You’re working in mc  and need to issue a command from the command line. You can “minimize” Midnight Commander window and then return back to the place you were before with just a simple keyboard shortcut. Just input Ctrl+O to hide mc window. Command line interface will appear with the… Read More »