This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up Liferay on Ubuntu 10.04 | |
# Add java repository & install java | |
add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
apt-get update | |
apt-get install sun-java6-jdk | |
apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts | |
# Tell ubuntu to use java | |
update-java-alternatives -s java-6-sun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cat { width: 100%; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User-agent: * | |
Disallow: */trackback* | |
Disallow: /wp-* | |
Disallow: */feed* | |
Disallow: /20* | |
User-Agent: MediaPartners-Google | |
Allow: / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install php-apc | |
/etc/init.d/apache2 restart | |
php -r ‘phpinfo();’ | grep ‘apc’ # See if output shows apc is on | |
apt-get install php5-memcache | |
nano /etc/php5/apache2/php.ini | |
# Change session.save_handler = files to | |
session.save_handler = memcache | |
session.save_path = “tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15″ | |
/etc/init.d/apache2 restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getinboundLinks($domain_name) { | |
ini_set('user_agent', 'NameOfAgent (<a class="linkclass" href="http://localhost">http://localhost</a>)'); | |
$url = $domain_name; | |
$url_without_www=str_replace('http://','',$url); | |
$url_without_www=str_replace('www.','',$url_without_www); | |
$url_without_www= str_replace(strstr($url_without_www,'/'),'',$url_without_www); | |
$url_without_www=trim($url_without_www); | |
$input = @file_get_contents($url) or die('Could not access file: $url'); | |
$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function reverseIP($IP) | |
{ | |
for($f=0; $f <= 2; $f++) | |
{ | |
// this will list the results in the first two page...alter the code to get results from more number of pages | |
$url='<a class="linkclass" href="http://www.bing.com/search?q=ip%3A">http://www.bing.com/search?q=ip%3A</a>'.$IP.'&first='.$f.'1&FORM=PORE'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getUrlData($url) | |
{ | |
$result = false; | |
$contents = getUrlContents($url); | |
if (isset($contents) && is_string($contents)) | |
{ | |
$title = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("EmailNewLine", "\r\n"); | |
define("EmailXMailer", "PHP-EMAIL, Samplephpcodes.com"); | |
//** the default charset values for both text and HTML emails. | |
define("DefaultCharset", "iso-8859-1"); | |
function htmlmail($to, $subject,$content,$cc,$bcc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function VerifyEmail($email){ | |
return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email); | |
} | |
if(VerifyEmail('<a class="linkclass" href="mailto:[email protected]">[email protected]</a>')) { | |
echo 'valid email'; | |
} else { | |
echo 'in valid email'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$XMLoutput = "<?xml version=\"1.0\"?> | |
<rss version=\"2.0\"> | |
<channel> | |
<title>PHP RSS XML FEED</title> | |
<link><a class="linkclass" href="http://www.exampledomain.com/RSS-XML-FEED.php">http://www.exampledomain.com/RSS-XML-FEED.php</a></link> | |
<description>RSS Feed Description</description> | |
<language>en-us</language> | |
<pubDate>dd/mm/yy</pubDate> | |
<lastBuildDate>dd/mm/yy</lastBuildDate> |