Feb 19

If after upgrading the MySQL to higer version, PhpMyAdmin still reports the old MySQL version then following steps should be performed:

mv /usr/local/cpanel/lib/libmysqlclient.so.14 /usr/local/cpanel/lib/libmysqlclient.so.14.backup
ln -s /usr/lib/libmysqlclient.so.15.0.0 /usr/local/cpanel/lib/libmysqlclient.so.14

Feb 19

You may have experienced this issue that the Horde doesn’t login to the mailbox and on clicking the Login button, the page just refreshes and continue to load the same login page. The most possible reason is that the Horde session table is corrupt. I will explain step by step that how we can check and fix this session table issue. Continue reading »

Feb 19

Collation refers to the character set used to store data in text fields and is necessary to provide support for all of the many written languages of the world. Collation can be changed for the database, tables or even columns. Continue reading »

Feb 19

A short bash command to update the serials for all the domains on the server. You can specify the new serial number and change the directory where the DNS zone files are present. I used this command when I performed bulk migrations.

for i in `ls /var/named/*.db` ; do cat $i | sed ’s/[0-9]\{10\}/2008021901/g’ > $i.new; mv -f $i.new $i; chown named.named $i ;done

Feb 19

Freetds is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server. A clinet requested to have it compiled with PHP so I did it for him and wrote a guide to be used in future. I am writing the installation of freetds and then php compilation with mssql support. Continue reading »

Feb 19

DNS stands for “Domain Name System” and helps resolving domain names to IP numbers as it is much easier for people to remember logical names rather then a 12 digit number. DNS uses 3 major components”Resolvers (client)”, “Name Servers” and “Domain Name Space”. In basic DNS communication a client (Resolver) sends a query to a Name Server, which returns with the requested information or an address for another Name Server, an error message is received if the query gives no results. Continue reading »

Feb 19

A database is a collection of data organized in a particular way. Databases are managed by DBMS (Database Management Systems) like MySQL, PostGreSQL, Oracle, Microsoft SQL Server, IBM DB2 etc. SQL is the language used to query all databases. It’s simple to learn and appears to do very little but is the heart of a successful database application. Continue reading »

Feb 19

You may have seen core.xxxx (where xxxx can be any number) files on your server and noticed that these files consume alot of space and sometimes a disk partition reaches its limit because its full of core dump files. So whats this file for? Basically when any process crashes or get terminated abnormally then kernel dumps the data residing in the memory at that time in to a core file so that it can be debugged later to find the cause of abnormal termination. The detailed and well explained description can be found at Core dumps. If you want to clear up these core files consuming your server’s disk space then you can run the following command:

find / -name “core.[0-90-9]*” -type f ! \( -name virtfs -type d \) -print | xargs rm -vf

The above command will search the entire server for any file named core.xx and will delete it. Before running this command, I would recommend to first check that what will be deleted by running:

find / -name “core.[0-90-9]*” -type f ! \( -name virtfs -type d \) -print

It will show all the core files present on the server. You should go through the list and if you see that all are core dump files then use the first command to delete all the core dump files to free up the space.

Use the “file” command to see what application caused them to be generated. For example:

$ file core.1234

They were most likely the result of a PHP process crashing for some reason that would require further investigation, such as with gdb:

$ gdb /usr/bin/php core.1234

Feb 19
  • Reboot the system and wait for the GRUB screen to appear.
  • Highlight the kernel version you’re currently using (usually the newest version) from the GRUB list.
  • Press “e” to be taken to the boot commands edit screen, highlight the line which starts with kernel and press “e” again.
  • Add “single” to the end of the line, so it will look like this:

kernel /vmlinuz-kernel-version ro root=LABEL=/ rhgb quiet single

  • Press “Enter” to save the changes
  • Press “b” to boot in single user mode.

The system will begin loading and, at some point, you will be presented with a root bash prompt.

In the new prompt type “passwd” and choose a new password for root.When done, type reboot to restart the system. After reboot, GRUB will be back to normal so no further modifications are required.

NOTE: If you are asked for the root password before dropping you in a bash prompt in single user mode, you should follow the instructions above and append “single init=/bin/bash” to the kernel line, not just “single“.

Feb 14

I wrote this bash script to control DDOS attack. It doesn’t block the Ips automatically but will show you a list of Ips that have more connections than defined in Max variable. It will display a menu and its easy to use. The script will also log the activities in a log file so you can latter check that which Ips were blocked by it. Continue reading »