Loading

How To Install LAMP

how to install LAMPLAMP is an acronym which stands for Linux, Apache, MySQL and PHP. The letter P also stands for Perl and Python programming languages. LAMP is a free software stack which powers, primarily, web servers. Most GNU/Linux distributions bundle these packages in the install media and repositories. Let us take a look at how to install LAMP using Fedora. I will restrict the P in LAMP to PHP only for this article. Perl and Python fans, bear with me.

While installing Fedora you can choose to install "Web Sever" which contains these packages. You can install them later also. Let me walk you through the actual steps to get LAMP working on your computer. I assume you are running Fedora 8 on your computer.

1. Launch the terminal by clicking

Applications>System Tools>Terminal


Are You Looking For .pidgin Directory?

Do you want to copy your pidgin settings from one computer to another? Do you want to fiddle with your pidgin settings? You are likely to look for a directory called .pdigin.

Pidgin stores its files in ~/.purple

Copy that directory to copy your pidgin settings on the new computer.


How To Reset KWallet Password

The problem: You fire a KDE application, the application requires a password to continue, the KWallet window pops up asking for its password. You try your frequently used passwords. None of them work.

This happened to me when I tried to open a password protected PDF document with Okular. I knew I never set the KWallet password on this computer.

The solution: To reset your KWallet password, delete the kwalllet directory.
Type this in your command line:

rm -rf ~/.kde/share/apps/kwallet/


Adding * To Required Zend_Form Field Using CSS

You want to add an asterisk to required fields, huh?

add asterisk to zend form required element

There are many approaches to accomplish this. One among them is setting the requiredSuffix option to the label decorator of the form element. Assuming $element is your Zend_Form_Element object:

<?php
$element
->getDecorator('label')->setOption('requiredSuffix'' * ');
?>

Another option is to add the * while setting the label.

<?php
$element
->setLabel('My Label *')
?>

The third, which I am currently using in one of my Zend Framework powered applications is adding * using CSS. The default label decorator generates the following mark-up.


Autocomplete Example With Zend_Dojo_Form_Element_FilteringSelect And Zend_Dojo_Data

Zend Framework AutoComplete example with Zend_Dojo_Form_Element_FilteringSelect
Zend Framework brings lot of user interface goodies with Zend_Dojo family of classes. In this article let us explore how to build a form element with autocomplete feature.

As a prerequisite you must be familiar with

  • Zend_Controller_Action
  • Zend_Layout
  • Zend_Form

Would it be nice if I tell you that you don't need any JavaScript knowledge? Zend_Dojo empowers PHP programmers to build dynamic and appealing forms without writing a single line of JavaScript.

This example has been tested with Zend Framework 1.7.0.

In this example, we will build a text element where the visitor can either select the user from the drop down list or type the username. While typing the username, the form element generates a drop down list filtering the data from user input. Take a look at the filteringSelect Dijit example to understand the type of form element we will be building.

FilteringSelect differs from Combobox Dojo widget in that, the value of the form element must be provided in the list. Also, you could display the username on the screen and set the 'user id' as the element value.

We will use the autoCompleteDojo action helper to send JSON data.

Let's start coding.


Zend Framework

This book is a collection of articles related to the Zend Framework.


Installation Of phpunit/PHPUnit Requires PHP Extension dom

So, you are trying to install phpunit/PHPUnit via pear and you got a message that PHP extension dom is required.

Here's how your resolve it.

pear channel-discover pear.phpunit.de

You would see output like:

Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded

Next, install phpunit/PHPunit

pear install phpunit/PHPUnit

Oops. It fails. Sample message below:
 


How To Determine The File System Type Of A Device

There are situations where you would want to check the file system type of a device. Fdisk prints the partitions (or devices).

To determine the file system type use the command file.

file -s <devicename>

Sample usage

[root@localhost downloads]# file -s /dev/sda3
/dev/sda3: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
[root@localhost downloads]# 

The sample output clearly shows the filesystem type as ext3.


Use Okular To View PDF Documents

Ever since I discovered Okular, a universal document viewer for KDE 4, I haven't used another PDF document reader. I just love the KDE user interface. You should also try it. I'm sure you will like it.

Lately, I have been working on a web application that generates PDF quotes on the fly. While writing the PDF document generator script, I have to run the script and see how the document formatting has appeared. With Okular, I open the document only once. Upon each successive write operation to the PDF file, Okular refreshes the document. How cool.


How Do I Remove Alpha Channel From The Image Using GIMP

As per the Wikipedia "alpha compositing is the process of combining an image with a background to create the appearance of partial transparency". To remove the transparency or the alpha channel:

  1. Fire up GIMP
  2. Open the image for which the alpha channel has to be removed
  3. Click the Image menu on the image window
  4. Click Flatten Image from the pull down menu
  5. Save

In short, remember to flatten the image when you want to remove the alpha channel.

Quote from the GIMP docs:


Syndicate content