Tip Of The Day : Use dict

Have you fallen in love with the command line? Do you use a graphical browser to visit dictionary sites like wiktionary.org?

Use dictd.

What does dictd do?

[sudheer@localhost ~]$ yum info dictd
Loaded plugins: fastestmirror, refresh-packagekit
Installed Packages
Name       : dictd
Arch       : i386
Version    : 1.10.11
Release    : 3
Size       : 728 k
Repo       : installed
Summary    : DICT protocol (RFC 2229) command-line client
URL        : http://www.dict.org/
License    : GPL+ and zlib and MIT
Taxonomy upgrade extras: 

How To Configure Yum To Exclude A Mirror

Many of us have suffered from failing package repository mirrors. Some are slow, some won't have updated content, etc. You might want to remove/blacklist a particular mirror in your yum configuration.

Before trying to remove a mirror, install the fastest mirror plugin.

yum install yum-fastestmirror -y

The fastest mirror plugin is capable of determining mirror speeds and cache it. If that works for you well and good.

How To Set SVN_EDITOR Environment Variable To Vim

Problem: You are trying to use the command svn propedit svn:externals and you are receiving the error:

svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found

Solution: Set vim as your SVN_EDITOR


export SVN_EDITOR=vim

To permanently set this environment variable put the below line in your ~/.bash_profile file.

export SVN_EDITOR=vim

Did it solve your problem?

Taxonomy upgrade extras: 

Constants In PHP

We are all familiar with variables. As the name suggests the value of the given variable tends to vary.

$foo 'banana';

The above script illustrates the usage of variables. Variables in PHP are represented by a dollar sign followed by the name.

Just like variables, PHP offers constants. As the name suggests the value of the constant does not change throught the lifetime of the script.

How do you use constants?

Content Type: 

How To Access Action Helper In A Front Controller Plugin?


For example, you can access the redirector helper from within your front controller plugin:

$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');

FOSS Project: 
Content Type: 

How To Print The PHP Version In A PHP Script

Somebody recently asked me how to print the PHP version from within the PHP script. The answer is very simple and requires only two words to print the PHP version. Here is the script


PHP_VERSION is a predefined constant. It contains the value of the PHP version.

A sample output is as follows.

[sudheer@localhost cli]$ php php_version.php 
[sudheer@localhost cli]$ 
Taxonomy upgrade extras: 

PHP Script To Shorten URLs Using short.ie

We all know about the URL shortening service offered by many websites. Most notable among them is tinyurl.com. There are also other free URL shortening services available on the Internet.

In this post, I will show you how to generate a short URL link to any URL from a PHP script using the short.ie URL shortening service. The actual code is only about ten lines. We will make use of the Zend_Http_Client component of the Zend Framework.

Taxonomy upgrade extras: 

Include Path

What is include_path?

To include a file in your PHP script you use the include statement. Hard coding the complete file system path in all your include statements is unmaintainable. You cannot expect your application to be installed in the exact same location everywhere. Including the files from a relative path is so much more easier.

Let us write few simple scripts for demonstration purpose.

Create the file mymainfile.php and paste the below code in it.

/* @file mymainfile.php
echo "This is the main file" "\n";
Content Type: 

PHP Essentials

PHP Essentials is a tutorial aimed to help boost your PHP knowledge. The tutorial assumes you have some experience writing PHP scripts.

I have seen many people struggle with Zend Framework because of lack of PHP knowledge. Reading this series before you start using Zend Framework or any other PHP framework will help you immensely.

Content Type: 

How To Access View Object From View Helper

From your view helepr you might want to access

  • view object properties
  • the view object
  • another view helper

You will be able to do all of the above if the view object is available in your view helper. To make sure view object is available to your helper do any of the following

  • Easiest method: Extend Zend_View_Helper_Abstract

    class My_View_Helper extends Zend_View_Helper_Abstract{}
  • Implement the Zend_View_Helper_Interface
FOSS Project: