<?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>Incero</title>
	<atom:link href="http://www.incero.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.incero.com</link>
	<description>Technology done right</description>
	<lastBuildDate>Thu, 01 Jul 2010 04:36:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Number Of Available CPU Cores In PHP</title>
		<link>http://www.incero.com/webdev/number-of-available-processing-cores-in-php</link>
		<comments>http://www.incero.com/webdev/number-of-available-processing-cores-in-php#comments</comments>
		<pubDate>Thu, 01 Jul 2010 04:26:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cores]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[cpus]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[processor]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=539</guid>
		<description><![CDATA[It is simple enough to check and then load the number of available processing cores on the current machine into a PHP variable. You can do so with the code below, which uses shell commands to grab data from /proc/cpuinfo and then removes unneeded data with PHP. &#38;lt;?php&#60;br /&#62; /*How to check how many processors [...]]]></description>
			<content:encoded><![CDATA[<p>It is simple enough to check and then load the number of available processing cores on the current machine into a PHP variable. You can do so with the code below, which uses shell commands to grab data from /proc/cpuinfo and then removes unneeded data with PHP.</p>
<p><pre class="brush: php;">&amp;lt;?php&lt;br /&gt;
 /*How to check how many processors are available on the current machine.&lt;br /&gt;
 by gordon@incero.com http://www.Incero.com. Feel free to use this code,&lt;br /&gt;
 but keep this header. June 30th, 2010.*/&lt;br /&gt;
 $numberOfProcessors=`cat /proc/cpuinfo | grep processor | tail -1`;&lt;br /&gt;
 $numberOfProcessors=preg_replace('/\s+/', '',$numberOfProcessors);&lt;br /&gt;
 $numberOfProcessors=str_replace(&amp;quot;:&amp;quot;,&amp;quot;&amp;quot;, $numberOfProcessors);&lt;br /&gt;
 $numberOfProcessors=str_replace(&amp;quot;processor&amp;quot;,&amp;quot;&amp;quot;, $numberOfProcessors);&lt;br /&gt;
 $numberOfProcessors++;&lt;br /&gt;
 echo &amp;quot;Number of processors on this machine is $numberOfProcessors!&amp;quot;;&lt;br /&gt;
?&amp;gt;</pre></p>
<p>We use this code to help our programs assign the most efficient parameters to others processes, such as FFMpeg video conversions, that we spawn from PHP across various machines.</p>
<p>Tested on CentOS 5.4, should work on most Linux distributions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/number-of-available-processing-cores-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend 2003120701 Error</title>
		<link>http://www.incero.com/webdev/zend-2003120701-error</link>
		<comments>http://www.incero.com/webdev/zend-2003120701-error#comments</comments>
		<pubDate>Mon, 14 Jun 2010 22:22:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=531</guid>
		<description><![CDATA[If you see an error on your website like the one below, it means that you need to install Zend Encoder to load the file. Zend�2003120701�1�2570�9363�xù Ÿ2Í[ÍoÜÆŸÚêH9(§^R€ÑEdY$g8œ‰½N¶ÒZÚÖ’ìõ:Ž$‹µ´–ÖÖ~˜Ëu¬¢h.íÑ@/Fs)KÓc½ô”? 7&#124;)£ƒÂ·…›\ú†‡ä– ®ï®ùÞ&#60;¾ù½ï!-’ÿ'½ážÕŠBXÑŸxk “YîqÌ\ŠEmÀÞt08:ßÝÛ €ÙëÃî ÷öŠC!œs?nÆAo¿3è†»sŽía‡Ù¶hW)šLoOÂ`ÎaÜõ=ß&#38;Å6êÍ:sî9Ì‹&#124;op4¹Ø‰:dîrÆ=øp£\Ó†ÓA'}1™s&#60;×§ÇBÜ Æ#¸È‰O˜í2uñ’¸ØÎ2l3îøÖî´{8šDÛ Ì¥&#62;¡4 „f\ìÄ�çÑ™80“¯·\ærØµ›�æ¢»gô  ¡NçróJ£Ó™´''JÀ±‘Ï9P)åTÄÔ5 $BõÕÝÑðNÿüø`ßýçÒ5ÓQ‹¦ªý»¨½c$aÁè›—Ñ£g/Ö£¿µwÝDûdýán²Œ~W¾ˆþl:ð$ÄÖGVrÛhû2[½syºÕ¸Üh5Z1ëµ&#124;Cç¦b~H„ñÐ;2ƒÏçrôíÑèÞ Ü;Í}ß&#38;€G›Â_&#124;úèZÂâ^ú±²æh{aèŠn&#62;Û»D´w•8‰Ø‰6Y&#60;É:� ??ûÁûa8~uuéƒ³Ÿ~¾úÙòÒ‡}Ý¸ò›ù‚’øüL¥3bþSÄg3YÓSG‚Œiì¹RyŸrê‰“'™`~-·›ØCÍ¨qRz&#38;Eèå8VD§ª¹WÛ… ?ÉÒ‰¾A¿›µd’êÒM¦ßÏHÔ¶ÈM¼Ça®mÑ�ƒ9c)N5N%N’…®gƒ/¿Í¸*/´³^(ˆ?”ÆƒpéV™òñôv¿\2Fÿ8•Y;¯Í =ÎãJ&#60;ý=7Ür}jc­míÝþÐºÜÚÙ²ÚA†Ú››±äõÚâ&#124;¦[½­Î t}ã£Aÿ&#38;§¨Žt7*Ù\&#38;Ôã\5ÈôšëW S/)t O5¡ša=•/¤€Œžž£L.Ïw5º=„Mg¬iÿm…í&#60;ô¸¤J G¡0Æ$b£èëVUÑC÷Íe•Ä¥èòNëf½µÞX—Ü¿7•(Q:sÚs3js®‘¿Ìi–èóO¥›Ù\¤ÎGÍºdû±J‘¹jE¾&#62;‘&#34;}£&#34;\â®ÿf!™ Råjkçã[0§noCh6w¶ß,@J­Íj½1´ˆŽVýF{s§Õü¤þÿ�˜-KƒMüz xýY%5ªåxîê:ýñíªq½eîW½Xó°¤Sßhl·%û¸¼!êO²£ý®žÖå»BO ZB¦Ç¹»Ì8¶ÎßT–¤…¾¦¿´Ò;¶›«ô0ö«ÕPÿßvù§1U­OaÎk5¶vÚN}}½%YÓŠïçªÿS,Ö®MIïå£l±&#38;,)ÖÑ¡sTª›ã­îX–êþøN0\¬5·íN½½³}vQÞZÊsMU[„Ñâ’Uß^áè’¾\®ËUû¬Pc+ º`z¥¹Õl[Žä¬h €ZÑ�õ¤M°–7@456Äj 0«j €úMp››u«&#124;S0ã`OÓä¯J[?maà—’Ëêþ±PËì³ÆÁèáQ-ú\–ÜOóÎA5QFG`ÏYáýŽä)x×˜½‹ Zº~£jý#ã^A‰Ãî$\jk7Z-èÖ:íæVãz»¾u57¿›qÑÃ 4•%™:v2¹?Óœ®èþLf/çÅîÏÐ{¦2ái5špôÛÂ3ré4ëÝ£Èe‚þp^½Ä&#34;V&#60;*³pJ–8úz38~d„©ñ´JÄÓ2ÒõÇUëKì³,éy/ÒC¢�?‰ˆWÇ€¢š.á [...]]]></description>
			<content:encoded><![CDATA[<p>If you see an error on your website like the one below, it means that you need to install Zend Encoder to load the file.</p>
<p><pre class="brush: plain;">Zend�2003120701�1�2570�9363�xù Ÿ2Í[ÍoÜÆŸÚêH9(§^R€ÑEdY$g8œ‰½N¶ÒZÚÖ’ìõ:Ž$‹µ´–ÖÖ~˜Ëu¬¢h.íÑ@/Fs)KÓc½ô”? 7|)£ƒÂ·…›\ú†‡ä– ®ï®ùÞ&lt;¾ù½ï!-’ÿ'½ážÕŠBXÑŸxk “YîqÌ\ŠEmÀÞt08:ßÝÛ €ÙëÃî ÷öŠC!œs?nÆAo¿3è†»sŽía‡Ù¶hW)šLoOÂ`ÎaÜõ=ß&amp;Å6êÍ:sî9Ì‹|op4¹Ø‰:dîrÆ=øp£\Ó†ÓA'}1™s&lt;×§ÇBÜ Æ#¸È‰O˜í2uñ’¸ØÎ2l3îøÖî´{8šDÛ Ì¥&gt;¡4 „f\ìÄ�çÑ™80“¯·\ærØµ›�æ¢»gô  ¡NçróJ£Ó™´''JÀ±‘Ï9P)åTÄÔ5 $BõÕÝÑðNÿüø`ßýçÒ5ÓQ‹¦ªý»¨½c$aÁè›—Ñ£g/Ö£¿µwÝDûdýán²Œ~W¾ˆþl:ð$ÄÖGVrÛhû2[½syºÕ¸Üh5Z1ëµ|Cç¦b~H„ñÐ;2ƒÏçrôíÑèÞ Ü;Í}ß&amp;€G›Â_|úèZÂâ^ú±²æh{aèŠn&gt;Û»D´w•8‰Ø‰6Y&lt;É:� ??ûÁûa8~uuéƒ³Ÿ~¾úÙòÒ‡}Ý¸ò›ù‚’øüL¥3bþSÄg3YÓSG‚Œiì¹RyŸrê‰“'™`~-·›ØCÍ¨qRz&amp;Eèå8VD§ª¹WÛ… ?ÉÒ‰¾A¿›µd’êÒM¦ßÏHÔ¶ÈM¼Ça®mÑ�ƒ9c)N5N%N’…®gƒ/¿Í¸*/´³^(ˆ?”ÆƒpéV™òñôv¿\2Fÿ8•Y;¯Í =ÎãJ&lt;ý=7Ür}jc­míÝþÐºÜÚÙ²ÚA†Ú››±äõÚâ|¦[½­Î t}ã£Aÿ&amp;§¨Žt7*Ù\&amp;Ôã\5ÈôšëW S/)t O5¡ša=•/¤€Œžž£L.Ïw5º=„Mg¬iÿm…í&lt;ô¸¤J G¡0Æ$b£èëVUÑC÷Íe•Ä¥èòNëf½µÞX—Ü¿7•(Q:sÚs3js®‘¿Ìi–èóO¥›Ù\¤ÎGÍºdû±J‘¹jE¾&gt;‘&quot;}£&quot;\â®ÿf!™ Råjkçã[0§noCh6w¶ß,@J­Íj½1´ˆŽVýF{s§Õü¤þÿ�˜-KƒMüz xýY%5ªåxîê:ýñíªq½eîW½Xó°¤Sßhl·%û¸¼!êO²£ý®žÖå»BO ZB¦Ç¹»Ì8¶ÎßT–¤…¾¦¿´Ò;¶›«ô0ö«ÕPÿßvù§1U­OaÎk5¶vÚN}}½%YÓŠïçªÿS,Ö®MIïå£l±&amp;,)ÖÑ¡sTª›ã­îX–êþøN0\¬5·íN½½³}vQÞZÊsMU[„Ñâ’Uß^áè’¾\®ËUû¬Pc+ º`z¥¹Õl[Žä¬h €ZÑ�õ¤M°–7@456Äj 0«j €úMp››u«|S0ã`OÓä¯J[?maà—’Ëêþ±PËì³ÆÁèáQ-ú\–ÜOóÎA5QFG`ÏYáýŽä)x×˜½‹ Zº~£jý#ã^A‰Ãî$\jk7Z-èÖ:íæVãz»¾u57¿›qÑÃ 4•%™:v2¹?Óœ®èþLf/çÅîÏÐ{¦2ái5špôÛÂ3ré4ëÝ£Èe‚þp^½Ä&quot;V&lt;*³pJ–8úz38~d„©ñ´JÄÓ2ÒõÇUëKì³,éy/ÒC¢�?‰ˆWÇ€¢š.á H·p\‰¼4D$–@ G‡Uš…c¥’Ã­’ýò»ïf,;¦0åUÕªÜ ’ÅUUŠWV).«Ô Â”›j½kSê«nÂ³µž æ6LUm«¹ÝÞ‰ ½ˆÕÒ2J ƒÚ¼fïz“š“ät¹¤Ü‡ŠÄt\9—±pn”Ú�ˆæ`­ÎÉþSòÂ‰iBÌáÄ„ƒÑ4¨™!Ð\«èÙ¬mkýÆÕ+Í5‘Õ¸eÉƒ}.;RÊ÷å.Ôçå.Ôg't`ý™ÚBî!ž¨úùÃí7s€\t7ŸræðTÎ»›Ë3îÖêÝé½ .½;bFP,6# :,jŽ–ñ\§E¢Ù¼¸ègX“ñè5˜«˜7™«²n2/F7Oj^œ{¸0ãbŠ.Nvƒþ8´Äûrµ…°÷0\½Û}Ð¯.@÷2ÜŸv÷ôK¸z=¾ziöA7°zÇý ×R¬š5ì}¥=ì]º0«QÎOzatY¿¶/¯-YË–C`ÁÞhw:è Ãó»£Ñ½¾·°vØß½7©Ùä}&amp;µàÖ¥„£­öõºƒýHÒÂkÜ j«FÍõšf}ÀÎ|.â3ôÚn¹Ù?]”wû®Ô©[2ýb´øYMrV-7VFñªß«íäâjlýKRüÅ¼sª¨§ž6í°4ê=ìSÅch…œÝi€M7!Ì¹¶oÁq‰xkavönÏ9Ì§˜ÛÞš‰ý9Sêx¾ Ñ%Eå‹}Î©xÔEýñ¬xÕÆaœÄOswÓC’9‡º&gt;và/ÚÊ³”9fHŒ™|?'žª`6å®Ëà)ø¶ž</pre></p>
<p>If you are running cPanel/WHM on your server you can easily install Zend Encoder from the "Easy Apache" menu. Below are some screenshots detailing the process in WHM, simply use your existing Apache/PHP settings and then check the Zend Encoder checkbox on the options list near the end of the process.</p>
<p><a href='http://www.UploadScreenshot.com/image/78462/7981177' target='_blank'><img src='http://img1.UploadScreenshot.com/images/thumb/6/16418180119.png' alt='Click here to view full size' /></a></p>
<p><a href='http://www.UploadScreenshot.com/image/78463/9888798' target='_blank'><img src='http://img1.UploadScreenshot.com/images/thumb/6/16418181947.png' alt='Click here to view full size' /></a></p>
<p><a href='http://www.UploadScreenshot.com/image/78464/6328208' target='_blank'><img src='http://img1.UploadScreenshot.com/images/thumb/6/16418183169.png' alt='Click here to view full size' /></a></p>
<p><a href='http://www.UploadScreenshot.com/image/78465/9427448' target='_blank'><img src='http://img1.UploadScreenshot.com/images/thumb/6/16418184271.png' alt='Click here to view full size' /></a></p>
<p><a href='http://www.UploadScreenshot.com/image/78466/4931295' target='_blank'><img src='http://img1.UploadScreenshot.com/images/thumb/6/16418190282.png' alt='Click here to view full size' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/zend-2003120701-error/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Upload Progress Bar Script</title>
		<link>http://www.incero.com/webdev/php-upload-progress-bar-script</link>
		<comments>http://www.incero.com/webdev/php-upload-progress-bar-script#comments</comments>
		<pubDate>Mon, 07 Jun 2010 19:00:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=479</guid>
		<description><![CDATA[We have developed an amazing PHP upload progress bar script, which uses Javascript and PHP to report back the upload status data to the user. This script makes it extremely easy to add an upload progress bar to your website without using Flash, Perl, cgi, or other complex solutions. Demo You can see the upload [...]]]></description>
			<content:encoded><![CDATA[<p>We have developed an amazing PHP upload progress bar script, which uses Javascript and PHP to report back the upload status data to the user. This script makes it extremely easy to add an upload progress bar to your website without using Flash, Perl, cgi, or other complex solutions.</p>
<p style="text-align: center;"><img class="size-full wp-image-517 aligncenter" style="border: 1px solid black;" title="progress" src="http://www.incero.com/wp-content/uploads/2010/06/progress.png" alt="" width="216" height="61" /></p>
<p><strong>Demo</strong></p>
<p>You can see the upload progress bar in action on a live site at <a href="http://www.PutFile2.com" target="_blank">http://www.PutFile2.com</a>. You can also see a video of it in action at the bottom of this page.</p>
<p><strong>Features</strong></p>
<ul>
<li>Uses simple HTML form, allowing you to post additional data such as a description of the file, user-name, etc</li>
<li>100% PHP and Javascript</li>
<li>Customizable progress update interval, have it update as often as you like, specify the interval in milliseconds</li>
<li>CSS based upload progress bar, change colors and size easily</li>
<li>3 easily selectable display modes:
<ol>
<li>Percent Uploaded</li>
<li>Percent and Megabytes Uploaded</li>
<li>Percent, Megabytes Uploaded, and Time Left</li>
</ol>
</li>
</ul>
<p><strong>Customizable &amp; Well Documented</strong></p>
<p>All of the code is easily customizable by any novice web programmer. All of the PHP code is very well commented in clear and easy to understand English. If there are any features that you want to add you can easily edit the source code to meet your needs.</p>
<p><strong>Help Available, If You Need It!<br />
</strong></p>
<p>We answer emails to <a href="mailto:info@incero.com">info@incero.com</a> within 1 business day, but usually within a couple of hours. We can also be reached on (512) 394.8803.  We can install the script for you, integrate it into your website, or perform nearly any other programming task for you for a reasonable fee. We are a real web development company located in downtown Austin, TX and are always happy to assist our clients!</p>
<p><strong>Buy Now</strong></p>
<p>We are a PayPal verified business, once you have completed the payment we will email you a copy of the script. Please feel free to <a href="/contact-us">contact us</a> if you have any troubles, we are here to help!</p>
<table border="0" cellspacing="0" cellpadding="5" width="100%">
<tbody>
<tr>
<td align="center"><strong>Single Domain, $69</strong></td>
<td align="center"><strong>Personal Domains, $119</strong></td>
<td align="center"><strong>Developer, $249</strong></td>
</tr>
<tr>
<td>Use the code on only one domain.</td>
<td>Use the code on an unlimited number of domains that you personally own. May not be used by web developers or businesses.</td>
<td>For developers and business users. Use the code on any number of your own and your client&#8217;s domains.</td>
</tr>
<tr>
<td align="center"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=SS9CZ7C36C2AC"></a></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="SS9CZ7C36C2AC" />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" /> </form>
</td>
<td align="center">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="V3L2HSQ334CGU" />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" /> </form>
</td>
<td align="center"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=UDTTWSNPH2KGS"></a></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="UDTTWSNPH2KGS" />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" /> </form>
</td>
</tr>
</tbody>
</table>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="320" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/jwx-DJlZz1o&amp;hl=en_US&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="500" height="320" src="http://www.youtube.com/v/jwx-DJlZz1o&amp;hl=en_US&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Sever Requirements</p>
<ul>
<li>PHP 5.2 or newer</li>
<li>PHP PECL <a href="http://pecl.php.net/package/uploadprogress/" target="_blank">UploadProgress</a> (very easy to install, install script included)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/php-upload-progress-bar-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing Joomla Media Files With Login Sessions</title>
		<link>http://www.incero.com/webdev/securing-joomla-media-files-with-login-sessions</link>
		<comments>http://www.incero.com/webdev/securing-joomla-media-files-with-login-sessions#comments</comments>
		<pubDate>Tue, 11 May 2010 21:08:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[leech]]></category>
		<category><![CDATA[protection]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=402</guid>
		<description><![CDATA[We recently completed an excellent Joomla file protection script which allows Joomla CMS webmasters to secure their digital files based on the current user login session preventing leeching. Using our Joomla file protection script you can simply drop our securefile.php in any folder that contains files that you want to protect and they will only [...]]]></description>
			<content:encoded><![CDATA[<p>We recently completed an excellent Joomla file protection script which allows Joomla CMS webmasters to secure their digital files based on the current user login session preventing leeching.</p>
<p>Using our Joomla file protection script you can simply drop our securefile.php in any folder that contains files that you want to protect and they will only be loadable by registered and logged in users.</p>
<p>Here&#8217;s how it works:</p>
<ol>
<li>All file requests for media files including videos and images are automatically passed to securefile.php</li>
<li>securefile.php checks that the user is already logged by checking the Joomla session and cookie data</li>
<li>displays the requested file, or shows an error message if permission is denied.</li>
</ol>
<p>An example usage would be that you have a several .swf presentations  that you want to show to your registered users only, they view your  webpage source code and then steal the link to the .swf (such as  http://www.mywebsite.com/files/presentation4.swf). The user then shares  that direct link to your presentation with non registered users  resulting in bandwidth usage and lost revenue. With the leech protection system those direct links will not work for non registered users.</p>
<p>This beauty of this system is that you can keep using your existing video players and presentations on your site as you always have without having to modify your code. We can set this up for you from just $60, <a href="/contact-us" target="_self">contact us</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/securing-joomla-media-files-with-login-sessions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Generate Thumbnails On The Fly With PHP</title>
		<link>http://www.incero.com/webdev/how-to-generate-thumbnails-on-the-fly-with-php</link>
		<comments>http://www.incero.com/webdev/how-to-generate-thumbnails-on-the-fly-with-php#comments</comments>
		<pubDate>Fri, 30 Apr 2010 21:25:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[exif]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[thumbnail]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=420</guid>
		<description><![CDATA[There are two great ways to generate thumbnails for images on the fly with PHP: Use GD to resize the image on the fly and output it Extracts the thumbnail from the Exif data. (If this fails, you could revert to method 1 above.) The latter assumes that the image file has exif data, which [...]]]></description>
			<content:encoded><![CDATA[<p>There are two great ways to generate thumbnails for images on the fly with PHP:</p>
<ol>
<li> Use GD to resize the image on the fly and output it</li>
<li>Extracts the thumbnail from the <a href="http://en.wikipedia.org/wiki/Exchangeable_image_file_format" target="_blank">Exif data</a>. (If this fails, you could revert to method 1 above.)</li>
</ol>
<p>The latter assumes that the image file has exif data, which most photos  do. To ensure the fastest loading thumbnails it would be best to generate thumbnails when images are uploaded to the server, but there are times when you don&#8217;t want to have to store thumbnails for every image uploaded.</p>
<p><strong>Method 1: Using GD To Resize On The Fly</strong></p>
<p>Using this <a href="http://www.incero.com/codesamples/thumbnailonthefly/highres.jpg" target="_blank">8.5MB image</a>, and the code below, the following URL will load a thumbnail that is dynamically created: <a href="http://www.incero.com/codesamples/thumbnailonthefly/thumbnail.php?image=highres.jpg&amp;width=160" target="_blank">http://www.incero.com/codesamples/thumbnailonthefly/thumbnail.php?image=highres.jpg&amp;width=160</a></p>
<p><pre class="brush: php;">&amp;lt;?php&lt;br /&gt;
 /*How to extract a thumbnail from Exif data using PHP&lt;br /&gt;
 Created by Gordon Page, gordon@incero.com. April 30th, 2010.&lt;br /&gt;
 Incero.com offers custom coding and hosting solutions.&lt;br /&gt;
 */&lt;br /&gt;
 header(&amp;quot;Content-type: image/jpeg&amp;quot;);&lt;/p&gt;
&lt;p&gt; // get image size&lt;br /&gt;
 $file = $_GET[image];&lt;br /&gt;
 if($size = GetImageSize($file)){&lt;br /&gt;
 $w = $size[0];&lt;br /&gt;
 $h = $size[1];&lt;br /&gt;
 //set new size&lt;br /&gt;
 $nw = $_GET['width'];&lt;br /&gt;
 $nh = ($nw*$h)/$w;&lt;br /&gt;
 }&lt;br /&gt;
 else{&lt;br /&gt;
 //set new size&lt;br /&gt;
 $nw = &amp;quot;160&amp;quot;;&lt;br /&gt;
 $nh = &amp;quot;120&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 //draw the image&lt;br /&gt;
 $src_img = imagecreatefromjpeg($file);&lt;br /&gt;
 $dst_img = imagecreatetruecolor($nw,$nh);&lt;br /&gt;
 imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $nw, $nh, $w, $h);//resizing the image&lt;br /&gt;
 imagejpeg($dst_img,&amp;quot;&amp;quot;,100);&lt;br /&gt;
 imagedestroy($src_img);&lt;br /&gt;
 imagedestroy($dst_img);&lt;br /&gt;
?&amp;gt;</pre></p>
<p>You&#8217;ll notice that with this method it takes about a second to generate the thumbnail so you may want to default to the method below which is faster, and if that method fails then fall back to this first method.</p>
<p><strong>Method 2: Extracting The Thumbnail From The Exif Data<br />
</strong></p>
<p>Using the same <a href="http://www.incero.com/codesamples/thumbnailonthefly/highres.jpg" target="_blank">8.5MB  image</a>, and the code below, the following URL will extract the thumbnail from the Exif data: <a href="http://www.incero.com/codesamples/thumbnailonthefly/exifthumb.php?image=highres.jpg" target="_blank">http://www.incero.com/codesamples/thumbnailonthefly/exifthumb.php?image=highres.jpg</a><a href="http://www.incero.com/codesamples/thumbnailonthefly/thumbnail.php?image=highres.jpg&amp;width=160" target="_blank"></a></p>
<p><pre class="brush: php;">&lt;/p&gt;
&lt;p&gt;&amp;lt;?php&lt;br /&gt;
 /*How to extract a thumbnail from Exif data using PHP&lt;br /&gt;
 Created by Gordon Page, gordon@incero.com. April 30th, 2010.&lt;br /&gt;
 Incero.com offers custom coding and hosting solutions.&lt;br /&gt;
 */&lt;br /&gt;
 // file to read&lt;br /&gt;
 $file =$_REQUEST['image'];&lt;br /&gt;
 $image = exif_thumbnail($file, $width, $height, $type);&lt;br /&gt;
 // width, height and type get filled with data&lt;br /&gt;
 // after calling &amp;quot;exif_thumbnail&amp;quot;&lt;br /&gt;
 if ($image) {&lt;br /&gt;
 // send header and image data to the browser:&lt;br /&gt;
 header(&amp;#8216;Content-type: &amp;#8216; .image_type_to_mime_type($type));&lt;br /&gt;
 print $image;&lt;br /&gt;
 }&lt;br /&gt;
 else {&lt;br /&gt;
 // there is no thumbnail available, handle the error.&lt;br /&gt;
 //This would be a great place to revert to the GD resize method.&lt;br /&gt;
 print &amp;#8216;No thumbnail available&amp;#8217;;&lt;br /&gt;
 }&lt;br /&gt;
?&amp;gt;&lt;/p&gt;
&lt;p&gt;</pre></p>
<p>Feel free to use the code above in your own projects. If you are in need of paid programming services please <a href="/contact-us">contact us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/how-to-generate-thumbnails-on-the-fly-with-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP file_exists() Performance</title>
		<link>http://www.incero.com/webdev/php-file_exists-performance</link>
		<comments>http://www.incero.com/webdev/php-file_exists-performance#comments</comments>
		<pubDate>Fri, 02 Apr 2010 19:45:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=385</guid>
		<description><![CDATA[For one of our projects we need a large amount of cheap storage, an NFS mounted NAS suits us. But we also want to load most recently used files from the server&#8217;s local disk, so that the notoriously slow NFS protocol doesn&#8217;t get the better of us during peak times. We&#8217;ll simply run a cron [...]]]></description>
			<content:encoded><![CDATA[<p>For one of our projects we need a large amount of cheap storage, an NFS mounted NAS suits us. But we also want to load most recently used files from the server&#8217;s local disk, so that the notoriously slow NFS protocol doesn&#8217;t get the better of us during peak times. We&#8217;ll simply run a cron each hour to mirror our most recently used files to the local disk. Think of it as a very simplified reverse proxy cache.</p>
<p>Now, we could store the current location of the files in the database, e.g. file1 is on the nas, file2 is on the nas and the local disk but that would mean more work, and an extra query on the database.</p>
<p>Databases are generally more expensive to scale than other website components, so we are simply going to check if the file exists on the local disk and if it does then serve it from there, and if not then load it from the NAS directory.</p>
<p>This raised the question of whether checking if the file exists on the local disk take too long, especially when checking several million times per day. The answer is no. Using PHP to check whether 10 million different files exist on the local disk takes approximately 40 seconds, that&#8217;s about 4 millionths of a second per check which is acceptable for our needs of 100,000 image loads per day.</p>
<p>Here&#8217;s the code we used to check:</p>
<p><pre class="brush: php;">&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
 $x=0;&lt;br /&gt;
 $start_time=time();&lt;br /&gt;
 while($x&amp;lt;10000000)&lt;br /&gt;
 {&lt;br /&gt;
 $x++;&lt;br /&gt;
 }&lt;br /&gt;
 print &amp;quot;loop without checks took &amp;quot;;&lt;br /&gt;
 echo time() &amp;#8211; $start_time;&lt;br /&gt;
 print &amp;quot; seconds &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;;&lt;/p&gt;
&lt;p&gt; $x=0;&lt;br /&gt;
 $start_time=TIME();&lt;br /&gt;
 while($x&amp;lt;10000000)&lt;br /&gt;
 {&lt;br /&gt;
 $name=$x . &amp;quot;.wmv&amp;quot;;&lt;br /&gt;
 if(file_exists($name))&lt;br /&gt;
 {&lt;br /&gt;
 //do nothing&lt;br /&gt;
 }&lt;br /&gt;
 $x++;&lt;br /&gt;
 }&lt;br /&gt;
 print &amp;quot;loop with checks took &amp;quot;;&lt;br /&gt;
 echo time() &amp;#8211; $start_time;&lt;br /&gt;
 print &amp;quot; seconds &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
</pre></p>
<p>And here was the output from the script:</p>
<blockquote><p>loop without checks took 1 seconds</p>
<p>loop with checks took 41  seconds</p></blockquote>
<p>Obviously the next step to increase performance would be to have the &#8220;local disk&#8221; which caches the files actually be a RAM disk, however we&#8217;re many millions of image loads per day away from needing to do that. For now we&#8217;ve solved our limited storage issues without taking a performance hit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/php-file_exists-performance/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paste Image Upload Java Applet</title>
		<link>http://www.incero.com/webdev/upload-applet</link>
		<comments>http://www.incero.com/webdev/upload-applet#comments</comments>
		<pubDate>Tue, 23 Mar 2010 05:35:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=309</guid>
		<description><![CDATA[We&#8217;re the creators of the awesome Java applet that allows users to paste images or screenshots directly from their clipboard and upload them to the web. We use this functionality on our site UploadScreenShot.com. You may now purchase a version of the applet which can be easily integrated with your own website. Simply embed the [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re the creators of the awesome Java applet that allows users to paste images or screenshots directly from their clipboard and upload them to the web. We use this functionality on our site <a href="http://www.UploadScreenShot.com">UploadScreenShot.com</a>.</p>
<p>You may now purchase a version of the applet which can be easily integrated with your own website. Simply embed the Java applet, specify where the image data should be posted to,  the URL to redirect to when the upload is done, and a session identifier string which will be included in the post data if you wish (so that you can track which user uploaded which image).</p>
<p>Applet Features:</p>
<ul>
<li>pasting images directly from the user&#8217;s clipboard</li>
<li>supports pasting and dragging and dropping of png and jpg image files</li>
<li>browse for and upload png and jpg image files</li>
<li>functions in the same fashion as the applet demonstrated on <a href="http://www.UploadScreenshot.com" target="_blank">UploadScreenshot.com</a></li>
<li>unobtrusive copyright notice in the bottom right hand corner which can be seen <a href="http://img1.uploadscreenshot.com/images/orig/3/8101332567-orig.jpg" target="_blank">here</a></li>
<li>includes example PHP code for handling the image uploads</li>
</ul>
<p>Each purchase provides you with a license to use the Java applet on one website  only, if you need to use it on multiple websites please purchase  multiple licenses. You will be emailed the Java applet and sample PHP integration after  completing the payment via the PayPal button below, all purchases are final.</p>
<p>We offer installation services at reasonable rates, please <a href="/contact-us" target="_self">contact us</a> for more info.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="11197721" />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" /> <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/upload-applet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install IonCube Loader On A Cpanel/WHM Server</title>
		<link>http://www.incero.com/sysadmin/install-ioncube-loader-on-a-cpanelwhm-server</link>
		<comments>http://www.incero.com/sysadmin/install-ioncube-loader-on-a-cpanelwhm-server#comments</comments>
		<pubDate>Wed, 24 Feb 2010 20:55:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=352</guid>
		<description><![CDATA[If you&#8217;re running a webserver with Cpanel and need to use Zend&#8217;s IonCube Loader, you can easily install it by running this command via SSH: /scripts/phpextensionmgr install IonCubeL oader It will output something like this: Updating md5sum list Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz.yaml (0)&#8230;.@75.127. 84.226&#8230;&#8230;connected&#8230;&#8230;receiving&#8230;100%&#8230;&#8230;Done Downloading tarball for IonCubeLoader Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz/Cpanel/Easy/IonCubeL oader.pm.tar.gz.linux-generic-64 (0)&#8230;.@75.127.84.226&#8230;&#8230;connected&#8230;&#8230;recei ving&#8230;2%&#8230;4%&#8230;6%&#8230;8%&#8230;10%&#8230;12%&#8230;15%&#8230;17%&#8230;19%&#8230;21%&#8230;23%&#8230;25%&#8230;28%.. .30%&#8230;32%&#8230;34%&#8230;36%&#8230;38%&#8230;41%&#8230;43%&#8230;45%&#8230;47%&#8230;49%&#8230;51%&#8230;54%&#8230;56%&#8230;5 8%&#8230;60%&#8230;62%&#8230;64%&#8230;67%&#8230;69%&#8230;71%&#8230;73%&#8230;75%&#8230;77%&#8230;80%&#8230;82%&#8230;84%&#8230;86% &#8230;88%&#8230;90%&#8230;93%&#8230;95%&#8230;97%&#8230;99%&#8230;100%&#8230;&#8230;Done Installing [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running a webserver with Cpanel and need to use Zend&#8217;s IonCube Loader, you can easily install it by running this command via SSH:</p>
<blockquote><p>/scripts/phpextensionmgr install IonCubeL oader</p></blockquote>
<p>It will output something like this:</p>
<blockquote><p>Updating md5sum list<br />
Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz.yaml (0)&#8230;.@75.127. 84.226&#8230;&#8230;connected&#8230;&#8230;receiving&#8230;100%&#8230;&#8230;Done<br />
Downloading tarball for IonCubeLoader<br />
Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz/Cpanel/Easy/IonCubeL oader.pm.tar.gz.linux-generic-64 (0)&#8230;.@75.127.84.226&#8230;&#8230;connected&#8230;&#8230;recei ving&#8230;2%&#8230;4%&#8230;6%&#8230;8%&#8230;10%&#8230;12%&#8230;15%&#8230;17%&#8230;19%&#8230;21%&#8230;23%&#8230;25%&#8230;28%.. .30%&#8230;32%&#8230;34%&#8230;36%&#8230;38%&#8230;41%&#8230;43%&#8230;45%&#8230;47%&#8230;49%&#8230;51%&#8230;54%&#8230;56%&#8230;5 8%&#8230;60%&#8230;62%&#8230;64%&#8230;67%&#8230;69%&#8230;71%&#8230;73%&#8230;75%&#8230;77%&#8230;80%&#8230;82%&#8230;84%&#8230;86% &#8230;88%&#8230;90%&#8230;93%&#8230;95%&#8230;97%&#8230;99%&#8230;100%&#8230;&#8230;Done<br />
Installing IonCubeLoader<br />
Creating install directory at /usr/local/IonCube<br />
Determining PHP version<br />
Installing IonCube Loader binaries<br />
Activating IonCube Loader extension in /usr/local/lib/php.ini<br />
IonCube Loader extension activated</p></blockquote>
<p>You can then check that it is indeed installed by entering this command via ssh:</p>
<blockquote><p>php -v</p></blockquote>
<p>Which will output something like this:</p>
<blockquote><p>PHP 5.2.9 (cli) (built: Feb 23 2010 19:52:35)<br />
Copyright (c) 1997-2009 The PHP Group<br />
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies<br />
with the ionCube PHP Loader v3.3.10, Copyright (c) 2002-2009, by ionCube Ltd.</p></blockquote>
<p>There are plenty of other methods to install IonCube Loader, but this simple Cpanel script seems to be the easiest. Many scripts, like our <a href="http://www.hotlinkingprotection.com" target="_blank">media hotlinking protection</a> script, make use of IonCube Loader to run Zend protected PHP source code.</p>
<p><a href="http://www.uploadscreenshot.com/image/50582/2165265" target="_blank"><img src="http://img1.uploadscreenshot.com/images/thumb/2/5415492695.jpg" alt="Click here to view full size" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/sysadmin/install-ioncube-loader-on-a-cpanelwhm-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Memtest86 Before Deploying Servers</title>
		<link>http://www.incero.com/sysadmin/use-memtest86-before-deploying-servers</link>
		<comments>http://www.incero.com/sysadmin/use-memtest86-before-deploying-servers#comments</comments>
		<pubDate>Wed, 27 Jan 2010 07:39:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[System Admin]]></category>
		<category><![CDATA[86]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[failure]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[memtest]]></category>
		<category><![CDATA[memtest86]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=314</guid>
		<description><![CDATA[We&#8217;ve been building a few servers recently, and as part of our testing we performed a memory test on each of the machines. In doing so we discovered that one of the RAM modules was defective. We confirmed that the memory, not the cpu nor motherboard, was at fault by then testing the RAM in [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been building a few servers recently, and as part of our testing we performed a memory test on each of the machines. In doing so we discovered that one of the RAM modules was defective. We confirmed that the memory, not the cpu nor motherboard, was at fault by then testing the RAM in another machine.</p>
<p>System memory can be defective without being overly apparent, allowing you to install your operating system and use it normally for a period of time. After a while programs may begin to crash unexpectedly, and other system errors may occur.</p>
<p>By running Memtest86 before shipping the servers to the datacenter we have saved ourselves countless hours of remotely debugging the issue and coordinating a replacement of the hardware.</p>
<p>Memtest86 is free and can be downloaded as a bootable iso and in many other formats <a href="http://www.memtest86.com/" target="_blank">here</a>. It is also bundled on Ubunutu installation disks, just boot from the cd/dvd and run the &#8220;memory test&#8221; option.</p>
<p>Below is a screenshot detailing over 400,000 memory errors. Working memory should not return any errors at all, one single error is cause for concern.</p>
<p>Check out the <a href="http://www.memtest86.com/" target="_blank">Memtest86</a> website for more details on how to determine which memory module is at fault, and whether your bios or voltage settings may be to blame.</p>
<p><a href="http://www.UploadScreenshot.com/image/48181/715346" target="_blank"><img src="http://img1.UploadScreenshot.com/images/thumb/1/2605560789.jpg" alt="Click here to view full size" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/sysadmin/use-memtest86-before-deploying-servers/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>UploadScreenShot Without Java</title>
		<link>http://www.incero.com/webdev/uploadscreenshot-without-java</link>
		<comments>http://www.incero.com/webdev/uploadscreenshot-without-java#comments</comments>
		<pubDate>Wed, 13 Jan 2010 07:44:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=305</guid>
		<description><![CDATA[We&#8217;ve added a basic upload fall back option so that users without Java enabled in their browser can still use UploadScreenShot.com. Below is a screen capture of what the site now looks like, with a file upload form, when you visit the site with Java disabled:]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve added a basic upload fall back option so that users without Java enabled in their browser can still use <a href="http://www.UploadScreenShot.com">UploadScreenShot.com</a>.</p>
<p>Below is a screen capture of what the site now looks like, with a file upload form, when you visit the site with Java disabled:</p>
<p><a href='http://www.UploadScreenshot.com/image/47003/2673169' target='_blank'><img src='http://img1.UploadScreenshot.com/images/thumb/1/1206212012.png' alt='Click here to view full size' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/uploadscreenshot-without-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
