Setup zend command line tool in ubuntu

Submitted by admin on Sat, 05/26/2012 – 20:19

We should ensure these points while setting the zend framework command line tool in linux/ubuntu

  1. zf.sh should be system path – most appropriate plac to put this file is /usr/bin. or you can make a symbolic link for this file inside /usr/bin
  2. Zend framework library should be in include_path.

To ahcieve point 2 approach as below –

$locate php.ini

It will result the path of php.ini file in ubuntu. let say it is /etc/php5/cli/php.ini

$sudo vi   /etc/php5/cli/php.ini

Find the include_path and add the zend framework library in this path

Now type

$zf or $zf.sh and it’s done.

Unserialize in php and serialize in jquery

Let say we have a form which we are serializing using jquery. Code snippet to serialize the form is –

var serializedData = $(form).serialize(); 
// post this data using jquery post to php page 
$.post( 'processSerializedData.php', {data:serializedData}, function(data){ } )

Now unserialize the data in php using below code snippet –

$serializedData = $_POST['data']; 
$unserializedData = array(); 
parse_str($unserializedData,$serializedData); 
print_r($unserializedData);

That’s It

Manage themes using drush in drupal

 

Here is the important commands to play with themes in drupal. for example if we want to enable and disable the themes using drush or we want to set the default theme using drush etc.

1.) Enable theme
drush pm-enable themename

2.) Disable theme
drush pm-disable themename

3.) Show information about the theme
drush pm-info themename

4.) List all theme
drush pm-list --type=theme

5.) List enabled theme
drush pm-list --type=theme --status=enabled

6.) Set default theme
drush vset theme_default themename

7.) Set admin theme
drush vset admin_theme themename

8.) show theme status
drush status theme

Why to use the Meta Tags ‘NOODP’ and ‘NOYDIR’ for SEO?

While doing the study for the SEO, I came to know about the meta tags <meta name=\”ROBOTS\” content=\”NOODP\”>. As I do not know about this tag so i started digging about this tag and i am curious to know what are the pros and cons of using this meta tag.

Search engines some time use the title and Snippet (description) from ODP listing of a website in the search result page listing.  To disallow the search engines from using the title and description from ODP listing, this meta tag is used. The NOODP tag allows you to essentially opt out of the open directory
project title and description override. ODP listing title and description are updated after 3-4 days by the crawlers. This tag will help in overriding the values of the ODP listing and allow using the new updated values for page title and description. So, it will help in listing of the recent values of the page titles and description.

Now the \”NOYDIR\” meta tag in the content is basically used for the Yahoo directory listing. This metatag content will help in overriding the page title and description listed on the Yahoo Directory. Its use is similar as the above NOODP tag except it is used for Yahoo Directory!

In 2006 Microsoft introduced \”NOODP\” value for the robots Meta tag, Google followed this in July 2006 and Yahoo! in October 2006.

The syntax for using this Meta tag in your website is as follow :

  • For Google : To disallow google bot to list the page snippet and title we should use the below tag :
    <meta name=”googlebot” content=”NOODP” />
  • For Yahoo, if you want that yahoo does not use the title and snippet from ODP, Use the following tag :
    <meta name=”slurp” content=”NOYDIR” />
  • For MSN bot use the below tag :
    <meta name=”msnbot” content=”NOODP” />
  • To implement this tag in one line we can use the following :
    <meta name=”robots” content=”NOODP,NOYDIR” />

Where to add this meta tag on your webpage?
You can add this tag in the <head> section of your website. For e.g

<head>
<meta name=”robots” content=”NOODP,NOYDIR” />
</head>

So, now you dont need to worry about updating the page title and meta description in the Yahoo and OPD. As, You are using these tags and this will avoid allowing the search engines to use an older, outdated and possibly the irrelevant title and description from these two sources.

* ODP = Open Directory Project = DMOZ listing

How to deny specific urls of a website from a network in apache configuration file

Blog-Category:
Tags:
htaccess

Here is an example to avoid any url to be accessed outside the networks listed. Let’s say we have some urls on our website www.site_name.com/url_one & www.site_name.com/url_two. We want somebody outside our own network should not be able to access these pages. We can write some lines to achieve this in .htaccess files.

Let say we have IPS of our network 198.10.10.10 168.10.10.10 158.10.10.10 148.10.10.10. Then to avoid url_one and ulr_two should be accessed outside the given IPS write below lines in htaccess file.

SetEnvIf Request_URI “/url_one” restrict_two_urls
SetEnvIf Request_URI “/url_tow” restrict_two_urls

Order deny,allow
Deny from env=restrict_two_urls
Allow from 198.10.10.10 168.10.10.10 158.10.10.10 148.10.10.10