Change to Fastest Mirror for Yum


When you ran yum for the first time and it will select a mirror automatically for you which sometime was really slow. This will caused package updates and installation were taking a lot of time to finish. Actually you can to a different repo manually to nearest locations to your server.

To force yum-fastestmirror plugin to check for fastest mirrors, you must delete the file /var/cache/yum/timedhosts.txt by running the following command as root:

rm /var/cache/yum/timedhosts.txt

Then, running yum will check for fastest mirror next time it is run. It should pick up a better mirror, but sometimes there is a case that it kept pick the same mirror over and over again. You can block it so that yum-fastestmirror is forced to choose another one. To do that, open the file /etc/yum/pluginconf.d/fastestmirror.conf as root and uncommented the line (removed the “#”) with “exclude” and added the bad mirror such as “mirror.repo.dom” (change to the one that you want to block according to your installation) to the exclude list so that the line looked like the following:


If yum-fastestmirror keeps on giving selecting slow mirrors, you can add additional mirrors to the exclude list (separate mirror names with commas) and remove /var/cache/yum/timedhosts.txt again and repeat it again until you are satisfied with the performance.

Securing /tmp and /var/tmp on OpenVZ Container


When doing server hardening procedure there are many important methods which have to be done on a server to reduce the attack footprint. One of the easiest method is securing temporary directory on your server.

Continue Reading »

su: cannot set user id: Resource temporarily unavailable


When you’re using OpenVZ container, occasionally you will encounter this error when you’re trying to su to root.

#su -
su: cannot set user id: Resource temporarily unavailable

This is all about VPS the resources limitation in the container. A quick resolution to this issue by editing limit.conf as describe below or adjust them as needed.

#vi /etc/security/limit.conf
#### add/change on these line below:
* soft nproc 2047
* hard nproc 16384
* soft nofile 2048
* hard nofile 65536

Turning On and Off Second-Level Quotas for Container


The parameter that controls the second-level disk quotas is QUOTAUGIDLIMIT in the Container configuration file. By default, the value of this parameter is zero and this corresponds to disabled per-user/group quotas.

Continue Reading »

Main Navigation