<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mental notes to myself &#187; Hacks</title>
	<atom:link href="http://livebookmark.net/journal/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://livebookmark.net/journal</link>
	<description>web, money and etc.</description>
	<lastBuildDate>Sat, 31 Oct 2009 15:36:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to make Facebook shared links appear nice</title>
		<link>http://livebookmark.net/journal/2009/09/23/how-to-make-facebook-shared-links-appear-nice/</link>
		<comments>http://livebookmark.net/journal/2009/09/23/how-to-make-facebook-shared-links-appear-nice/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 17:53:11 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/?p=177</guid>
		<description><![CDATA[I&#8217;m sure you&#8217;ve seen links posted to Facebook and the video or the core content image appear nicely. Namely the content preview

Here is the document explaining how to do that. 
Making Sure the Preview Works (For Advanced Partners)
Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure you&#8217;ve seen links posted to Facebook and the video or the core content image appear nicely. Namely the content preview</p>
<p><img src="http://livebookmark.net/journal/wp-content/uploads/2009/09/facebook-preview-300x183.jpg" alt="facebook-preview" title="facebook-preview" width="300" height="183" class="alignleft size-medium wp-image-180" /></p>
<p>Here is the document explaining how to do that. </p>
<p><a href="http://www.facebook.com/share_partners.php">Making Sure the Preview Works (For Advanced Partners)</a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2009/09/23/how-to-make-facebook-shared-links-appear-nice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>oci_bind_by_name maxlength is not so optional</title>
		<link>http://livebookmark.net/journal/2008/05/06/oci_bind_by_name-maxlength-is-not-so-optional/</link>
		<comments>http://livebookmark.net/journal/2008/05/06/oci_bind_by_name-maxlength-is-not-so-optional/#comments</comments>
		<pubDate>Tue, 06 May 2008 15:22:25 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/?p=168</guid>
		<description><![CDATA[If you think that the maxlength parameter in the documentation of oci_bind_by_name is optional, see this example and think again.
Lets say you have your column names in an array already and you want to bind them in a loop smartly.


$cols = array('a','b','c');
$data = array(
            [...]]]></description>
			<content:encoded><![CDATA[<p>If you think that the maxlength parameter in the documentation of oci_bind_by_name is optional, see this example and think again.<br />
Lets say you have your column names in an array already and you want to bind them in a loop smartly.<br />
<span id="more-168"></span><br />
<code><br />
$cols = array('a','b','c');<br />
$data = array(<br />
                   array('a'=>1,'b'=>2,'c'=>3),<br />
                   array('a'=>4,'b'=>5,'c'=>6),<br />
           );<br />
$q = "INSERT INTO table_a (a,b,c) VALUES (:a,:b,:c)";<br />
$stmt = oci_parse($db, $q);<br />
foreach ($cols as $key) {<br />
    oci_bind_by_name($stmt, ':'.$key, $$key); // < << optional length<br />
}<br />
// then you want to loop through the data and execute the statment.<br />
foreach($data as $row){<br />
   extract($row);<br />
   oci_execute($stmt, OCI_DEFAULT);<br />
}<br />
oci_free_statement($stmt);<br />
oci_commit($db);<br />
oci_close($db);<br />
</code><br />
actually this would return you a nice obscure </p>
<blockquote><p>Warning: oci_execute(): ORA-01461: can bind a LONG value only for insert into a LONG column in ...</p></blockquote>
<p>even if you don't have any LONG value in the col types.<br />
Just add a large enough number to  oci_bind_by_name line:<br />
</code><code>oci_bind_by_name($stmt, ':'.$key, $$key,200)</code></p>
<p>If you know the data type length for each column it&#8217;s better to put that. In my case I wouldn&#8217;t know. So I entered the max of the max col length.</p>
<p>Happy inserting!<br />
PS: I also tried using $row[$key] instead of a lame $$key. However it didn&#8217;t work. I guess it has something to do with the $key changing all at each iteration.</p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2008/05/06/oci_bind_by_name-maxlength-is-not-so-optional/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP APC apc_shm_create error on CLI</title>
		<link>http://livebookmark.net/journal/2008/03/11/php-apc-apc_shm_create-error-on-cli/</link>
		<comments>http://livebookmark.net/journal/2008/03/11/php-apc-apc_shm_create-error-on-cli/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 13:36:18 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/2008/03/11/php-apc-apc_shm_create-error-on-cli/</guid>
		<description><![CDATA[If you&#8217;re getting an error like this one below on Windows PHP commandline make sure that you are not running an apache server that uses apc on the same machine!

[apc-error] apc_shm_create: shmget(0, 8388608, 658) failed: No error. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re getting an error like this one below on Windows PHP commandline make sure that you are not running an apache server that uses apc on the same machine!</p>
<blockquote><p>
[apc-error] apc_shm_create: shmget(0, 8388608, 658) failed: No error. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment.
</p></blockquote>
<p>This was hard to figure! Tested with PHP 5.2.5, APC 3.1.0-dev.</p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2008/03/11/php-apc-apc_shm_create-error-on-cli/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hack a GOV for black hat SEO</title>
		<link>http://livebookmark.net/journal/2007/08/11/hack-a-gov-for-black-hat-seo/</link>
		<comments>http://livebookmark.net/journal/2007/08/11/hack-a-gov-for-black-hat-seo/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 18:25:05 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/2007/08/11/hack-a-gov-for-black-hat-seo/</guid>
		<description><![CDATA[It was weird when I see a keyword, that  I&#8217;ve regularly watched, poped up at a .gov site.
Some blackhats, hoping to get the page rank benefits of a .gov site, hacked the forum of the site and placed a gateway like page. I guess search results come from google as well. 
Check it out [...]]]></description>
			<content:encoded><![CDATA[<p>It was weird when I see a keyword, that  I&#8217;ve regularly watched, poped up at a .gov site.</p>
<p>Some blackhats, hoping to get the page rank benefits of a .gov site, hacked the forum of the site and placed a gateway like page. I guess search results come from google as well. </p>
<p>Check it out yourself.<br />
<a href="http://nevadacityca.gov/forums/archive/i.php?/a/cialis/" rel="nofollow">nevadacityca.gov</a></p>
<p>PS: the keyword I was looking was the name of one of my sites, not cealis lol.</p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2007/08/11/hack-a-gov-for-black-hat-seo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitemaps in the robots.txt Happy Harvesting</title>
		<link>http://livebookmark.net/journal/2007/04/11/sitemaps-in-the-robotstxt-happy-harvesting/</link>
		<comments>http://livebookmark.net/journal/2007/04/11/sitemaps-in-the-robotstxt-happy-harvesting/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 04:40:53 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Ask]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Sitemaps]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/2007/04/11/sitemaps-in-the-robotstxt-happy-harvesting/</guid>
		<description><![CDATA[I&#8217;ve just read the Google Webmaster&#8217;s blog about the news on ask.com supporting Sitemaps.org&#8217;s sitemap format.
This is really a great news for all the people that like to be crawled faster and acurately.
For me the more interesting part about this news is that sitemaps.org&#8217;s proposal to include sitemaps into the robots.txt.
Simply you add a line [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just read the Google Webmaster&#8217;s blog about the news on ask.com supporting Sitemaps.org&#8217;s sitemap format.<br />
This is really a great news for all the people that like to be crawled faster and acurately.<br />
For me the more interesting part about this news is that sitemaps.org&#8217;s proposal to include sitemaps into the robots.txt.</p>
<p>Simply you add a line into your robots.txt saying</p>
<blockquote><p>
Sitemap: &lt;sitemap_location&gt;&lt;/sitemap_location&gt;
</p></blockquote>
<p>This part is really cool but for site harvesters it&#8217;s an unbelivable tool. So you can handover the key to your site and web harvesters can crawl your site really easily because probably you&#8217;ve put all your site&#8217;s pages into your sitemap.</p>
<p>Sounds like a good plan in an ideal world. With all the cloakers and content scrapers you must be really smart not to be ripped apart.</p>
<p>My suggestion is to know who you&#8217;re serving the sitemap. Currently Google, Yahoo and Ask is supporting this sitemaps.xml and no other site has anything to do with it.<br />
Here is a simple check you can add in the begining of your sitemap thing:</p>
<p><code>
<pre>
< ?php
    function botIsAllowed($ip){
        //get the reverse dns of the ip.
        $host = strtolower(gethostbyaddr($ip));
        $botDomains = array('.inktomisearch.com',
                                     '.googlebot.com',
                                     '.ask.com',
                             );

        //search for the reverse dns matches the white list
        foreach($botDomains as $bot){
            if (strpos(strrev($host),strrev($bot))===0){
                $qip= gethostbyname($host);
                return ($qip==$ip);
            }
        }
        return false;
}

if (!botIsAllowed($_SERVER['REMOTE_ADDR'])){
    echo "Banned!";
    exit;
}
?>
</pre>
<p></code></p>
<p>I&#8217;m sure everyone can get the idea of reverse dns and forward dns checking.<br />
If I missed any decent site that uses the sitemaps let me know.</p>
<p>Note: If you&#8217;re still using static sitemaps (!) you can just include the xml after the code. </p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2007/04/11/sitemaps-in-the-robotstxt-happy-harvesting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 6 way you boss is killing you</title>
		<link>http://livebookmark.net/journal/2005/12/12/the-6-way-you-boss-is-killing-you/</link>
		<comments>http://livebookmark.net/journal/2005/12/12/the-6-way-you-boss-is-killing-you/#comments</comments>
		<pubDate>Mon, 12 Dec 2005 13:18:37 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Human Resources]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/2005/12/12/the-6-way-you-boss-is-killing-you/</guid>
		<description><![CDATA[Here&#8217;s a different slide show about how your boss is killing you and how you can fight back.
link
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a different slide show about how your boss is killing you and how you can fight back.</p>
<p><a href="http://www.fastcompany.com/slideshow/slideviewer.cgi?list=stress&#038;dir=&#038;config=&#038;refresh=14&#038;direction=forward&#038;scale=0&#038;cycle=on&#038;slide=1&#038;design=default&#038;total=14">link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2005/12/12/the-6-way-you-boss-is-killing-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Credit Report</title>
		<link>http://livebookmark.net/journal/2005/12/01/free-credit-report/</link>
		<comments>http://livebookmark.net/journal/2005/12/01/free-credit-report/#comments</comments>
		<pubDate>Thu, 01 Dec 2005 23:20:40 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Credit]]></category>
		<category><![CDATA[Finance]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Made in Canada]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/2005/12/01/free-credit-report/</guid>
		<description><![CDATA[To all my Canadian friends, know that you can get a free credit report from equifax.
You can get up-to 2 credit reports per year just filing our this  mail-in request.
Easy heh?
They require two pieces of personal identification to process your request. (Example: driverâ€™s
licence, bank account statement, gas, phone, electricity or cable bill). 
If your [...]]]></description>
			<content:encoded><![CDATA[<p>To all my Canadian friends, know that you can get a free credit report from equifax.<br />
You can get up-to 2 credit reports per year just filing our <a href="http://www.equifax.com/EFX_Canada/consumer_information_centre/docs/request_report_form_e.pdf">this </a> mail-in request.<br />
Easy heh?</p>
<li>They require two pieces of personal identification to process your request. (Example: driverâ€™s<br />
licence, bank account statement, gas, phone, electricity or cable bill). </li>
<li>If your current address has changed within the last 90 days, a confirmation of address must be attached with your request in order to be<br />
processed. (Example: gas, phone, electricity or cable bill, bank account statement, driverâ€™s license).</li>
<li> You can expect to receive a copy of your personal credit report via regular mail within 5 to 10 days. </li>
<p>Mail it to :<br />
P.O. Box 190, Station Jean-Talon,<br />
Montreal, Quebec<br />
H1S 2Z2</p>
<p>Thoughts Aside:<br />
The <a href="http://www.creditcardonlines.com/american-express.htm">american express online</a> offers its clients personalized online access to the <a href="http://www.udel.edu/alumni/credit.html">bank of america card</a> as well as other financial services. City bank of America offers <a href="http://oregonstate.edu/~vanbossd/gfx/jwalker/van/htm/chicago-illinois-mortgage-refi.html">low interest card</a> at the lowest interest rate of <a href="http://www.creditcardonlines.com/citi-card.htm">citi cards</a> available. The <a href="http://www.bankinginfoguide.com/citizens-bank.html">citizens bank</a> also facilitates its customers by guiding them all through the <a href="http://www.creditcardonlines.com/chase-card.htm">chase credit card</a> rates now available.</p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2005/12/01/free-credit-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Noguchi Filing System</title>
		<link>http://livebookmark.net/journal/2005/10/05/the-noguchi-filing-system/</link>
		<comments>http://livebookmark.net/journal/2005/10/05/the-noguchi-filing-system/#comments</comments>
		<pubDate>Wed, 05 Oct 2005 16:40:03 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/2005/10/05/the-noguchi-filing-system/</guid>
		<description><![CDATA[This  is an interesting article about Noguchi Yukio&#8217;s filing system.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lise.jp/honyaku/noguchi.html">This </a> is an interesting article about Noguchi Yukio&#8217;s filing system.</p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2005/10/05/the-noguchi-filing-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Talk</title>
		<link>http://livebookmark.net/journal/2005/08/24/google-talk/</link>
		<comments>http://livebookmark.net/journal/2005/08/24/google-talk/#comments</comments>
		<pubDate>Wed, 24 Aug 2005 17:29:54 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/2005/08/24/google-talk/</guid>
		<description><![CDATA[I&#8217;ve set my mind not to post about Google Talk but this worths posting.
The first hack for Google Talk.
How to Broadcast MP3&#8217;s, Podcasts and other audio over Google Talk
Also the thing that I don&#8217;t plan to post about Google are:
- Google OS
- Google Wi-Fi
- Google Desktop
- Google Browser (why not?)
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve set my mind not to post about <a href="http://google.com/talk">Google Talk</a> but this worths posting.</p>
<p>The first hack for Google Talk.<br />
<a href="http://www.twittv.com/googletalk.html">How to Broadcast MP3&#8217;s, Podcasts and other audio over Google Talk</a></p>
<p>Also the thing that I don&#8217;t plan to post about Google are:<br />
- <a href="http://www.kottke.org/05/08/googleos-webos">Google OS</a><br />
- <a href="http://forevergeek.com/news/google_wifi.php">Google Wi-Fi</a><br />
- <a href="http://desktop.google.com/">Google Desktop</a><br />
- Google Browser (why not?)</p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2005/08/24/google-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows and Linux on the Sony PSP</title>
		<link>http://livebookmark.net/journal/2005/08/15/windows-and-linux-on-the-sony-psp/</link>
		<comments>http://livebookmark.net/journal/2005/08/15/windows-and-linux-on-the-sony-psp/#comments</comments>
		<pubDate>Mon, 15 Aug 2005 13:29:00 +0000</pubDate>
		<dc:creator>Harun Yayli</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PSP]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://livebookmark.net/journal/?p=66</guid>
		<description><![CDATA[Windows and Linux on the Sony PSP? hmm
]]></description>
			<content:encoded><![CDATA[<p>Windows and Linux on the Sony PSP? <a href="http://www.hacker.co.il/psp/bochs/">hmm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://livebookmark.net/journal/2005/08/15/windows-and-linux-on-the-sony-psp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
