How to configure repos to not overwrite base packages?

CentOS, How to, Linux
The greatest fear with adding additional and especially third party repos such as EPEL (we did a blog post on how to install EPEL earlier) is that it MAY overwrite base packages and bring the system to an unstable state. We can fix this issue by installing Yum Priorities plugin on CentOS 5: [code]yum install yum-priorities[/code] on CentOS 4 or CentOS 6: [code]yum install yum-plugin-priorities[/code] Then make sure that the plugin is enabled [code]nano /etc/yum/pluginconf.d/priorities.conf[/code] Now there are two ways to do it, either set HIGHEST priority to CentOS repos OR set lowest priority to other repos. This is done by adding the line [code highlight="3"] # N=1 highest priority # N=99 lowest priority priority=N [/code] In this blog post, I will set 1 as the priority (highest) for my…
Read More

How to change time and/or timezone in CentOS

CentOS, How to, Linux
Generically, I use this Change directory to /etc [code] [root@testbed ~]# cd /etc [/code] Now create a symbolic link (aka symlink) to the timezone e.g. Asia/Karachi (for Pakistan standard time) [code highlight="1"] [root@testbed etc]# ln -sf /usr/share/zoneinfo/Asia/Karachi localtime [root@testbed etc]# date Mon Jan 16 19:26:52 PKT 2012 [/code] Please note that the timezone is following a directory-structure so if you want EST time, you should use [code highlight="1"] [root@testbed etc]# ln -sf /usr/share/zoneinfo/EST localtime [/code]
Read More

How to disable SELinux

CentOS, How to, Linux, Tips and Tricks
SELINUX is a security feature on CentOS but some software such as SolusVM will require that SELINUX be disabled [code] Installation log : /tmp/install.log Add this slave to your SolusVM master using the following details: ID Key .......... : ABC ID Password ..... : XYZ IMPORTANT!! You need to setup a network bridge before you can use KVM on this server. Please see the following link: http://wiki.solusvm.com/index.php/KVM_Network_Bridge_Setup Please set SELINUX=disabled in /etc/selinux/config before rebooting. Thankyou for choosing SolusVM. [/code] The solution? 1) Edit /etc/selinux/config using your favourite editor [code][root@kvm ~]# nano /etc/selinux/config[/code] and set SELINUX=disabled [code highlight="6"]# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings…
Read More

Freshclam daemon not running

CentOS, How to, Linux
Normally, I have two things on every Linux box so that I know whats going on NAGIOS monitoring (nrpe) Logwatch Today, I got something in my logwatch email and it was strange because just the other day, I upgraded the clamav to latest version using epel reo. [code title="This is what I got in logwatch today" highlight="3,4,5"] --------------------- clam-update Begin ------------------------ The ClamAV update process (freshclam daemon) was not running! If you no longer wish to run freshclam, deleting the freshclam.log file will suppress this error message. ---------------------- clam-update End ------------------------- [/code] It appears that the latest version has some permission issues on the log file because when I try to run freshclam on command line I get this [code]root@cpanel [~]# freshclam ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check…
Read More

Install htop

CentOS, How to, Linux, Reviews, Tips and Tricks, Ubuntu
[caption id="attachment_1147" align="aligncenter" width="300" caption="htop - an alternative to linux top"][/caption] htop is a sleek utility that allows you to interactively view processes running in a linux box. I can safely say its a good alternate to 'top' To install htop just run this after installing epel repo [code]yum install htop[/code]
Read More

Installing EPEL repo

CentOS, How to
Installing EPEL repo in CentOS is simple, if you do not know what EPEL is, read more about it here. [code]rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm[/code] To configure epel or disable it use [code]nano /etc/yum.repos.d/epel.repo[/code] and then switch the config enabled to 0 (or vice versa) Don't forget to do the following [code]yum clean all[/code]
Read More

Ubuntu – Unable to load dynamic library ‘/usr/lib/php5/20090626+lfs/sqlite.so’

Linux, Tips and Tricks, Tutorials, Ubuntu
The other day, I was getting this weird error [code]PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' - /usr/lib/php5/20090626+lfs/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0[/code] Fix it by doing this [code]root@beta:~# rm -fr /etc/php5/conf.d/sqlite.ini[/code] Because this extension does not exist, you can verify it by running this, you will see that there is already sqlite3.ini file there [code]root@beta:~# ls -lh /usr/lib/php5/20090626+lfs/ | grep sqlite[/code]
Read More

vzfree utility to check memory usage in OpenVZ VPS

How to, Linux, OpenSource, Resources, Tips and Tricks, Tutorials, Ubuntu, Virtual Private Server
From the official blog post Gee. It has been a while since I’ve last written here, and it will be a while again for my next post as I will be on holidays from next Monday (visiting families in Hong Kong and Taiwan). Let me share one small utility program that I wrote quite a while ago. We all know that the Linux command free(1) is pretty useless inside an OpenVZ VE, even those with meminfo virtualised. So I basically wrote this little util to grab the data from the dreadful user_beancounters and format them into something useful. It’s written in C and only depends on libc so it’s pretty light weight. It also does a little bit of analysis instead of just dumping the data, which I will explain…
Read More

Find memory consumed by currently running processes on Linux?

CentOS, How to, Linux, OpenSource, Resources, Reviews, Tips and Tricks, Tutorials, Ubuntu, Virtual Private Server
I always had the question (when I am running plenty of scripts on a linux box as to what is eating up all the memory? Finding memory consumed by current running processes in your favorite linux distro. Luckily, I found a great Python utility (scriplet to be exact). (more…)
Read More

NAGIOS 3 with notifications on twitter

Experiments, How to, Linux, OpenSource, Resources, Social Networking, Tips and Tricks, Tutorials, Virtual Private Server
I have been experimenting with NAGIOS3 on Ubuntu (I will write a how-to-install on NAGIOS later) and it has served me very good in monitoring my 7 VPS from different providers in different part of the world. I have already recorded 3 hours of downtime from ThrustVPS which is a great deal for me. I now know which VPS has the best time and which ones have hiccups (e.g. my 2Host VPS gave me two unreachable notifications but the VPS was running and still reports the uptime as 4 days). Since I use twitter more, even when Im on the road, notifications via email is a bit slow for me. Luckily I found a great tutorial online to do that. (more…)
Read More