Windows to Linux (Ubuntu 14.04 LTS) Migration

Experiments, Linux, OpenSource, Ubuntu
I have been a hardcore Linux user from a Server-OS point of view since many years. Have used CentOS, Ubuntu, Debian and Fedora extensively. I have always recommended and used Linux without hesitation since I knew this is one thing that I cannot be wrong about. One place where I was reluctant to use Linux iswas my Desktop. My PC, Laptop and Work-Laptop running Windows 7. Although I love the simple interface of Windows, now its time that I try to experiment with a Linux Desktop OS. I am sure that within a few weeks, if not days, I would get in love with my decision which I have been postponing since many years now. I have chosen Ubuntu 14.04 LTS for this purpose. What follows is my transition from…
Read More

How to find zombie processes on linux

CentOS, Linux, Tips and Tricks, Ubuntu
My NAGIOS monitor alerted me that of my dedicated server has 10 Zombie processes, how to find Zombie processes via command line on Linux especially CentOS? [code] ps aux | awk '{ print $8 " " $2 }' | grep -w Z [/code] So it returns state (Z = Zombie) and the process id (PID) [code]root@sirius [~]# ps aux | awk '{ print $8 " " $2 }' | grep -w Z Z 4399 Z 4435 Z 4868 Z 5143 Z 5400 Z 5834 Z 7584 Z 11943 Z 16286 Z 24365[/code] Technically, you cannot kill a zombie process since its already dead but the entry in the process table is not removed because the parent will access the result via the PID in the process table.
Read More

Webalizer not working on Ubuntu

Linux, Tutorials, Ubuntu
One of my Ubuntu based VPS had Webalizer installed to collect stats from webserver but it was not working because I could see not stats at /webalizer/. If thats the case with you try the following 1) Try running the webalizer crontab [code]root@backups:~# /etc/cron.daily/webalizer Error Opening file /usr/share/GeoIP/GeoIP.dat[/code] So we have identified the culprit that geoip-database is not installed. 2) Fix this by installing geoip-database [code]root@backups:~# apt-get install geoip-database[/code] (more…)
Read More

How to find specific files and send alerts

CentOS, How to, Linux, Tips and Tricks, Ubuntu
Maintaining a shared hosting server is a full time job but tools and proper checks and balances can help make this burden lot less. I manage a shared hosting server for one of my friends and numerous times the scripts that people have installed over on their websites have vulnerabilities and hackers exploit it to upload stuff that mass-email or do other nasty stuff. Luckily, most of these exploits have common patterns like files names or other signatures that make them traceable (most of the time the so called hackers are just kiddy scripts) Create a file and put this in it [code]#!/bin/bash find /home -name 'paypal.com*' | mail -s '[Woodcrest] Phishing Alert!' me@mydomain.com find /home -name 'rout.php' | mail -s '[Woodcrest] Phishing Alert - Mail Bomber!' me@mydomain.com[/code] This is…
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

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