<?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>Just Another Dang Blog</title>
	<atom:link href="http://blog.lopau.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lopau.com</link>
	<description>A tech blog about web development, graphic designs, freelancing, cloud computing, mobile development, innovations and seo.</description>
	<lastBuildDate>Thu, 06 Oct 2011 03:01:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>R.I.P Steve Jobs, Stay Hungry Stay Foolish</title>
		<link>http://blog.lopau.com/r-i-p-steve-jobs-stay-hungry-stay-foolish/</link>
		<comments>http://blog.lopau.com/r-i-p-steve-jobs-stay-hungry-stay-foolish/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 03:00:31 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[apple]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1522</guid>
		<description><![CDATA[Whenever I feel down and need inspiration, your speech at Handford(2005) always never fails to reenergize my spirit and continue to what I am doing. We have truly lost a visionary. Rest In Peace Mr. Jobs.]]></description>
			<content:encoded><![CDATA[<p>Whenever I feel down and need inspiration, your speech at Handford(2005) always never fails to reenergize my spirit and continue to what I am doing.</p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="425" height="344" src="http://www.youtube.com/embed/UF8uR6Z6KLc" frameborder="0" allowFullScreen="true"> </iframe></p>
<p>We have truly lost a visionary. Rest In Peace Mr. Jobs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/r-i-p-steve-jobs-stay-hungry-stay-foolish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inkling by Wacom</title>
		<link>http://blog.lopau.com/inkling-by-wacom/</link>
		<comments>http://blog.lopau.com/inkling-by-wacom/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 15:15:22 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[wacom]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1510</guid>
		<description><![CDATA[I got an old Wacom graphire2 that I haven&#8217;t been utilizing that much since I seldom do graphic work anymore. But I&#8217;ve recently been teaching my daughter on how to use Adobe Illustrator. Saw this new product from Wacom, amazing technology jump on how to interact with drawings to be vector images which makes me [...]]]></description>
			<content:encoded><![CDATA[<p>I got an old Wacom graphire2 that I haven&#8217;t been utilizing that much since I seldom do graphic work anymore. But I&#8217;ve recently been teaching my daughter on how to use Adobe Illustrator. Saw this new product from Wacom, amazing technology jump on how to interact with drawings to be vector images which makes me want to fall in love with drawing again.</p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="425" height="344" src="http://www.youtube.com/embed/fXbBA1DRE84" frameborder="0" allowFullScreen="true"> </iframe> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/inkling-by-wacom/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create a Web Service using SOAP</title>
		<link>http://blog.lopau.com/create-a-web-service-using-soap/</link>
		<comments>http://blog.lopau.com/create-a-web-service-using-soap/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 14:49:58 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SalesForce]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[force.com]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1502</guid>
		<description><![CDATA[This week one of the requirements for our client was to have a force.com application communicate with an external web service running on PHP to generate a barcode sequence. I&#8217;ll teach how I was able to setup the web service using NuSOAP and a document/literal as rcp/encoded is not supported by force.com. My goal was [...]]]></description>
			<content:encoded><![CDATA[<p>This week one of the requirements for our client was to have a force.com application communicate with an external web service running on PHP to generate a barcode sequence. I&#8217;ll teach how I was able to setup the web service using NuSOAP and a document/literal as rcp/encoded is not supported by force.com. My goal was to make the task easier on php side so from force.com it would make a request by passing a string delimited by an asterisk and pipe. We process the string and return it back as url for the barcode image. I wont be covering barcode creation though in this tutorial but only the web service and sample client.<br />
<span id="more-1502"></span></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
<br />
e.g. Name*2|Mr.*3</p>
<p>The web service will parse the string convert it to an array. You can ofcourse pass any other type of string with a delimiter. </p>
<p>Here is how the server is.</p>
<div class="codesnip-container" >// Pull in the NuSOAP code<br />
require_once(&#8216;lib/nusoap.php&#8217;);<br />
// Create the server instance<br />
$server = new soap_server();<br />
$server->configureWSDL( &#8216;servicename&#8217;, &#8216;urn:servicename&#8217;, &#8221;, &#8216;document&#8217;);<br />
myRegister($server,&#8217;DoSomething&#8217;,array(<br />
	&#8216;in&#8217; => array(<br />
		&#8216;sf-parameters&#8217; =>  &#8216;xsd:string&#8217;),<br />
	&#8216;out&#8217; => array(&#8216;Pass&#8217; => &#8216;xsd:string&#8217;)<br />
));<br />
//if in safe mode, raw post data not set:<br />
if (!isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = implode(&#8220;\r\n&#8221;, file(&#8216;php://input&#8217;));<br />
$server->service( $HTTP_RAW_POST_DATA);<br />
function myRegister( &#038;$server, $methodname, $params) {<br />
	$server->register($methodname, $params["in"], $params["out"],<br />
&#8216;urn:servicename&#8217;, // namespace<br />
	$server->wsdl->endpoint .&#8217;#&#8217;. $methodname, // soapaction<br />
&#8216;document&#8217;, // style<br />
&#8216;literal&#8217;, // use<br />
&#8216;Generate Barcode Sequence URL&#8217; // documentation<br />
	);<br />
}<br />
function DoSomething($params) {<br />
	$string = $params;<br />
	$list = explode(&#8220;|&#8221;, $string);<br />
	//make associative array<br />
	$result = array();<br />
	foreach($list as $key=>$values) {<br />
		$result[] = explode(&#8220;*&#8221;, $values);<br />
	}</p>
<p>	//creates the string<br />
	$bcStr = &#8220;&#8221;;<br />
	foreach($result as $values) {<br />
		$bcStr .= $values[0];<br />
		for ($i = 1; $i < = $values[1]; $i++) {<br />
			$bcStr .= "\t";<br />
		}<br />
	}</p>
<p>	return array('Pass'=> $bcStr);<br />
}</p></div>
<p>You are instantiating a class of the NuSOAP server and configuring it with WSDL. You also create two functions,, one handles the $server->register method which takes the argument incoming request and the outgoing response and the $server->wsdl with arguments defining the server as a document/literal. </p>
<p>Then for my task purpose the incoming delimited string is converted to an associative array and then converted back to string with the proper formatting I require ($bcStr), if you have barcode class you can pass that string and a barcode image should be generated from it. That however is not covered on this tutorial.</p>
<p>Next is simple php client to test the web service out.</p>
<div class="codesnip-container" ><?php<br />
// Pull in the NuSOAP code<br />
require_once('lib/nusoap.php');<br />
// Create the client instance<br />
$ns="urn:servicename";<br />
$client = new nusoap_client('http://localhost/soap_server/hellowsdl2.php?wsdl', true);<br />
if ( $client->getError() ) {<br />
	print &#8220;Soap Constructor Error:
<pre>".
	$client->getError()."</pre>
<p>&#8220;;<br />
}<br />
$params=array(&#8220;sf-parameters&#8221;=>&#8221;Name*2|Mr.*3&#8243;);<br />
$result = $client->call( &#8220;DoSomething&#8221;, array(&#8220;parameters&#8221;=>$params), $ns);<br />
if ($client->fault) {<br />
	//soap_fault<br />
	print &#8220;<br />
<h2>Soap Fault: </h2>
<pre>(". $client->fault->faultcode .")  ".
	$client->fault->faultstring. "</pre>
<p>&#8220;;<br />
}<br />
elseif ( $client->getError() ) {<br />
	print &#8220;<br />
<h2>Soap Error: </h2>
<pre>". $client->getError() ."</pre>
<p>&#8220;;<br />
}<br />
else {<br />
	print &#8220;<br />
<h2>Result: </h2>
<pre>". $result["Pass"] ."</pre>
<p>&#8220;;<br />
}<br />
print &#8216;<br />
<h2>Details:</h2>
<hr />&#8216;.<br />
&#8216;<br />
<h3>Request</h3>
<pre>' .
htmlspecialchars( $client->request, ENT_QUOTES) .'</pre>
<p>&#8216;.<br />
&#8216;<br />
<h3>Response</h3>
<pre>' .
htmlspecialchars( $client->response, ENT_QUOTES) .'</pre>
<p>&#8216;.<br />
&#8216;<br />
<h3>Debug</h3>
<pre>' .
htmlspecialchars( $client->debug_str, ENT_QUOTES) .'</pre>
<p>&#8216;;<br />
?></p></div>
<p>This time I instantiated a <strong>nusoap_client</strong> note that underscore _ as I got stuck on this earlier and got PHP complaining when it was just <strong>nusoapclient</strong>. Next I created the string params to be passed to the DoSomething method via $client->call.</p>
<p>Then from here we goback to our force.com app we make a soap request to the webservice and it returns with the response we need. On Force.com make sure you add your web service the Remote Site Settings under Setup > Administrative Setup > Security Controls. </p>
<p>Kudos for the resource and solution for task from the original author <a href="http://mleiv.com/php-nusoap-documentliteral-web/">mleiv blog&#8217;s.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/create-a-web-service-using-soap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D Augmented Reality platform(QR+AR) for iPhone, iPad, Android, BB</title>
		<link>http://blog.lopau.com/3d-augmented-reality-platformqrar-for-iphone-ipad-android-bb/</link>
		<comments>http://blog.lopau.com/3d-augmented-reality-platformqrar-for-iphone-ipad-android-bb/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 06:00:52 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[Augmented Reality]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1494</guid>
		<description><![CDATA[Technology is really moving fast, saw this in my mailing list and is truly amazing. Its a 3D Augmented reality field solution that works on smartphones. AR Jewelry &#8211; Platform for demonstration of products (jewelry, toys etc) using the 3D Augmented Reality technology. The list of products in this application is downloaded from Internet allowing [...]]]></description>
			<content:encoded><![CDATA[<p>Technology is really moving fast, saw this in my mailing list and is truly amazing. Its a 3D Augmented reality field solution that works on smartphones.</p>
<p>AR Jewelry &#8211; Platform for demonstration of products (jewelry, toys etc) using the 3D Augmented Reality technology.</p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="425" height="344" src="http://www.youtube.com/embed/hlc-UKjBXVM" frameborder="0" allowFullScreen="true"> </iframe> </p>
<p>The list of products in this application is downloaded from Internet allowing to add dynamically new products to the server and demonstrate them to users.</p>
<p>Ready to licence it(as white label) to third parties(advertising agencies, jewelry/toys etc producers etc) etc.</p>
<p>More AR solutions: <a href="http://ar23d.com ">http://ar23d.com </a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/3d-augmented-reality-platformqrar-for-iphone-ipad-android-bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create rewrite rules for friendly url for WordPress plugin custom queries</title>
		<link>http://blog.lopau.com/create-rewrite-rules-for-friendly-url-for-wordpress-plugin-custom-queries/</link>
		<comments>http://blog.lopau.com/create-rewrite-rules-for-friendly-url-for-wordpress-plugin-custom-queries/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 05:23:42 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rewrite rules]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1473</guid>
		<description><![CDATA[I have this personal web application that was built from scratch last year and has already been considerably indexed by google. I used some Apache mod rewrite to make the urls friendly. Last week I decided it would be faster/easier to jumpstart the project again if I just focus on my application and just use [...]]]></description>
			<content:encoded><![CDATA[<p>I have this personal web application that was built from scratch last year and has already been considerably indexed by google. I used some Apache mod rewrite to make the urls friendly. Last week I decided it would be faster/easier to jumpstart the project again if I just focus on my application and just use a framework to handle other intracacies like abstractions, security and etc. I was aiming for CodeIgniter but got a glimpse on BuddyPress for WordPress(not a framework) which has most of the features I want for my app. So long story short I ended up porting my application to be a plugin for WordPress.</p>
<p><span id="more-1473"></span></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
<br />
One thing that got me stuck for awhile was how to recreate my old URLs. Posting some tips for an example on how I got the issue solved.</p>
<p>Target: Make WordPress rewrite this URLs</p>
<blockquote>
<p>http://www.thesite.com/mypage/food/</p>
<p>to </p>
<p>http://www.thesite.com/mypage/?ingredients=food</p>
<p>http://www.thesite.com/mypage/food/asia/</p>
<p>to </p>
<p>http://www.thesite.com/mypage/?ingredients=food&#038;origin=asia</p>
</blockquote>
<p>1. Create your plugin and create a shortcode </p>
<blockquote>
<p>(eg. add_shortcode(&#8216;myapp&#8217;, &#8216;myfunction&#8217;); )</p>
</blockquote>
<p>2. Create a new Page and add the shortcode </p>
<blockquote>
<p>[myapp]</p>
</blockquote>
<p>With Permalinks off your page looks like</p>
<blockquote><p>http://www.thesite.com/?page_id=5</p></blockquote>
<p>And is basically the same as </p>
<blockquote><p>http://www.thesite.com/index.php?page_id=5</p></blockquote>
<p>With Permalinks on</p>
<blockquote><p>http://www.thesite.com/mypage/</p></blockquote>
<p>3. If you pass a query on your app the URL may look like this, Im passing the queries on the URL</p>
<blockquote><p>http://www.thesite.com/mypage/?ingredients=food</p></blockquote>
<p>or</p>
<blockquote><p>http://www.thesite.com/mypage/?ingredients=food&#038;origin=asia</p></blockquote>
<p>Depending on the queries passed the contents on your page changes.</p>
<p>4. Now to rewrite the URLs to be friendly you need to add a filter and use query_vars</p>
<blockquote>
<p>add_filter(&#8216;query_vars&#8217;, &#8216;my_query_vars&#8217;);<br />
function my_query_vars($public_query_vars) {<br />
	$public_query_vars[] = &#8220;ingredients&#8221;;<br />
	$public_query_vars[] = &#8220;origin&#8221;;<br />
	return $public_query_vars;<br />
}</p>
</blockquote>
<p>This ensure that when WordPress parses the URL, the <em>ingredients </em> and <em>origin </em> gets saved in the query variables.</p>
<p>4. Next is create your rewrite rules and store in an array</p>
<blockquote><p>
add_filter(&#8216;generate_rewrite_rules&#8217;, &#8216;my_rewrite&#8217;);</p>
<p>function my_rewrite($wp_rewrite) {<br />
	$wp_rewrite->rules =<br />
	array_merge(array<br />
	(<br />
	&#8216;^mypage/([^/]+)/?$&#8217; => &#8216;index.php?page_id=5e&#038;ingredients=$matches[1]&#8216;,<br />
	&#8216;^mypage/([^/]+)/([^/]+)/?$&#8217; => &#8216;index.php?page_id=5&#038;ingredients=$matches[1]&#038;origin=$matches[2]&#8216;</p>
<p>	), $wp_rewrite->rules);<br />
}
</p></blockquote>
<p>Note: That you are rewriting to the original URL of the page. You are storing each rewrite rule to an array and finally adding them to a filter by generate_rewrite_rules.</p>
<p>5. To get the variables back just call the get_query_vars function on your plugin.</p>
<blockquote><p>echo get_query_var(&#8216;ingredients&#8217;); </p></blockquote>
<p>So this is how I got my problem solved. Hopefully it would be a great help to others. Happy rewriting and coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/create-rewrite-rules-for-friendly-url-for-wordpress-plugin-custom-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing GoDaddy SSL on an EC2 Ubuntu Instance in AWS</title>
		<link>http://blog.lopau.com/installing-godaddy-ssl-on-an-ec2-ubuntu-instance-in-aws/</link>
		<comments>http://blog.lopau.com/installing-godaddy-ssl-on-an-ec2-ubuntu-instance-in-aws/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 07:09:38 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[WAMP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1440</guid>
		<description><![CDATA[If you have sensitive data on your site, you may want to install an SSL Certificate to make it more secure. Here is a brief tutorial being on AWS EC2 Ubuntu instance on how to set it up. My server settings are Apache2 and Ubuntu 9.x 1. Login to ssh/terminal on your server 2. Enable [...]]]></description>
			<content:encoded><![CDATA[<p>If you have sensitive data on your site, you may want to install an SSL Certificate to make it more secure. Here is a brief tutorial being on AWS EC2 Ubuntu instance on how to set it up. </p>
<p>My server settings are Apache2 and Ubuntu 9.x<br />
<span id="more-1440"></span><br />

<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
<br />
1. Login to ssh/terminal on your server<br />
2. Enable SSL for WebServer(Apache2)</p>
<blockquote><p>sudo a2enmod SSL</p></blockquote>
<p>3. Create the server SSL Key</p>
<blockquote><p>sudo bash</p></blockquote>
<p> On Ubuntu this changes you to the root user as you cannot access the directory on the next step.</p>
<blockquote><p>cd /etc/ssl/private</p></blockquote>
<blockquote><p>openssl genrsa -des3 -out myserver.com.key 2048</p></blockquote>
<p> Make sure its 2048 and not 1024 bit as this would be required later on GoDaddy.<br />
Enter keyphrase</p>
<p>5. Create the CSR (Certificate Service Request) to be entered on GoDaddy</p>
<blockquote><p>openssl req -new -key myserver.com.key -out myserver.com.csr</p></blockquote>
<p>Upon enter it will ask you for several things but make sure that under Common Name you put your website url (myserver.com). (GoDaddy will throw an error if it is not a correct website)</p>
<p>6. View the CSR and Copy. Paste it later to your GoDaddy SSL Certificate Management</p>
<p>7. On GoDaddy SSL Certificate Management make a Request and choose Third Party, Web Server no Control Panel. And Paste the CSR code.</p>
<blockquote><p>a. Upon Submit you would get the approval. It would check that your domain registry and administrative contacts to verify.<br />
b. If it cannot be verified via the domain registry, you will be emailed a code that you need to create as a file and upload to your server instead.
</p></blockquote>
<p>8. Install your certificate gd_bundle.crt and myserver.com.crt to your server. Upload them to the server and install. Back to shell</p>
<blockquote><p>mv gd_bundle.crt /etc/ssl/gd_bundle.crt<br />
mv myserver.com.crt /etc/ssl/certs/myserver.com.crt
</p></blockquote>
<p>9. Edit the default Apache2 values at /etc/apache2/sites-available/default. Create a new virtualhost</p>
<blockquote><p>NameVirtualHost *:443<br />
<virtualhost *:443><br />
DocumentRoot /var/www/<br />
SSLEngine on<br />
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire<br />
SSLCertificateFile /etc/ssl/certs/myserver.com.crt<br />
SSLCertificateKeyFile /etc/ssl/private/myserver.com.key<br />
SSLCertificateChainFile /etc/ssl/gd_bundle.crt<br />
</virtualhost></p></blockquote>
<p>10. Make sure Apache2 to listen on port 443, edit the /etc/apache2/ports.conf<br />
Under</p>
<blockquote><p><ifmodule mod_ssl.c><br />
Listen 443</p>
<p></ifmodule></p></blockquote>
<p>10. Restart Apache</p>
<blockquote><p>/etc/init.d/apache2 restart</p></blockquote>
<p>If all went well you should be able to access https</p>
<p>For EC2 make sure Port 443 is enabled as well on the AWS Console</p>
<p>11. Then to force redirect users to https create an htaccess file and upload to your root www folder</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{SERVER_PORT} 80<br />
RewriteRule ^(.*)$ https://www.myserver.com/$1 [R,L]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/installing-godaddy-ssl-on-an-ec2-ubuntu-instance-in-aws/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon RDS instance time zone workarounds</title>
		<link>http://blog.lopau.com/amazon-rds-instance-time-zone-workarounds/</link>
		<comments>http://blog.lopau.com/amazon-rds-instance-time-zone-workarounds/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 05:23:59 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[WAMP]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rds]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1438</guid>
		<description><![CDATA[If you have an EC2 instance to run your application and an RDS instance for your database. On your EC2 instance you are in luck as you can easily change the time zone of the machine. Like set it to GST or by location like below # ln -sf ../usr/share/zoneinfo/Asia/Dubai /etc/localtime The real issue is [...]]]></description>
			<content:encoded><![CDATA[<p>If you have an EC2 instance to run your application and an RDS instance for your database. On your EC2 instance you are in luck as you can easily change the time zone of the machine. Like set it to GST or by location like below</p>
<blockquote><p># ln -sf ../usr/share/zoneinfo/Asia/Dubai /etc/localtime</p></blockquote>
<p><span id="more-1438"></span></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
<br />
The real issue is that you can&#8217;t change your timezone on your MySQL RDS instance its default it UTC and you cannot modify this. Making our timestamp 4 hours behind.</p>
<p>3 Workaround solutions gathered are the following.<br />
1. Set Time Zone per connection </p>
<blockquote><p>eg. SET time_zone = &#8216;Asia/Dubai&#8217;;</p></blockquote>
<p>2. MySQL convert_tz function per insert</p>
<p>insert into table (timestamp) values (convert_tz(now(), &#8216;GST&#8217;, &#8216;Asia/Dubai&#8217;));</p>
<p>3. Manually getting timezone by code</p>
<blockquote><p>$date = date(&#8216;Y-m-d H:i:s&#8217;);<br />
insert into table(date) values (&#8216;&#8221; . $date .&#8221;&#8216;)</p></blockquote>
<p>Another issue I have is to update old timestamp records in my database to adjust it by 4 hours. If you have a table with old records and want to update the timezone by adding/minus (x) hours to adjust you can try this query.</p>
<blockquote><p>UPDATE table SET datefield= DATE_ADD(datefield, INTERVAL 4 HOUR);</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/amazon-rds-instance-time-zone-workarounds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protection from SQL Injection and XSS Attack on CKEditor</title>
		<link>http://blog.lopau.com/protection-from-sql-injection-and-xss-attack-on-ckeditor/</link>
		<comments>http://blog.lopau.com/protection-from-sql-injection-and-xss-attack-on-ckeditor/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 07:08:59 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[WAMP]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[xss attack]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1427</guid>
		<description><![CDATA[Lazy coding got the better of me as one of the sites I built got hacked. The site is running on a custom php framework I built. Security wise it was still too infant and alot of security needs to be patched. Through SQL Injection via the URL the hacker was able to get into [...]]]></description>
			<content:encoded><![CDATA[<p>Lazy coding got the better of me as one of the sites I built got hacked. The site is running on a custom php framework I built. Security wise it was still too infant and alot of security needs to be patched. Through SQL Injection via the URL the hacker was able to get into my database and eventually cracked a user&#8217;s password then posted an XSS script on the CKEditor which eventually got the site compromised further. </p>
<p><span id="more-1427"></span></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
So here are some tips on how to patch up your system based on experience, you can do further reading on the topics.<br />
1. To avoid SQL injection, if your query string is something like </p>
<blockquote><p>index.php?page=news</p></blockquote>
<p>script-kiddies and hackers love this, make sure you sanitize the variables before you do a select query on your database, a simple index.php?page=news&#038;1=1 could expose your db.</p>
<p>a. First turn off magic_quotes, you should stop using this as its deprecated and causes a bit of confusion from addslashes/stripslashes.</p>
<p>b. To sanitize here are a couple of functions you can use, strip_tags() and mysql_real_escape_string() functions, use them on your passed variable before you use in a select or insert statement.</p>
<p>c. Learn how to use apache_mod_rewrite, you can rename your query strings plus its a good SEO tool so from</p>
<blockquote><p>index.php?page=news to something like /page/news/ </p></blockquote>
<p>2. If you have users in your system make sure their passwords are strong enough. Use uppercase, lowercase, characters etc.. If a hack was able to do an SQL Injection and got hold of your database info and users, they can reverse md5 a weak password in seconds. </p>
<p>NOTE: For testing I used a tool to try SQL Injection on a copy of the website on my localhost, I was able crack it in less than 5 minutes. Thats how fast a hacker can compromise your system if security is weak.</p>
<p>3. WYSIWG CKEditor is a great tool but it opens alot of vulnerability, without properly sanitizing the input you can put in malicous javascript codes. Test your editor by entering </p>
<blockquote><p>alert(&#8220;Test&#8221;)</p></blockquote>
<p>If you see the alert box your very susceptible to XSS attack.</p>
<p>Since CKEditor outputs HTML you can&#8217;t do strip_tags as it will strip away your HTML unless you pass it some parameters. A better way is to install <a href="http://htmlpurifier.org/">HTMLPurifier</a>, its free and opensource. Using it will dramatically reduce the chances of getting an XSS attack on your editor.</p>
<p>4. If you are using CKFinder you must properly set the CheckAuthentication function, simply stating true will allow anybody who knows the location of the file to upload any file to your system. Good thing CKFinder upload is disabled for files with .php extensions or the renamed shell script from (file.php to file.php.pdf) would have compromised my server further.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/protection-from-sql-injection-and-xss-attack-on-ckeditor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari Bug on Lion: The application Safari canceled restart</title>
		<link>http://blog.lopau.com/safari-bug-on-lion-the-application-safari-canceled-restart/</link>
		<comments>http://blog.lopau.com/safari-bug-on-lion-the-application-safari-canceled-restart/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 04:59:49 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1418</guid>
		<description><![CDATA[Noticed a bug on my Safari after upgrading to Lion. Haven&#8217;t been able to recreate it is as it appears to be random, when using Safari and you close some tabs. When you try to quit the Safari, the option is greyed out from the Safari Menu and Command+Q does not work. If you try [...]]]></description>
			<content:encoded><![CDATA[<p>Noticed a bug on my Safari after upgrading to Lion. Haven&#8217;t been able to recreate it is as it appears to be random, when using Safari and you close some tabs. When you try to quit the Safari, the option is greyed out from the Safari Menu and Command+Q does not work. If you try to restart your mac you&#8217;ll get the screen shot below.<br />
<span id="more-1418"></span><br />
<a href="http://blog.lopau.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-12-at-12.47.00-PM.png"><img src="http://blog.lopau.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-12-at-12.47.00-PM.png" alt="" title="Screen Shot 2011-08-12 at 12.47.00 PM" width="448" height="183" class="aligncenter size-full wp-image-1421" /></a></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
So far there doesn&#8217;t seem to be a patch in place and temporary solution so far is to Force Quit Safari. You can also delete the Safari icon on the dock and add it back. Will keep updating this post still a permanent solution is found or is patched by Apple.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/safari-bug-on-lion-the-application-safari-canceled-restart/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Make money online with your photographs</title>
		<link>http://blog.lopau.com/make-money-online-with-your-photographs/</link>
		<comments>http://blog.lopau.com/make-money-online-with-your-photographs/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 03:25:40 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1406</guid>
		<description><![CDATA[Another tip on how to make money online if you have the skills in photography is to sell them to stock photography agencies. There are alot of people looking for stock photos and yours might just be sitting in your hard drive. I have tons of snaps taken from past photoshoot chances but currently I [...]]]></description>
			<content:encoded><![CDATA[<p>Another tip on how to make money online if you have the skills in photography is to sell them to stock photography agencies. There are alot of people looking for stock photos and yours might just be sitting in your hard drive.</p>
<p><span id="more-1406"></span><br />
<a href="http://blog.lopau.com/wp-content/uploads/2011/08/shutter.jpg"><img src="http://blog.lopau.com/wp-content/uploads/2011/08/shutter.jpg" alt="" title="shutter" width="565" height="290" class="aligncenter size-full wp-image-1410" /></a></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
I have tons of snaps taken from past photoshoot chances but currently I have been very busy at work, to get me inspired to take more good photos and enhance my skills I thought of selling my photographs I signed up to <a href="http://shutterstock.com">shutterstock.com</a>. (As a good source of inspiration is someone&#8217;s appreciation of your work and willing to pay for them) plus also this could be a great stream of passive income if managed right. Image rates range from $0.25 to $28.00 USD per download. The payout is via Paypal so its very easy. So testing the waters before I try other websites which are also well established like <a href="http://dreamstime.com"></a><a href="http://www.fotolia.com/">fotolia.com</a>, <a href="http://istockphoto.com">istockphoto.com</a> and <a href="http://dreamstime.com">dreamstime.com</a>. </p>
<p>So if you&#8217;re a hobbyist like me start checking out the sites I listed above and earn from your photographs. I&#8217;m hobbyist/amateur/novice photographer and not really a professional, I&#8217;m not fond of wedding photography or covering events. I just like to capture art and the moment. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/make-money-online-with-your-photographs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

