<?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>Fernandez de Quilon</title>
	<atom:link href="http://www.jefferyfernandez.id.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jefferyfernandez.id.au</link>
	<description>between flat screens and grey matter</description>
	<lastBuildDate>Sat, 28 Aug 2010 04:28:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Zend Debugger: Cannot read a valid value of zend_debugger.httpd_uid</title>
		<link>http://www.jefferyfernandez.id.au/2010/08/28/zend-debugger-cannot-read-a-valid-value-of-zend_debugger-httpd_uid/</link>
		<comments>http://www.jefferyfernandez.id.au/2010/08/28/zend-debugger-cannot-read-a-valid-value-of-zend_debugger-httpd_uid/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 04:27:08 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[Debugger]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=117</guid>
		<description><![CDATA[If you happen to have setup Zend Debugger for debugging your PHP code and you encounter the following error in the webserver error log: Zend Debugger: Cannot read a valid value of zend_debugger.httpd_uid or zend.httpd_uid, will not perform dropping of &#8230; <a href="http://www.jefferyfernandez.id.au/2010/08/28/zend-debugger-cannot-read-a-valid-value-of-zend_debugger-httpd_uid/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you happen to have setup Zend Debugger for debugging your PHP code and you encounter the following error in the webserver error log:</p>
<blockquote><p>Zend Debugger: Cannot read a valid value of zend_debugger.httpd_uid or zend.httpd_uid, will not perform dropping of privileges</p></blockquote>
<p>then your setup will fail when you try to debug over a tunnel. This is caused by the debugger not being aware of the uid of the process which runs the web server.</p>
<p>To fix this, we need to find the user ID of the httpd process that runs the Zend Debugger. One way of finding the UID is by opening up the /etc/passwd file. You should see something similar to:</p>
<p><code>_www:*:70:70:World Wide Web Server:/Library/WebServer:/usr/bin/false</code></p>
<p>Now to fix the problem, we update the zend config in the php.ini file and restart the webserver. Here is my complete zend debugger configuration:</p>
<p><code>[zend]<br />
zend_extension=/opt/local/lib/php/extensions/no-debug-non-zts-20090626/ZendDebugger.so<br />
zend_debugger.allow_hosts=127.0.0.1,10.1.1.2,10.1.1.3,10.0.1.149,10.0.1.123,10.0.1.124<br />
zend_debugger.expose_remotely=always<br />
zend_debugger.httpd_uid=70</code></p>
<p>Now for some real debugging <img src='http://www.jefferyfernandez.id.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2010/08/28/zend-debugger-cannot-read-a-valid-value-of-zend_debugger-httpd_uid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install PDT for Adobe Flash Builder</title>
		<link>http://www.jefferyfernandez.id.au/2010/08/23/install-pdt-for-adobe-flash-builder/</link>
		<comments>http://www.jefferyfernandez.id.au/2010/08/23/install-pdt-for-adobe-flash-builder/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 23:16:04 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[Adobe Flash Builder]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=99</guid>
		<description><![CDATA[I have come across several people trying to do this in a convoluted way. Here is the simple way of adding PDT to your Flash Builder IDE. Since current Flash Builder is basically built on Eclipse Galileo, you just have &#8230; <a href="http://www.jefferyfernandez.id.au/2010/08/23/install-pdt-for-adobe-flash-builder/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have come across several people trying to do this in a convoluted way. Here is the simple way of adding PDT to your Flash Builder IDE.</p>
<p>Since current Flash Builder is basically built on Eclipse Galileo, you just have to add the update site for Galileo</p>
<p>In Flash Builder, go to<br />
Help &gt; Install New Software</p>
<p>Click on &#8220;Available Software Sites&#8221; link, which should open up &#8220;Available Software Sites&#8221; window. If you don&#8217;t have the Galileo update site already configured, add a new Software site. Call it &#8220;Eclipse 3.5 updates&#8221; and add the URL: http://download.eclipse.org/releases/galileo/</p>
<p>Back in the &#8220;Available Software&#8221; screen, select &#8220;All available sites&#8221; for the &#8220;Work with&#8221; section. In the search input below that, type in PDT and you should see PDT as an item on the search result. Select it and click the next button. Eclipse will now prompt you with a review screen of the packages which are going to be installed. Click next and complete the installation. You may have to restart the IDE for the changed to take affect.</p>
<p>Shown below is the review screen of PDT installation.</p>
<div id="attachment_111" class="wp-caption alignnone" style="width: 880px"><img class="size-full wp-image-111" title="PDT Installation for Flash Builder" src="http://www.jefferyfernandez.id.au/wp-content/uploads/2010/08/PDT-Installation.jpeg" alt="PDT Installation for Flash Builder" width="870" height="761" /><p class="wp-caption-text">PDT Installation for Flash Builder</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2010/08/23/install-pdt-for-adobe-flash-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Return to Blogging</title>
		<link>http://www.jefferyfernandez.id.au/2010/08/23/return-to-blogging/</link>
		<comments>http://www.jefferyfernandez.id.au/2010/08/23/return-to-blogging/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 22:44:24 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=88</guid>
		<description><![CDATA[Yes, I am back! After a long absence of over 2 years I hope to blog again. Lots of things have happened since the last time I wrote an entry. Life has changed ever since I became a father around &#8230; <a href="http://www.jefferyfernandez.id.au/2010/08/23/return-to-blogging/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yes, I am back! After a long absence of over 2 years I hope to blog again. Lots of things have happened since the last time I wrote an entry. Life has changed ever since I became a father around 2 years ago. My son Denzel will be 2 years old in September and it has been a hectic but enjoyable journey so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2010/08/23/return-to-blogging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Date Age Calculation</title>
		<link>http://www.jefferyfernandez.id.au/2008/07/02/mysql-date-age-calculation/</link>
		<comments>http://www.jefferyfernandez.id.au/2008/07/02/mysql-date-age-calculation/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 09:03:03 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[MySql]]></category>
		<category><![CDATA[stored routines]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=76</guid>
		<description><![CDATA[I have always had the need to calculate the age as year and month from a MySQL field of type date. No doubt you can achieve this with a bit of PHP, but when you require to do the conversion &#8230; <a href="http://www.jefferyfernandez.id.au/2008/07/02/mysql-date-age-calculation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have always had the need to calculate the age as year and month from a MySQL field of type date. No doubt you can achieve this with a bit of PHP, but when you require to do the conversion right from MySQL, you can only go as far as getting the age in &#8220;years&#8221;.</p>
<p>I have used here a MySQL stored routine to achive this:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">DELIMITER $$
<span style="color: #990099; font-weight: bold;">DROP</span> <span style="color: #990099; font-weight: bold;">FUNCTION</span> <span style="color: #009900;">IF</span> <span style="color: #990099; font-weight: bold;">EXISTS</span> <span style="color: #008000;">`my<span style="color: #008080; font-weight: bold;">_</span>database`</span>.<span style="color: #008000;">`getage`</span> $$
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">DEFINER</span><span style="color: #CC0099;">=</span><span style="color: #008000;">`root`</span>@<span style="color: #008000;">`localhost`</span> <span style="color: #990099; font-weight: bold;">FUNCTION</span> <span style="color: #008000;">`getage`</span><span style="color: #FF00FF;">&#40;</span>pdate <span style="color: #999900; font-weight: bold;">DATE</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">RETURNS</span> <span style="color: #000099;">char</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">30</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">DETERMINISTIC</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> years <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> months <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> days <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">DECLARE</span> current_year <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> current_month <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> current_day <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">DECLARE</span> year_diff <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> month_diff <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> day_diff <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">DECLARE</span> yearstring <span style="color: #000099;">CHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">6</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">DECLARE</span> monthstring <span style="color: #000099;">CHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">7</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">YEAR</span><span style="color: #FF00FF;">&#40;</span>pdate<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> years<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">MONTH</span><span style="color: #FF00FF;">&#40;</span>pdate<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> months<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">DAY</span><span style="color: #FF00FF;">&#40;</span>pdate<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> days<span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">YEAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">CURRENT_DATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> current_year<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">MONTH</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">CURRENT_DATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> current_month<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #000099;">DAY</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">CURRENT_DATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> current_day<span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #FF00FF;">&#40;</span>current_year <span style="color: #CC0099;">-</span> years<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> year_diff<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #FF00FF;">&#40;</span>current_month <span style="color: #CC0099;">-</span> months<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> month_diff<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #FF00FF;">&#40;</span>current_day <span style="color: #CC0099;">-</span> days<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">INTO</span> day_diff<span style="color: #000033;">;</span>
&nbsp;
<span style="color: #009900;">if</span> <span style="color: #FF00FF;">&#40;</span>current_month <span style="color: #CC0099;">&amp;</span>lt<span style="color: #000033;">;</span> months<span style="color: #FF00FF;">&#41;</span> <span style="color: #009900;">THEN</span>
	<span style="color: #990099; font-weight: bold;">SET</span> month_diff <span style="color: #CC0099;">=</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#40;</span>months <span style="color: #CC0099;">-</span> <span style="color: #008080;">12</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">*</span> <span style="color: #CC0099;">-</span><span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">+</span> current_month<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">SET</span> year_diff <span style="color: #CC0099;">=</span> <span style="color: #FF00FF;">&#40;</span>year_diff <span style="color: #CC0099;">-</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #009900;">END</span> <span style="color: #009900;">IF</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #009900;">if</span> <span style="color: #FF00FF;">&#40;</span> month_diff <span style="color: #CC0099;">=</span> <span style="color: #008080;">1</span> <span style="color: #FF00FF;">&#41;</span> <span style="color: #009900;">THEN</span>
	<span style="color: #990099; font-weight: bold;">SET</span> monthstring <span style="color: #CC0099;">=</span> <span style="color: #008000;">&quot;month&quot;</span><span style="color: #000033;">;</span>
<span style="color: #009900;">ELSE</span>
	<span style="color: #990099; font-weight: bold;">SET</span> monthstring <span style="color: #CC0099;">=</span> <span style="color: #008000;">&quot;months&quot;</span><span style="color: #000033;">;</span>
<span style="color: #009900;">END</span> <span style="color: #009900;">IF</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #009900;">if</span> <span style="color: #FF00FF;">&#40;</span> year_diff <span style="color: #CC0099;">=</span> <span style="color: #008080;">1</span> <span style="color: #FF00FF;">&#41;</span> <span style="color: #009900;">THEN</span>
	<span style="color: #990099; font-weight: bold;">SET</span> yearstring <span style="color: #CC0099;">=</span> <span style="color: #008000;">&quot;year&quot;</span><span style="color: #000033;">;</span>
<span style="color: #009900;">ELSE</span>
	<span style="color: #990099; font-weight: bold;">SET</span> yearstring <span style="color: #CC0099;">=</span> <span style="color: #008000;">&quot;years&quot;</span><span style="color: #000033;">;</span>
<span style="color: #009900;">END</span> <span style="color: #009900;">IF</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #009900;">if</span> <span style="color: #FF00FF;">&#40;</span> year_diff <span style="color: #CC0099;">=</span> <span style="color: #008080;">0</span> <span style="color: #FF00FF;">&#41;</span> <span style="color: #009900;">THEN</span>
	RETURN <span style="color: #000099;">CONCAT_WS</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span> month_diff<span style="color: #000033;">,</span> monthstring<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #009900;">ELSE</span>
	<span style="color: #009900;">if</span> <span style="color: #FF00FF;">&#40;</span>month_diff <span style="color: #CC0099;">&amp;</span>gt<span style="color: #000033;">;</span> <span style="color: #008080;">0</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #009900;">THEN</span>
		RETURN <span style="color: #000099;">CONCAT_WS</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span>year_diff<span style="color: #000033;">,</span> yearstring<span style="color: #000033;">,</span> month_diff<span style="color: #000033;">,</span> monthstring<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
	<span style="color: #009900;">ELSE</span>
		RETURN <span style="color: #000099;">CONCAT_WS</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span>year_diff<span style="color: #000033;">,</span> yearstring<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
	<span style="color: #009900;">END</span> <span style="color: #009900;">IF</span><span style="color: #000033;">;</span>
<span style="color: #009900;">END</span> <span style="color: #009900;">IF</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #009900;">END</span> $$
&nbsp;
DELIMITER <span style="color: #000033;">;</span></pre></div></div>

<p>You can then make use of the stored routine to convert Dates into ages by doing so:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> getage<span style="color: #FF00FF;">&#40;</span>BirthDate<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">as</span> UserAge <span style="color: #990099; font-weight: bold;">FROM</span> my_database.users</pre></div></div>

<ul>
<li><a title="http://dev.mysql.com/doc/refman/5.0/en/routine-restrictions.html" href="http://dev.mysql.com/doc/refman/5.0/en/routine-restrictions.html" target="_blank">http://dev.mysql.com/doc/refman/5.0/en/routine-restrictions.html</a></li>
<li><a title="http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html" href="http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html" target="_blank">http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2008/07/02/mysql-date-age-calculation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino IDE on 64bit openSUSE</title>
		<link>http://www.jefferyfernandez.id.au/2008/04/21/arduino-ide-on-64bit-opensuse/</link>
		<comments>http://www.jefferyfernandez.id.au/2008/04/21/arduino-ide-on-64bit-opensuse/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 23:34:12 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSuSe]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ftdi]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rxtx]]></category>
		<category><![CDATA[ser2net]]></category>
		<category><![CDATA[usbserial]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=69</guid>
		<description><![CDATA[Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It&#8217;s an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software &#8230; <a href="http://www.jefferyfernandez.id.au/2008/04/21/arduino-ide-on-64bit-opensuse/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Arduino" href="http://www.arduino.cc/" target="_blank"><img class="align-left alignleft" style="float: left;" title="Arduino Board" src="http://www.jefferyfernandez.id.au/wp-content/uploads/2008/02/arduino.jpg" alt="Arduino Board" width="200" height="139" />Arduino</a> is a tool for making computers that can sense and control more of the physical world than your desktop computer. It&#8217;s an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board.</p>
<p>Unfortunately the serial port  communication driver (RXTX) which comes with the arduino download is not 64 bit compatible. I will describe here how I successfully compiled &amp; installed the driver  to get the Arduino IDE running on a 64 bit openSUSE installation. Most of the instructions should be pretty straight forward to be replicated on an other rpm based distribution. For ubuntu/debain based distributions, you can find the <a title="Arduino IDE on 64 bit Ubuntu Gutsy" href="http://myy.helia.fi/~karte/arduino_editor_on_64_bit_ubuntu_gutsy.html" target="_blank">instructions provided by Tero Karvinen</a> useful.</p>
<h3>Packages Required for Arduino IDE</h3>
<p>The following packages are required to run the Arduino IDE:</p>
<ul>
<li> java-1_5_0-sun</li>
<li> cross-avr-gcc</li>
<li> cross-avr-binutils</li>
<li> avr-libc</li>
</ul>
<h3>Linux USB Serial Converter Driver</h3>
<p>Besides the above software, you will also need a compatible kernel. This means version 2.6.x or at least 2.4.30. For example, it needs USB serial support with the <a title="Future Technology Devices International" href="http://ftdi-usb-sio.sourceforge.net/" target="_blank">FTDI</a> driver. After connecting an Arduino board to your computer via an <a title="Types of USB Connectors" href="http://en.wikipedia.org/wiki/Universal_Serial_Bus#Types_of_USB_connectors" target="_blank">AB USB cable</a>, it should load the ftdi modules automatically. Ensure <em>ftdi_sio</em> and <em>usbserial</em> modules are loaded by executing:</p>
<pre class="usercommand">lsmod | grep ftdi</pre>
<p>It should return output similar to whats shown below:</p>
<pre class="shelloutput">ftdi_sio               54280  0
usbserial              52688  1 ftdi_sio
usbcore               156456  6 ftdi_sio,usbserial,usbhid,ohci_hcd,ehci_hcd</pre>
<p>If not, as root, run:</p>
<pre class="rootcommand">modprobe ftdi_sio</pre>
<p>If there are no errors from the above command, then the module is loaded successfully.</p>
<h3>System Requirements</h3>
<p>The Arduino IDE is java based and RXTX [2] is a native java library providing serial and parallel communication for the Java Development Toolkit. The RXTX lib uses lock files by default. So Before you use lock files you need to do one of two things:</p>
<ol>
<li>Be the <strong>root</strong> or <strong>uucp</strong> user on your machine whenever you use rxtx</li>
<li>Or add the specific user that needs to use rxtx to the group uucp. (preferred)</li>
</ol>
<p>Add your user account to the <strong>uucp</strong> group by going to <strong>yast2</strong> &gt; <strong>Security and Users</strong> &gt; <strong>User Management</strong>. Once you have added yourself to the group, you will need to restart your session to make it affective. Once you are in the new session, verify that your account belongs to the uucp group by executing &#8220;groups&#8221; on the shell. It should give return you a list of groups your account belongs to.</p>
<h3><span id="more-69"></span><br />
<script type="text/javascript"><!--
google_ad_client = "pub-5896900602713932";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-10-07: general
google_ad_channel = "5562041263";
//-->
</script><br />
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>Packages required for building rxtx-java</h3>
<ul>
<li>autoconf</li>
<li>automake</li>
<li>libtool</li>
<li>gnu make</li>
<li>gcc</li>
<li>jdk &gt; 1.3 or java-1_5_0-sun-devel</li>
<li>checkinstall (optional)</li>
</ul>
<p>After installing the necessary libraries, you can download and start building the library with the following commands:</p>
<pre class="usercommand">wget http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip</pre>
<pre class="usercommand">unzip rxtx-2.1-7r2.zip</pre>
<pre class="usercommand">cd rxtx-2.1-7r2</pre>
<pre class="usercommand">export JAVA_HOME=/usr/lib64/jvm/java-1.5.0-sun/</pre>
<pre class="usercommand">./configure</pre>
<pre class="usercommand">make</pre>
<p>Once the libraries are built, you can install them by following either one of the following two methods:</p>
<ol>
<li>Build an RPM package with the help of <a title="Checkinstall to the rescue" href="http://www.jefferyfernandez.id.au/2006/05/19/checkinstall-to-the-rescue/" target="_blank">checkinstall<br />
</a>(preferred)</li>
<li>Copy the libs to the arduino libs folder.</li>
</ol>
<p>If you are opting for the checkinstall method, I suggest to name the package rxtx-java. You can then install the package using normal rpm commands. Once you have done that, you need to determine the path to the libraries. Execute the following to obtain the Path to the rxtx libraries:</p>
<pre>rpm -ql librxtx-java | grep RXTXcomm.jar
/usr/java/jdk1.5.0_06/jre/lib/ext/RXTXcomm.jar</pre>
<p>We will now remember to add the path (&#8216;/usr/java/jdk1.5.0_06/jre/&#8217;) to the arduino bootstrap script.</p>
<p>To install the libraries the second way, you can copy the compiled RXTXcomm.jar and librxtxSerial.so files to the arduino lib directory. The libs are built and placed into &#8220;x86_64-unknown-linux-gnu/.libs/&#8221; folder while the jar file should be in the same folder you are in.</p>
<h3>Setting up the Arduino IDE</h3>
<p>Download and untar the Arduino IDE from <a title="Arduino IDE" href="http://www.arduino.cc/en/Main/Software" target="_blank">Arduino Software page</a></p>
<pre class="usercommand">wget http://www.arduino.cc/files/arduino-0010-linux.tgz &amp;&amp; \
tar -xvzf arduino-0010-linux.tgz</pre>
<p>In the arduino/tools directory, make symlinks:</p>
<pre class="usercommand">cd arduino-0010/hardware/tools</pre>
<pre class="usercommand"> ln -s /opt/cross/bin/avr-gcc avr-gcc &amp;&amp; \
ln -s /opt/cross/bin/avr-g++ avr-g++ &amp;&amp; \
ln -s /opt/cross/bin/avr-objcopy avr-objcopy &amp;&amp; \
ln -s /opt/cross/bin/avr-objdump avr-objdump &amp;&amp; \
ln -s /opt/cross/bin/avr-size avr-size</pre>
<p>Copy the compiled RxTx-java libray into the arduino-0010/lib folder. Before doing so rename the existing libraries.</p>
<pre class="usercommand">cd ../../lib/</pre>
<pre class="usercommand">mv librxtxSerial.so librxtxSerial.so.DISABLED</pre>
<pre class="usercommand">mv RXTXcomm.jar RXTXcomm.jar.DISABLED</pre>
<p>Now copy the freshly compiled rxtx libraries into this folder</p>
<pre class="usercommand">cp ../../rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/librxtxSerial.so .</pre>
<pre class="usercommand">cp ../../rxtx-2.1-7r2/RXTXcomm.jar .</pre>
<p>Once you have copied the library and jar file, you are ready to execute the arduino bootstrap script to launch the Arduino IDE.</p>
<pre class="usercommand">./arduino
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7</pre>
<h3>The Arduino IDE</h3>
<p><img class="align-center" title="Arduino IDE" src="http://www.jefferyfernandez.id.au/wp-content/uploads/2008/02/arduino_ide.png" alt="Arduino IDE" width="500" height="600" /></p>
<h4>Resources</h4>
<ol>
<li><a title="Arduino" href="http://www.arduino.cc" target="_blank">http://www.arduino.cc</a></li>
<li><a title="RXTX" href="http://www.rxtx.org" target="_blank">http://www.rxtx.org</a></li>
<li><a title="Future Technology Devices International" href="http://ftdi-usb-sio.sourceforge.net/" target="_blank">http://ftdi-usb-sio.sourceforge.net/</a></li>
<li><a title="Future Technology Devices International" href="http://www.ftdichip.com/Drivers/3rdPartyDrivers.htm" target="_blank">http://www.ftdichip.com/Drivers/3rdPartyDrivers.htm</a></li>
<li>serproxy: <a title="Serial Proxy" href="http://www.lspace.nildram.co.uk/freeware.html" target="_blank">http://www.lspace.nildram.co.uk/freeware.html</a></li>
<li>ser2net: <a title="ser2net" href="http://ser2net.sourceforge.net" target="_blank">http://ser2net.sourceforge.net</a></li>
<li>Java Comm Serial API How-To for Linux: <a title="Java Comm Serial API How-To for Linux" href="http://wass.homelinux.net/howtos/Comm_How-To.shtml" target="_blank">http://wass.homelinux.net/howtos/Comm_How-To.shtml</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2008/04/21/arduino-ide-on-64bit-opensuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>openSUSE &#8220;Packaging Day II&#8221;</title>
		<link>http://www.jefferyfernandez.id.au/2008/03/15/opensuse-packaging-day-ii/</link>
		<comments>http://www.jefferyfernandez.id.au/2008/03/15/opensuse-packaging-day-ii/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 09:45:27 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[openSuSe]]></category>
		<category><![CDATA[openSUSE build service]]></category>
		<category><![CDATA[packaging]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=73</guid>
		<description><![CDATA[Ever had problems finding a package for your favorite application for your favorite distro? Are you an application developer or project contributor, and want to learn how to provide binary packages for all the popular distros (including openSUSE) automatically? Using &#8230; <a href="http://www.jefferyfernandez.id.au/2008/03/15/opensuse-packaging-day-ii/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://build.opensuse.org/"><img style="float: left;" src="http://www.jefferyfernandez.id.au/wp-content/uploads/2008/03/logo-buildservice.png" rel="attachment wp-att-74" alt="openSUSe Build Service logo" title="openSUSe Build Service logo" class="align-left alignleft" height="75" width="127" /></a>Ever had problems finding a package for your favorite application for your favorite distro? Are you an application developer or project contributor, and want to learn how to provide binary packages for all the popular distros (including <a target="_blank" title="openSUSE Linux Distribution" href="http://en.opensuse.org/Welcome_to_openSUSE.org">openSUSE</a>) automatically?</p>
<p>Using the <a target="_blank" title="openSUSE Build Service" href="http://build.opensuse.org">openSUSE Build Service</a>, you can provide software packages for most popular Linux distros using one single service. Rather than maintaining separate systems to build packages, you can take advantage of the openSUSE Build Service and let it do most of the work.</p>
<p>To learn how to leverage the build service, join the openSUSE community on April 4th and 5th on <a target="_blank" title="Internet Relay Chat" href="http://en.wikipedia.org/wiki/IRC">IRC</a> to hone your package building skills. The <i><b>Packaging Days II</b></i> event will be held on Freenode at #opensuse-buildservice. Community members will be standing by to provide support and answer questions about using the build service and creating packages.</p>
<p>Find out more about the <i><b>Packaging Days II</b></i> event at: <a target="_blank" href="http://en.opensuse.org/Packaging/Packaging_Day" title="http://en.opensuse.org/Packaging/Packaging_Day">http://en.opensuse.org/Packaging/Packaging_Day</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2008/03/15/opensuse-packaging-day-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing TV shows into Mythtv</title>
		<link>http://www.jefferyfernandez.id.au/2008/02/24/importing-tv-shows-into-mythtv/</link>
		<comments>http://www.jefferyfernandez.id.au/2008/02/24/importing-tv-shows-into-mythtv/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 14:25:41 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[mythtv]]></category>
		<category><![CDATA[tv shows]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/?p=67</guid>
		<description><![CDATA[I have been using the popular open source multimedia programme called mythtv for a while now. Apart from recording my favourite TV shows, I also utilise the various modules like mythmusic, mythnews, mythvideo and mythweb. Though you can use mythvideo &#8230; <a href="http://www.jefferyfernandez.id.au/2008/02/24/importing-tv-shows-into-mythtv/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img style="float: left;" src="http://www.jefferyfernandez.id.au/wp-content/uploads/2008/02/mythtv-blue_menu.jpg" rel="attachment wp-att-68" alt="mythtv" title="mythtv" class="align-left alignleft" height="150" width="200" />I have been using the popular open source multimedia programme called <a target="_blank" title="Mythtv" href="http://en.wikipedia.org/wiki/Mythtv">mythtv</a> for a while now. Apart from recording my favourite TV shows, I also utilise the various modules like mythmusic, mythnews, mythvideo and mythweb. Though you can use mythvideo to view videos which are not tv recordings, there are no specific modules which can import a show into mythtv.</p>
<p>But wait, just when you think its not possible to import a show into the mythtv recordings, there is a way to do so. There is a perl script called &#8220;myth.rebuilddatabase.pl&#8221; which comes with the mythtv-doc package of mythtv. Usually the &#8220;myth.rebuilddatabase.pl&#8221; script resides at &#8220;/usr/share/doc/packages/mythtv-doc/contrib/&#8221; folder. Else, If you are on an rpm based system you can look for its path with the following command:</p>
<pre class="usercommand">rpm -qal "myth*" | grep "\.pl"</pre>
<p>This should return all the available perl scripts which are distributed with mythtv. Now to use the script, we need make a copy of the script to your home folder and configure it. Edit the file and update the relevant mysql mythtv database connection details. Now copy the tv show files which you want to import, into your mythtv recordings folder.<br />
<span id="more-67"></span><br />
<script type="text/javascript"><!--
google_ad_client = "pub-5896900602713932";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-10-07: general
google_ad_channel = "5562041263";
//-->
</script><br />
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>Meta Data</h2>
<p>To import the show into Mythtv, you have the option of importing the meta data associated with it. The meta data consists of the show title, sub-title, description, show time and most importantly the channel id. To retrieve the channel ids which are available on your mythtv installation, you can query the mysql database with the following shell command:<br />
<code class="usercommand">mysql --host [localhost] --user [mythtv] -p -e 'use [mythconverg]; select chanid, name, callsign from channel where visible=1'</code><br />
Change the appropriate values in the command shown above (in brackets) to reflect your database setup and hit enter. It should now prompt you to enter the database password for the mythtv database table and then will list the available channels on your mythtv installation.</p>
<h2>Import Show</h2>
<p>To import the show we change into the recordings folder and just execute the script followed by the file extension of the show we are importing:</p>
<pre class="usercommand">~/myth.rebuilddatabase.pl --ext avi</pre>
<p>In this instance I am importing an .avi file. The rebuild script scans your mythtv directory and each file will be checked against your database to see if it exists.  If they do not, you will be prompted for a channel-id, the show title, subtitle, description, show start time and duration of the show, and a record will be created. Finally it will prompt you with the question of whether you want to &#8220;build a seek table for this file&#8221;. Just say yes and it will update the &#8220;seek&#8221; information for that show. Another important thing to remember is not to give the same &#8220;show time&#8221; of an already existing show for the same channel id, else it will produce a mysql database error &#8220;Duplicate entry&#8221;.</p>
<h3>Final Note:</h3>
<p>I have noted that only the following files types can be imported: {nuv,mpg,mpeg,avi}. I am hoping to import a few ogg based files into mythtv. I will update this entry on my attempt to import those ogg files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2008/02/24/importing-tv-shows-into-mythtv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two Twenty20 tickets for sale</title>
		<link>http://www.jefferyfernandez.id.au/2008/01/07/two-twenty20-tickets-for-sale/</link>
		<comments>http://www.jefferyfernandez.id.au/2008/01/07/two-twenty20-tickets-for-sale/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 23:01:15 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[australia]]></category>
		<category><![CDATA[cricket]]></category>
		<category><![CDATA[india]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/2008/01/07/two-twenty-20-tickets-for-sale/</guid>
		<description><![CDATA[I have had enough of the game of cricket, specially involving the Australian cricket team. First it was the racial accusations made by the Australian cricket team while they were touring the sub-continent. I have seen the so called &#8220;racial &#8230; <a href="http://www.jefferyfernandez.id.au/2008/01/07/two-twenty20-tickets-for-sale/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://jefferyfernandez.id.au/wp-content/uploads/2008/01/cricket-set-128.jpg" alt="Cricket gone bad" align="left" height="128" width="128" />I have had enough of the game of cricket, specially involving the Australian cricket team. First it was the racial accusations made by the Australian cricket team while they were touring the sub-continent.</p>
<p>I have seen the so called &#8220;racial monkey taunts&#8221; made by the the crowds at Vadodra and Wankhede stadium in India. In my opinion it was meant to be a humorous joke just making a comparison to how Andrew Symonds stands out amongst his own team mates. I mean look at him when he has the white sun screen protection on his lips and his fluffy hair to go with it. He looks more like a clown than a Monkey. And if you call me a racist after this comment I made, then go to hell.</p>
<p>Akhil Tandulwadikar&#8217;s comment on <a href="http://lazybug.wordpress.com/2007/10/19/get-a-haircut-andrew/">Andrew Symonds hair</a> would explain what this &#8220;monkey chants&#8221; are all about.</p>
<blockquote><p>Therefore, it has led me to conclude that the only possible rational explanation to these monkey chants lies somewhere else. Something that the mediaâ€“in Australia and Indiaâ€“has totally missed in its hurry to earn some TRP</p></blockquote>
<p>And then we have Australia chasing a record 16 test win in a row at the SCG this year. It is definately the worst game of cricket I have seen. The way the Australian team appealed for Dravid&#8217;s wicket in the second innings was just embarrassing. You can&#8217;t call any Australian player a gentleman after this test match. They play the game just to get a record in their name. Cricket is a gentleman&#8217;s game. A fine example was when Yuvraj Singh &#8220;walked&#8221; after he realised he nicked the ball.</p>
<p>At an interview, the Indian Captain was asked if he thought the match had been played in the right spirit, Kumble said, â€œOnly one team was playing in the spirit of the game.â€ It was reminiscent of Australian captain Bill Woodfullâ€™s words during the Bodyline series. Shame on you Australia.</p>
<p>And finally to prove how bad the game of cricket has become, which included few poor umpiring decisions and a some embarrassing cricket played by the Australian team. This is how they won the second test match:</p>
<p><b>Ruled in favour of Aus:</b><br />
1. Andrew Symonds caught on 30<br />
2. Ponting caught on 15<br />
3. Andrew Symonds stumped on 48<br />
4. Andrew Symonds lbw on 103<br />
5. Andres Symonds stumped on 140 (not even reffered to third umpire).<br />
6. Hussey plumb lbw on the back foot in the second innings.<br />
7. Hussey caught down the leg side by the keeper.<br />
8. This could have gone either way&#8230; Kumble&#8217;s hatrick ball to Symonds.<br />
9. Dravid caught a padded shot by the keepoer and appealed for wicket (most<br />
embarassing appeal)<br />
10) Gangully caught by Clarke, clearly on the half volley and the umpire asked<br />
Ponting if he caught it. Why woudn&#8217;t Ponting say &#8220;yes&#8221; to that?</p>
<p><b>Ruled in favor of India</b><br />
1. Ricky ponting inside edge given lbw on 55.<br />
2. This could have gone either way&#8230; Sachin LBW when on 48.</p>
<p>This is not cricket. Oh by the way, I am an Indian born Australian citizen. I am not making any biased comments because I am Indian. In fact I loved how the Australians played their cricket, until what I saw unfolding at the SCG.</p>
<p>Now for those who came looking for the <a href="http://www.mcg.org.au/default.asp?pg=eventsdisplay&amp;eventid=368" title="twenty20 match at the MCG" target="_blank">twenty20 ticket</a> I am offering, <strike>shoot me an email at tickets@fernandez.net.au and if you are lucky, you can enjoy some more embarrassing cricket played by the Australian team at the <a href="http://www.mcg.org.au/" title="Melbourne Cricket Ground" target="_blank">MCG</a>. </strike>they have been sold.</p>
<p><b>And here is what some others have to say:</b></p>
<ul>
<li><a href="http://blogs.thewest.com.au/sport/john-townsend-no-room-for-cheeky-monkeys" title="No room for cheeky monkeys" target="_blank">No room for cheeky monkeys</a></li>
<li><a href="http://content-aus.cricinfo.com/magazine/content/current/story/329392.html" title="Australia's attitude lacking in appeal" target="_blank">Australia&#8217;s attitude lacking in appeal</a></li>
<li><a href="http://www.smh.com.au/news/cricket/dodgy-deeds-leave-sour-taste/2008/01/06/1199554486052.html" title="Dodgy deeds leave sour taste" target="_blank">Dodgy deeds leave sour taste</a></li>
<li><a href="http://www.smh.com.au/news/cricket/arrogant-ponting-must-be-fired-roebuck/2008/01/07/1199554571883.html" title="Arrogant Ponting must be fired" target="_blank">Arrogant Ponting must be fired</a></li>
<li><a href="http://www.creationontheweb.com/content/view/5564/" title="It's just not cricket!" target="_blank">It&#8217;s just not cricket!</a></li>
<li><a href="http://www.crikey.com.au/Media-Arts-and-Sports/20080107-Another-hollow-victory-for-Australian-cricket.html" title="Another hollow victory for Australian cricket" target="_blank">Another hollow victory for Australian cricket</a></li>
<li><a href="http://www.smh.com.au/news/editorial/victory-without-honour-walk-the-walk-watch-the-talk/2008/01/07/1199554568809.html" title="Victory without honour: walk the walk, watch the talk" target="_blank">Victory without honour: walk the walk, watch the talk</a></li>
<li><a href="http://www.theage.com.au/news/cricket/why-pontings-heroes-just-dont-appeal-to-me/2008/01/08/1199554654309.html" target="_blank" title="Why Ponting's heroes just don't appeal to me">Why Ponting&#8217;s heroes just don&#8217;t appeal to me</a></li>
</ul>
<p><b>Man I loves this list of Top Sledges</b></p>
<ul>
<li><a href="http://fireix.wordpress.com/2008/01/08/sledgeing-in-cricket/" title="Some sledging gems from various sources." target="_blank">Some sledging gems from various sources</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2008/01/07/two-twenty20-tickets-for-sale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate SSH logins with RSA/DSA keys</title>
		<link>http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/</link>
		<comments>http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 05:22:33 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[BASh]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/</guid>
		<description><![CDATA[Often when you are administrating remote Linux servers, you tend to login to the servers via your favorite shell. And every time when you login you are prompted for a user name + password to authenticate your session. This gets &#8230; <a href="http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jefferyfernandez.id.au/wp-content/uploads/2007/12/utilities-terminal.png" alt="Automated Shell Login" align="left" />Often when you are administrating remote Linux servers, you tend to login to the servers via your favorite shell. And every time when you login you are prompted for a user name + password to authenticate your session. This gets a bit tedious if you have many passwords to remember for different logins. This is were <a href="http://www.google.com.au/search?q=ssh+keys&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a" title="Search Google for SSH keys" target="_blank">ssh keys</a> can be used to save you from typing your credentials for every ssh login you execute. Once you have setup your SSH key, you are just one step away from making your life a whole lot easier.</p>
<p>I have put together a shell script which saves me the trouble of remembering various combinations of user names + passwords. It looks something like this: <code class="usercommand">cat ~/.ssh/id_dsa.pub | ssh jeffery@example.com "(mkdir .ssh&amp;&gt;/dev/null; chmod 700 .ssh &amp;&amp; cat - &gt;&gt; .ssh/authorized_keys ) &amp;&amp; chmod 600 .ssh/authorized_keys"</code><span id="more-39"></span><br />
<script type="text/javascript"><!--
google_ad_client = "pub-5896900602713932";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-10-07: general
google_ad_channel = "5562041263";
//-->
</script><br />
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Cat Piped Over Ssh explained</h3>
<p>Lets take it step by step and go through what the above command actually does. This is the order of what happens when the above command is executed:</p>
<ol>
<li>Concatenate the contents (<strong><em>cat ~/.ssh/id_dsa.pub </em></strong>) of my DSA public key</li>
<li>Pipe the contents (<strong><em> | </em></strong>) to the ssh command <strong><em>ssh jeffery@example.com</em></strong></li>
<li>I am then executing four commands to the remote host via SSH
<ol>
<li>The first command <strong><em>mkdir .ssh&amp;&gt;/dev/null</em></strong> is making sure the remote folder .ssh exists by creating it. And if the directory already exists, it will give an error message, but that error message is discarded to <a href="http://en.wikipedia.org/wiki/Data_sink" target="_blank" title="Data Sink">/dev/null</a>. There could be a situation when this folder may not exist on the remote machine, hence we are making sure it exists.</li>
<li>Next we make sure the .ssh folder is writable with the command <strong><em>chmod 700 .ssh</em></strong>.</li>
<li>The double-ampersand (<strong><em>&amp;&amp;</em></strong>) which follows these two commands has a special meaning. It states if the previous command executed is not successful, do not execute any more commands in that statement. The only time this would fail would be if there is a folder called .ssh and it is not owned/writable by the user who is supposed to own it. In my case that would be the user &#8220;jeffery&#8221;.</li>
<li>The next command we see is <strong><em>cat &#8211; &gt;&gt; .ssh/authorized_keys</em></strong>. If you remember in Step 1, the cat command which piped the contents of my DSA public key has now produced a Standard Input. This cat command is now taking that input and appending it to the  .ssh/authorized_keys file. If the file didn&#8217;t exist, it should automatically have created that file and appended my DSA public key into it.</li>
<li>Finally we make sure that the authorized_keys file in secure from other users by changing the permissions <strong><em>chmod 600 .ssh/authorized_keys</em></strong>.</li>
</ol>
</li>
<li>After this command is executed, the shell would prompt you to enter the accounts password.
<ol>
<li>If this is the first time you are accessing the remote host, you will be prompted to verify the &#8220;authenticity&#8221; of the host. Type &#8220;yes&#8221; and hit Enter key.</li>
<li>Provide the login password to complete the setup for Automated Login.</li>
</ol>
</li>
</ol>
<h3>Shell Script</h3>
<p>Finally to make things a bit more easier, here is the shell script which you can use by providing the user@domain as the parameter  to setup your Automated logins.<br />
<code class="textinput">#!/bin/bash<br />
user_domain=$1<br />
echo "Automating Login for $user_domain"<br />
# Auto SSH<br />
cat ~/.ssh/id_dsa.pub | ssh $user_domain "(mkdir .ssh&amp;&gt;/dev/null; chmod 700 .ssh &amp;&amp; cat - &gt;&gt; .ssh/authorized_keys ) &amp;&amp; chmod 600 .ssh/authorized_keys"<br />
</code><br />
Copy the Above into a file called auto_ssh.sh, make it executable and run it. Change the user name and remote host to reflect your details. <code class="usercommand">./auto_ssh.sh jeffery@example.com</code></p>
<h3>Resources</h3>
<ul>
<li><a href="http://www-128.ibm.com/developerworks/library/l-keyc.html" title="OpenSSH key management" target="_blank">http://www-128.ibm.com/developerworks/library/l-keyc.html</a></li>
<li><a href="http://www.red-green.com/2007/06/automatic-ssh-login-using-rsadsa-keys/" target="_blank">http://www.red-green.com/2007/06/automatic-ssh-login-using-rsadsa-keys/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2007/12/10/automate-ssh-logins-with-rsadsa-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qBittorrent v1.0.0 Release</title>
		<link>http://www.jefferyfernandez.id.au/2007/10/28/qbittorrent-v100-release/</link>
		<comments>http://www.jefferyfernandez.id.au/2007/10/28/qbittorrent-v100-release/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 00:32:33 +0000</pubDate>
		<dc:creator>Jeffery</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Packages]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[openSuSe]]></category>

		<guid isPermaLink="false">http://www.jefferyfernandez.id.au/2007/10/28/qbittorrent-v100-release/</guid>
		<description><![CDATA[qBittorrent is a Bittorrent client using C++ / libtorrent and a Qt4 Graphical User Interface. Its been under heavy development for a full year now and finally its maturing into one of the best torrent clients out there. I am &#8230; <a href="http://www.jefferyfernandez.id.au/2007/10/28/qbittorrent-v100-release/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jefferyfernandez.id.au/wp-content/uploads/2007/10/qbt-v100-splash-screen-002.thumbnail.png" alt="qBittorrent v1.0.0 Release" align="left" />qBittorrent is a Bittorrent client using C++ / libtorrent and a Qt4 Graphical User Interface. Its been under heavy development for a full year now and finally its maturing into one of the best torrent clients out there. I am the Project Consultant + Packager of the application for my distro of choice: <a href="http://en.opensuse.org/Welcome_to_openSUSE.org" title="openSUSE Home" target="_blank">openSUSE</a>. Packages for other distributions are available (<a href="http://qbittorrent.sourceforge.net/download.php" title="qBittorrent Downloads" target="_blank">qBittorrent Downloads</a>) and a Windows port is coming soon.</p>
<p>Packages for openSUSE 10.2 and 10.3 can be obtained from my <a href="https://build.opensuse.org" title="openSUSE build farm" target="_blank">openSUSE build farm</a> account at : <a href="http://download.opensuse.org/repositories/home:/jefferyfernandez" title="openSUSE build farm home:jefferyfernandez" target="_blank">home:jefferyfernandez</a>. If you encounter any bugs in the package or the application itself, please report them at:  <a href="https://bugs.launchpad.net/qbittorrent/" title="qBittorrent Bugs" target="_blank">qBittorrent Bug-tracker</a>. Happy torrenting <img src='http://www.jefferyfernandez.id.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>qBittorrent Home: <a href="http://www.qbittorrent.org" title="qBittorrent Home" target="_blank">http://www.qbittorrent.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jefferyfernandez.id.au/2007/10/28/qbittorrent-v100-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
