Sunday 9 August 2009

change or reset ples admin password

find this tool through remote desktop connection ,

C:\Program Files\Parallels\Plesk\admin\bin\plesksrvclient.exe

click on that, and it will ask for a new password.


Saturday 25 July 2009

remove phocagallery logo

change this

echo $this->tmpl['phocagalleryic'];

but, commercial version is recommended.



Wednesday 22 July 2009

for debugging joomla

rename the index.php to index_main.php

then , create new index.php and paste the code
error_reporting(E_ALL);
ini_set("display_errors", 1);
include("index_main.php");
?>

Tuesday 9 June 2009

Auto submit updated sitemap.xml to google webmasters with php code

Theory

To resubmit your Sitemap using an HTTP request:

Issue your request to the following URL:
www.google.com/webmasters/tools/ping?sitemap=sitemap_url
For example, if your Sitemap is located at http://www.example.com/sitemap.gz, your URL will become:
www.google.com/webmasters/tools/ping?sitemap=http://www.example.com/sitemap.gz
URL encode everything after the /ping?sitemap=:

www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.yoursite.com%2Fsitemap.gz
Issue the HTTP request using wget, curl, or another mechanism of your choosing.

A successful request will return an HTTP 200 response code; if you receive a different response, you should resubmit your request. The HTTP 200 response code only indicates that Google has received your Sitemap, not that the Sitemap itself or the URLs contained in it were valid. To obtain status information about your Sitemap, resubmit it using Webmaster Tools account. We recommend that you resubmit a Sitemap no more than once per hour. An easy way to do this is to set up an automated job to generate and submit Sitemaps on a regular basis.

Code

I got the code from here
http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl#curlinit

The quick code

function get_web_page( $url )
{
$options = array(
CURLOPT_RETURNTRANSFER => true,     // return web page
CURLOPT_HEADER         => false,    // don't return headers
CURLOPT_FOLLOWLOCATION => true,     // follow redirects
CURLOPT_ENCODING       => "",       // handle all encodings
CURLOPT_USERAGENT      => "spider", // who am i
CURLOPT_AUTOREFERER    => true,     // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
CURLOPT_TIMEOUT        => 120,      // timeout on response
CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
);
$ch      = curl_init( $url );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err     = curl_errno( $ch );
$errmsg  = curl_error( $ch );
$header  = curl_getinfo( $ch );
curl_close( $ch );
$header['errno']   = $err;
$header['errmsg']  = $errmsg;
$header['content'] = $content;
return $header;
}

$result = get_web_page('www.google.com/webmasters/tools/ping?sitemap='.urldecode('http://site.com/sitemap.xml'));
if ( $result['errno'] != 0 )
echo "error , bad url";
if ( $result['http_code'] != 200 )
echo "error , no servivice";
$page = $result['content'];
echo $page;
?>
output

"Sitemap Notification Received

Your Sitemap has been successfully added to our list of Sitemaps to crawl. If this is the first time you are notifying Google about this Sitemap, please add it via http://www.google.com/webmasters/tools/ so you can track its status. Please note that we do not add all submitted URLs to our index, and we cannot make any predictions or guarantees about when or if they will appear."
 

After this, put a cron tab to the link , Note that please dont go less than a hour request to google. otherwise they will be angry.

Monday 25 May 2009

Hackers successfully stole passwords from some of Facebook's 200 million users.

Hackers successfully stole passwords from some of Facebook's 200 million users.
By Jim Finkle, Reuters, 15 May 2009 at 08:11

Facebook has been hit by another hacking attack, as a phishing campaign was used to steal passwords from users of the social networking site.

Facebook spokesman Barry Schnitt said that the site was in the process of cleaning up damage from the attack, and that that Facebook was blocking compromised accounts.

Schnitt declined to say how many accounts had been compromised.

The hackers got passwords through what is known as a phishing attack, breaking into accounts of some Facebook members, then sending e-mails to friends and urging them to click on links to fake websites.

Those sites were designed to look like the Facebook home page. The victims were directed to log back in to the site, but actually logged into the one controlled by the hackers, unwittingly giving away their passwords.

The fake domains include www.151.im, www.121.im and www.123.im. Facebook has deleted all references to those domains.

Schnitt said that Facebook's security team believes the hackers intended to collect a large number of credentials, then use those accounts at a later time to send spam hawking fake pharmaceuticals and other goods to Facebook members.

The site fought off a similar attack two weeks ago, he said.

Hackers used a phishing attack last year to spread a malicious virus known as Koobface, a reference to Facebook. It was downloaded onto Facebook members' PCs when they clicked on a link sent to them in an email that looked like it had been sent by a friend on Facebook.

originally posted in
http://www.itpro.co.uk/610861/massive-phishing-attack-hits-facebook?DCMP=KNC-1026&HBX_PK=face+book+password&HBX_OU=50&gclid=CK7Ts9zx1poCFYQH3wodJyBO1g

Wednesday 13 May 2009

Tuesday 12 May 2009

dreamweaver regular expressions

for full look
http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions.html


Regular expressions are often used for performing document-wide find-and-replace actions. In some cases, skilled regular expression authors bravely use regular expressions to make changes across dozens or even hundreds of documents.

In this example, I will show you how to use regular expressions to replace a piece of content.

Imagine a scenario where you've been asked to update an older web page and replace a specific string of text that uses  and a messaging "Hello world." You've been asked to:

  1. Replace the  tags with the more modern, compliance-friendly  tag.
  2. Substitute the word "world" and the closing period with your own name followed by an exclamation mark.

Imagine that the document you are presented looks something like this:

   Untitled Document     Hello world. Hello world. Hello world.   

There are not one but three instances of the font tag and text in question.

In order to accomplish this task, I'll need to introduce a new concept: subexpressions.

Introducing Subexpressions

Regular expressions enable you to define subexpressions in order to refer later to certain fragments of your pattern. Subexpressions are defined using parentheses. A basic example of a subexpression would be a regular expression that looks like this:

(a)(b)(c)

This regular expression defines three subexpressions. The first expression pattern (a) can be referred to as the variable $1, the second (b) as $2, and the third (c) as $3. References to subexpressions are created sequentially beginning with 1.

Applying Subexpressions to the Problem

Now that I've explained what subexpressions are and how they can be used to reference pieces of an expression, you will use them to help solve the problem.

I've defined the following regular expression to match the text in the document.

(]*>)(Hello )(world.)()

First, notice that there are four subexpressions defined in this regular expression. The first subexpression matches the beginning  tag ($1), the second matches "Hello " ($2), the third matches "world." ($3), and the fourth matches the closing  tag ($4). Although the subexpressions do not affect the criteria of the search, they do enable you to define logical groupings.

Complete the example now by performing the following steps:

  1. Create a new HTML document in Dreamweaver.
  2. Switch to Code view by selecting View > Code.
  3. Copy and paste the following three lines inside the  tag.
    Hello world. Hello world. Hello world.
  4. Set the cursor to be at the first line of the document.
  5. Open the Find and Replace dialog box by selecting Edit > Find and Replace.
  6. Select the Use regular expressions check box to enable regular expression searches.
  7. Select the Match case check box.
  8. Select Current Document in the Find In pop-up menu.
  9. Select Source Code in the Search pop-up menu.
  10. Type the following regular expression in the Find text box:

    (]*>)(Hello )(world.)()

  11. Click Find Next and verify that all three instances of the  tag are selected, one at a time. This verifies that the regular expression is in fact matching.
  12. Type the following regular expression in the Replace text box:

    $2Rob!

    In the Replace text box, you are indicating that you want to replace the entire font tag with a string that begins with the  tag, followed by the second subexpression of the regular expressions you're searching for, followed by my name and a closing tag. In other words, you want to preserve the subexpression "Hello" and make changes before and after it (see Figure 12).

    The Find and Replace dialog box with regular expressions in the "Find:" and "Replace:" text boxes

    Figure 12: The Find and Replace dialog box with regular expressions in the Find and Replace text boxes

  13. Click the Replace All button.
  14. In Code view, you should see that all three  tags have been removed and replaced with a newly constructed string that contains one fragment of the original string ("Hello").

    Code view showing "Hello Rob!" where the "<font> tags and Hello World used to be

    Figure 13: Code view showing "Hello Rob!" where the tags and Hello World used to be