Search This Blog

Wednesday, October 27, 2010

Steps to install a plugin in Symfony

Listing 17-15 - Installing a Plug-In from the Symfony Wiki
> cd myproject
> php symfony plugin-install http://plugins.symfony-project.com/pluginName
> php symfony cc


Listing 17-16 - Installing a Plug-In from a Downloaded PEAR Package
> cd myproject
> php symfony plugin-install /home/path/to/downloads/pluginName.tgz
> php symfony cc


Listing 17-17 - Installing a Plug-In from a PEAR Channel
> cd myproject
> php symfony plugin-install channelName/pluginName
> php symfony cc


Don't forget to enable the plugin in ProjectConfiguration.class.php
$this->enablePlugins('sfTaskExtraPlugin')

read more

Ubuntu command to get the System hardware configurations

Run this command as the super user to get the complete hardware configurations
>lshw

Tuesday, October 26, 2010

How to run a single PHP Unit Test

How to run a single PHP Unit Test

phpunit --filter EmpSalaryReportTest AllTests.php

// Get unit test coverage report

phpunit --coverage-html ./report BankAccountTest

phpunit --coverage-html AllTests AllTests.php

Sunday, October 24, 2010

How to change MySQL admin password

mysqladmin -u root -p 'oldpassword' password newpass

MySQL case sensitivity of table names

When you transport databases from Linux to windows you may encounter errors due to table names being in uppercase . This happens because windows is case sensitive. You can override this problem by adding this parameter to your my.ini file.

lower_case_table_names=0


more on mysql site

Thursday, October 21, 2010

How to import project to SVN

This is useful if you want to move a copy of existing svn
directory to another svn directory
$ svn import -m "Adding the new file" 
              ourProject http://yourserver/repos/

Friday, October 15, 2010

How to create a new svn project and upload files

First create a new directory by issuing this command in the terminal
>svn mkdir -m "message" 
http://svnserver.com/repos/abc

now go to your working directory

abc>svn import -m "message" 
http://svnserver.com/repos/abc 
-m  has the comment you can write anything inside

Install Bisigi theam in ubuntu

sudo add-apt-repository ppa:bisigi/ppa && sudo apt-get update

sudo apt-get install bisigi-themes

Thursday, October 14, 2010

How to restore accidentally deleted crontab file

If you have accidentally deleted crontab file, probably using -r instead of -e. It happens because the keys are at the same place :-) , this is could be the rescue. Try to find the file inside Tmp folder.

go to /tmp

ls -ltr cron*

This will show a history of files. Choose the most reason one.

Monday, October 11, 2010

Command to list the disk partitions in Ubuntu

Command to list the disk partitions in Ubuntu . Login as the admin type this in command line

>fdisk -l

Thursday, October 7, 2010

Find an element Id which match a pattern in jquery

Using jquery its possible to find an element that matches a specific pattern. This code will find each input Id and check if its greater than 24

           $("input[id^=duration_]").each(function() {

                if($(this).val()>24){
                    alert('Duration should be less than 24');
                     returnValue = false;
                }

            });
more examples 

Tuesday, October 5, 2010

How to find the history of the commands given in Ubuntu

Type this command in the ubuntu console

>history

If you need a specific set of commands

>history|grep svn

How to revert svn repository to previous version number

svn merge -rHEAD:4130 .

How to svn check out from a specific revision number

svn co -r REVISION SOURCE 

How to rename svn repository

If you want to rename a svn repository you can use either of these commands

svn move SOURCE DESTINATION
svn rename SOURCE DESTINATION