View sorted list of connected IPs

At points one may need to quickly check and see who is connected to a server – and in case of servers running services such as http, ftp (so on) the number of their connections.
The netstat program does indeed display the list of connections, but browsing through it when there is a large number of connections is rather difficult.

Disable yum fastestmirror plugin on CentOS

The fastestmirror plugin may be useful at some points, but it can be a pain in the ass at others.
For example, I tried updating my CentOS installation today and because of the mirror caching it was downloading the updates at 30K/s. After disabling the plugin the speed from picking a different mirror jumped to 3MB/s.

To disable the plugin…

Restricting access to hidden site using .htaccess

Just like in real-life construction and rebuilding, you sometimes need to demolish and rebuild an existing website. And you probably want to do this behind a very nice and safe wall.

The wall, in our case, will be a “currently rebuilding. please visit soon” index.html file. If directory index priority is set to html then php, now the index.html file will be our visible website and hide the soon-to-be-demolished php-based website.

Console commands to hibernate and standby on CentOS

It’s great that Linux nowadays supports all the power management features available on computers. But it’s odd that beside the buttons to trigger standby/hibernate – which are only available in a graphical interface – there are no simple console commands to put the computer to sleep or into hibernation.

Erase RAID metadata from (previously used) disk

I recently attempted to install a fresh CentOS on a pair of recycled (previously used in a different linux sistem) hard disks.

Of course I got the classical message that the disks already had RAID metadata on them: “Disk contains BIOS metadata, but is not part of any recognized BIOS RAID sets. Ignoring disk sda”

Deleting large number of files in linux

You might have often encountered the “Argument list is too long” message when trying to rm -rf large amount of files. This happens often on large servers when trying to clean up the tmp folder. This is because the rm command has a pretty low count of supported parameters (filenames) while the tmp folder can become host to a terribly high number of files (millions in a period of years).

Install vzdump using yum on CentOS

As some of you may already know, vzdump is not included in the openvz repository for CentOS. If you need to use vzdump, you have to download its source and compile it yourself, unless you’re already using some VPS control panel that has it bundled.

Luckily, for all those who don’t use control panels and don’t want to compile vzdump themselves, there’s a quick workaround. SolusVM includes it in its repository, which apparently can be used even if you don’t have SolusVM installed on that particular server.

iptables modules for OpenVZ kernel

This is my preferred list of modules for iptables on OpenVZ kernels (set in /etc/vz/vz.conf): ## IPv4 iptables kernel modules to be enabled in CTs by default IPTABLES=”ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp ipt_owner ipt_REDIRECT” ## IPv4 iptables kernel modules …