Converting audio and video file formats in Linux

The gold standard of converting audio and video file formats in Linux is FFmpeg. It is a command-line tool capable of recording, converting and streaming audio and video. This article only covers audio and video file format conversion and show how easy it is to use. Installing FFmpeg Chances are that you already have FFmpeg installed on your system. Do the following to check to see, if it is installed.

$ which ffmpeg /usr/bin/ffmpeg


Testing mod_rewrite

To test whether mod_rewrite is working, create a .htaccess file inside your webroot as follows:

RewriteEngine on
RewriteBase /
RewriteRule ^test.php$ rewrite.php

Create file test.php in the same directory with the following code:

echo 'mod_rewrite is not working';

Create file mod_rewrite.php in the same directory with the following code:

echo 'mod_rewrite is working';

PHP Manipulating XML with SimpleXML

SimpleXML is a SAX XML parser. It represents an XML document as a hierarchical set of objects and properties where each element is an object and each attribute is an object property.

Access an XML element using SimpleXML

<?xml version='1.0'?>
   <hotel stars="5">
       <name>President Wilson</name>

Save this file as hotel.xml

How to turn off drupal messages

A red error message displaying on your webpage, visible to every visitor is the worst thing you can do to your site. Unfortunately, drupal displays error messages on the screen by default. There are several solutions to this problem.

1. Install disable_messages plugin

The disable messages plugin is only available for drupal 6 and drupal 7.

2. Edit page.tpl file

Remove the following piece of code from your page.tpl file

Counting cells in Excel

Excel provides 4 different functions to count cells: count(), counta(), countblank(), countif()


Counts cells in the range which hold a value. Empty cells and cells containing formulas are not counted.


Counts non-empty cells in the range. Cells containing formulas are counted.


Counts empty cells in the range.


Counts cells in the range which satisfy a condition. In this example, only cells with value less than 10 are counted.