Install PHP 5.2.6 on CentOs 5.x

Oddly enough, PHP 5.2.6 is still not available on default CentOS repositories ([base], [updates], [addons], and [extras]), latest PHP available in those repos is PHP 5.1.6!

In order to install PHP 5.2.6 you can add the CentOS testing repository and enable it then … continue reading »

Smarty error: Warning: preg_match() [function.preg-match]: Compilation failed: repeated subpattern is too long at offset 18454 in …

Warning: preg_match() [function.preg-match]: Compilation failed: repeated subpattern is too long at offset 18454 in /var/www/html/[...]/Smarty/Smarty_Compiler.class.php on line 454

It looks that you are running an old version of Smarty, latest version as I write is 2.6.26, you can download it from here.

MySQL script files tutorial for beginners

What is a MySQL script file?.. Why use it?

A MySQL script file (aka MySQL batch file) is a regular text file containing MySQL statements separeted by terminantors, statements in a MySQL script file can be executed from the MySQL client, this is very useful, many PHP script available online come with MySQL script files that need to be executed as part of the PHP script installation process, … continue reading »

How to read .chm files in Ubuntu

This tutorial assumes that you are a sudoer running Gnome

What is .chm

Wikipedia says:

Microsoft Compiled HTML Help is a proprietary format for online help files, developed by Microsoft and first released in 1997 as a successor to the Microsoft WinHelp format. It was first introduced with the release of Windows 98, and is still supported and distributed through Windows XP and Vista platforms.

Install Xchm

The default installation of Ubuntu doesn’t include any reader for CHM help files, but you can add one easily. … continue reading »

How to upgrade Ubuntu from 8.10 to 9.04 using the command line and the Internet?

The answer is rather simple and consists of one or two commands:

First make sure that you have the update-manager-core package installed with:

sudo apt-get install update-manager-core

Then start the upgrade

sudo do-release-upgrade

Generate passwords with JavaScript


The function generatePassword() is a simple yet customizable function that generates a random password string, the default password length is 6, you can override it by calling the function like thisĀ  generatePassword(n) where n is the password length. The possible characters are defined within the function with the variable chars … continue reading »

How to style input fields with CSS?

There are situations where you need to style input fields depending on there types.

Doing this is wrong:

input{
    border:solid 1px red;
}
bad input css

As you see in the image, the CSS rule has been applied to all input fields … continue reading »

Generate a negative random number using JavaScript

Ok, so you already know how to generate positive rondom numbers but let’s do it again:

To generate a random number varying from 0 to 9 we will use this code … continue reading »

What is the best free PhotoShop alternative?

The GIMP is the oldest and surely the best free open source image manipulation program, there are many forums that support it an you can find tutorials very easily.

The Gimp is available on UNIX, Windows and Mac OS and can be downloaded for free at http://www.gimp.org/downloads/.

What is email tracking?

E-mail tracking is used by individuals, e-mail marketers, spammers and phishers, to verify that e-mails are actually read by recipients, that email addresses are valid, and that the content of e-mails has made it past spam filters. … continue reading »