Tuesday, 28 June 2011

How to check where our database files located in linux?

Go to mysql using command line.

> mysql -u root -p
mysql> SHOW VARIABLES LIKE 'datadir';
+---------------+-----------------+
| Variable_name | Value           |
+---------------+-----------------+
| datadir       | /var/lib/mysql/ |
+---------------+-----------------+

Now

exit from mysql and do the follwoing

> cd /var/lib/mysql

Here you will see all the database exist in this folder.

Cheers!

Wednesday, 11 May 2011

How to get difference between two folder using linux command?

Hi

Use the following syntax to get difference b/w folders:

 diff  /home/ashwanik/public_www/openid_old /home/ashwanik/public_www/openid_new  |sort


To check recursively go down subdirectories, add -r.

diff -qr <first folder> <second folder>  |sort


Cheers!

Tuesday, 10 May 2011

How to create error pages in symfony?

Hi Guys,

Symfony provides following error pages:
1.) indexSuccess.php
2.) error404Success.php
3.) loginSuccess.php
4.) secureSuccess.php
5.) disabledSuccess.php
6.) unavailableSuccess.php

The above files you can find on your project. Below is the location of files;

 /var/www/project-folder/lib/vendor/symfony/lib/controller/

in controller folder, you will find a "default" module.

so all success files are located in default/templates/

Either change files here OR copy "default" module and paste it into your apps/frontend/modules/


There are two another pages which also need to be customized. you will find these default pages in the symfony_data_dir/web/errors/ directory:

    1) error500.php: Page called when an internal server error occurs.
    2) unavailable.php: Page called when a user requests a page while the cache is being cleared.

To customize these pages, create error500.php and unavailable.php pages in your application's web/errors/ directory.  Symfony will use these instead of its own.



Cheers!

Saturday, 30 April 2011

How to setup symfony project?

Hey Fox,

Download symfony project.
create folder let suppose symfony_test i.e, mkdir symfony_test
Go into symfony_test and create lib folder i.e, c:\>symfony_test> mkdir lib
Go into lib folder and create vendor folder ie., c:\>symfony_test\lib\> mkdir vendor

Now,

extract symfony project into vendor folder.

Further, open command prompt and type the following
c:\> cd wamp\www\symfony_test
c:\wamp\www\symfony_test> php lib\vendor\symfony\data\bin\symfony generate:project jobeet
c:\wamp\www\symfony_test> php symfony configure:database "mysql:host=localhost;dbname=jobeet" root root
c:\wamp\www\symfony_test> symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret frontend


OR



Now, create the frontend application by running the generate:app task:
$ php symfony generate:app frontend




create model, form and filter on the basis of schema.yml and then

I am going to create a module "job" on the basis of model "JobeetJob"

c:\wamp\www\symfony_test> php symfony doctrine:generate-module --with-show --non-verbose-templates frontend job JobeetJob


Cheers!



How to run symfony on dos prompt?

Hey,

To run symfony in windows machine, you just set the Environment Vairables if not set for php.

Following are the steps to set Environment Variables on window machine:

Right click on MY Computer
Go to properties
Choose the Advanced tab
Click Environment Variables
Now you can edit the environment variables of the system.
In this window, you will see User Variables and System Variables.
If you change in User Varibale then changes will be applicable for your login only.
If you change in System Variable then changes will be applicable for all users.
So,
find "PATH" variable in the list of system variables.
Select it and press edit button given below.

Let Suppose, this example using wamp and wamp installed in D: drive.

now,

append the following line in variable value fields:
D:\wamp\bin\php\php5.2.8\

this folder conatains php.exe file.

now press OK and save the configuration.

Futher, the most important point. Restart your machine.


Note the ; character. It is used to separate directories in the variables, so be sure it is present.

Again, D:\path\to\php is where your php.exe is located.

Cheers!

Wednesday, 27 April 2011

How to read last 10 line in a file using linux command?

tail -10 filename

also,

tail -f filename

Cheers!

How to go start and end of the file open fron VI?

For Beginning press esc then :0
For Ending press esc :$ OR shift+g

Cheers!