<?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>Ten Fingers And A BrainTen Fingers And A Brain &#187; </title>
	<atom:link href="http://ten-fingers-and-a-brain.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ten-fingers-and-a-brain.com</link>
	<description>Martin Lormes on Wordpress, PHP, Nagios, XML, FileMaker, BlackBerry, Arduino</description>
	<lastBuildDate>Tue, 02 Apr 2013 12:13:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>WordPress plugin updated: Smart Quotes (0.4)</title>
		<link>http://ten-fingers-and-a-brain.com/2013/04/wordpress-plugin-updated-smart-quotes-0-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-plugin-updated-smart-quotes-0-4</link>
		<comments>http://ten-fingers-and-a-brain.com/2013/04/wordpress-plugin-updated-smart-quotes-0-4/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 12:11:51 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[L10n]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=402</guid>
		<description><![CDATA[There is a nifty function in WordPress that automagically turns so-called &#34;straight&#34; or &#34;dumb&#34; quotes into so-called "smart" or "curly" quotes. (Look at the last sentence closely: There's a difference between the various quotation marks.) Different languages use different quotation marks, e.g. Germans use a lower double quotation mark (&#8222;) to open a quotation. The [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Smart Quotes" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/">There is a nifty function in WordPress that automagically turns so-called &quot;straight&quot; or &quot;dumb&quot; quotes into so-called "smart" or "curly" quotes. (Look at the last sentence closely: There's a difference between the various quotation marks.) Different languages use different quotation marks, e.g. Germans use a lower double quotation mark (&#8222;) to open a quotation. The double curly quotation mark that the English use to open (&#8220;) the Germans use to close a quotation. So built right into WordPress is the option for translators to change the look of the smart quotes in the language files. However there are two caveats which I address in the plugin "Smart Quotes": Many languages have alternative styles, depending on personal taste, industry tradition, etc., or some languages are spoken in multiple countries, but countries speaking the same language may still use different quotation marks – e.g. Germans use &#8222;&#8230;&#8220; whereas the German-speaking Swi...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2013%2F04%2Fwordpress-plugin-updated-smart-quotes-0-4%2F&amp;via=10fnab&amp;text=WordPress%20plugin%20updated%3A%20Smart%20Quotes%20%280.4%29&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>I just released version 0.4 of my <a href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/">Smart Quotes WordPress plugin</a>. It works with WordPress versions 3.4 and 3.5 now (guess I am a bit behind on these things).</p>
<p><a class="download" href="http://downloads.wordpress.org/plugin/smart-quotes.zip">Download &#8220;Smart Quotes&#8221; (.zip) now</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2013/04/wordpress-plugin-updated-smart-quotes-0-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/bin/rm: Argument list too long</title>
		<link>http://ten-fingers-and-a-brain.com/2012/03/binrm-argument-list-too-long/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=binrm-argument-list-too-long</link>
		<comments>http://ten-fingers-and-a-brain.com/2012/03/binrm-argument-list-too-long/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 10:06:58 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[Anything else]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=374</guid>
		<description><![CDATA[This isn't really new, but it's sure worth knowing... The fact that there's a 128K buffer used to pass arguments to child processes in the Linux Kernel can have the following effect on shell external commands: When you run commands such as rm spam* the shell (e.g. bash) will expand the "spam*" to a list [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2012/03/binrm-argument-list-too-long/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="/bin/rm: Argument list too long" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2012/03/binrm-argument-list-too-long/">This isn't really new, but it's sure worth knowing... The fact that there's a 128K buffer used to pass arguments to child processes in the Linux Kernel can have the following effect on shell external commands: When you run commands such as rm spam* the shell (e.g. bash) will expand the "spam*" to a list of names of all files in the working directory that start with "spam". That list is then passed to the executable /bin/rm using the 128K buffer mentioned above. If you have a large number of files, or the list gets long because of long file names, you may get an error message saying /bin/rm: Argument list too long. To work around this you can get the list of filenames using find and pipe it to xargs which in turn invokes rm for every single file. There is no limit on the size of a pipe (or at least none that I am aware of for this practical purpose). Here's the full command: find . -name 'spam*' -print0 | xargs -0 rm This differs from similar commands you might find in the -print0 an...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2012%2F03%2Fbinrm-argument-list-too-long%2F&amp;via=10fnab&amp;text=%2Fbin%2Frm%3A%20Argument%20list%20too%20long&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2012/03/binrm-argument-list-too-long/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>This isn&#8217;t really new, but it&#8217;s sure worth knowing&#8230; The fact that there&#8217;s a 128K buffer used to pass arguments to child processes in the Linux Kernel can have the following effect on shell external commands:</p>
<p>When you run commands such as <code>rm spam*</code> the shell (e.g. bash) will expand the &#8220;spam*&#8221; to a list of names of all files in the working directory that start with &#8220;spam&#8221;. That list is then passed to the executable <code>/bin/rm</code> using the 128K buffer mentioned above. If you have a large number of files, or the list gets long because of long file names, you may get an error message saying <code>/bin/rm: Argument list too long</code>.</p>
<p>To work around this you can get the list of filenames using <code>find</code> and pipe it to <code>xargs</code> which in turn invokes <code>rm</code> for every single file. There is no limit on the size of a pipe (or at least none that I am aware of for this practical purpose). Here&#8217;s the full command:</p>
<p><code>find . -name 'spam*' -print0 | xargs -0 rm</code></p>
<p>This differs from similar commands you might find in the <code>-print0</code> and <code>-0</code> arguments: These are needed in case you have spaces in your filenames.</p>
<p>For an in-depth explanation of both the 128K buffer and the spaces in filenames issue you may also want to <a href="http://www.moundalexis.com/archives/000035.php">read the May 2004 update in this blog post</a>. (See, I told you it&#8217;s not really new.)</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2012/03/binrm-argument-list-too-long/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Excel: Truncate Text at Last Slash</title>
		<link>http://ten-fingers-and-a-brain.com/2012/02/excel-truncate-text-at-last-slash/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=excel-truncate-text-at-last-slash</link>
		<comments>http://ten-fingers-and-a-brain.com/2012/02/excel-truncate-text-at-last-slash/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 12:01:49 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[excel]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=369</guid>
		<description><![CDATA[Let's assume you have a value in cell E2 that has several components separated by slashes, e.g. a file path. You may find yourself in the position that you need to truncate the value at the last slash, e.g. get the full path of the folder that your file resides in. E 2 /path/to/folder/file The [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2012/02/excel-truncate-text-at-last-slash/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Excel: Truncate Text at Last Slash" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2012/02/excel-truncate-text-at-last-slash/">Let's assume you have a value in cell E2 that has several components separated by slashes, e.g. a file path. You may find yourself in the position that you need to truncate the value at the last slash, e.g. get the full path of the folder that your file resides in. E 2 /path/to/folder/file The following formula will do the job: =LEFT(E2,SEARCH("%",SUBSTITUTE(E2,"/","%",LEN(E2)-LEN(SUBSTITUTE(E2,"/",))))-1) This will return "/path/to/folder". Please note that for the formula to work "%" must not be present anywhere in your value. If your value contains "%" you should substitute that in the formula with another character that is not present. (Know your legal characters!) Update: Works in LibreOffice Calc, too, and I presume OpenOffice Calc will be no different.</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2012%2F02%2Fexcel-truncate-text-at-last-slash%2F&amp;via=10fnab&amp;text=Excel%3A%20Truncate%20Text%20at%20Last%20Slash&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2012/02/excel-truncate-text-at-last-slash/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>Let&#8217;s assume you have a value in cell E2 that has several components separated by slashes, e.g. a file path. You may find yourself in the position that you need to truncate the value at the last slash, e.g. get the full path of the folder that your file resides in.</p>
<table>
<thead>
<tr>
<th></th>
<th>E</th>
</tr>
</thead>
<tbody>
<tr>
<th>2</th>
<td>/path/to/folder/file</td>
</tr>
</tbody>
</table>
<p>The following formula will do the job:</p>
<p><code>=LEFT(E2,SEARCH("%",SUBSTITUTE(E2,"/","%",LEN(E2)-LEN(SUBSTITUTE(E2,"/",))))-1)</code></p>
<p>This will return &#8220;/path/to/folder&#8221;.</p>
<p>Please note that for the formula to work &#8220;%&#8221; must not be present anywhere in your value. If your value contains &#8220;%&#8221; you should substitute that in the formula with another character that is not present. (Know your legal characters!)</p>
<p><strong>Update:</strong> Works in LibreOffice Calc, too, and I presume OpenOffice Calc will be no different.</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2012/02/excel-truncate-text-at-last-slash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3.19 – The Web Hosting Bandwidth Constant</title>
		<link>http://ten-fingers-and-a-brain.com/2012/01/3-19-the-web-hosting-bandwidth-constant/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=3-19-the-web-hosting-bandwidth-constant</link>
		<comments>http://ten-fingers-and-a-brain.com/2012/01/3-19-the-web-hosting-bandwidth-constant/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 19:13:09 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[Anything else]]></category>
		<category><![CDATA[hosting]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=366</guid>
		<description><![CDATA[In case you've ever wondered what the monthly traffic allowance in your web hosting plan means in bandwidth, here's an easy-to-remember number: 3.19 (month kbit) / (sec GB) – I shall call this the Brian Adkins number Under the assumption that traffic from a web server only flows in one direction it means that for [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2012/01/3-19-the-web-hosting-bandwidth-constant/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="3.19 – The Web Hosting Bandwidth Constant" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2012/01/3-19-the-web-hosting-bandwidth-constant/">In case you've ever wondered what the monthly traffic allowance in your web hosting plan means in bandwidth, here's an easy-to-remember number: 3.19 (month kbit) / (sec GB) – I shall call this the Brian Adkins number Under the assumption that traffic from a web server only flows in one direction it means that for every GB (gigabyte) of monthly traffic included in your plan you could consume 3.19 kbit/s constantly. Or for every TB (terabyte) of traffic allowed per month you can transmit data at a constant rate of 3.19 Mbit/s.</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2012%2F01%2F3-19-the-web-hosting-bandwidth-constant%2F&amp;via=10fnab&amp;text=3.19%20%E2%80%93%20The%20Web%20Hosting%20Bandwidth%20Constant&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2012/01/3-19-the-web-hosting-bandwidth-constant/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>In case you&#8217;ve ever wondered what the monthly traffic allowance in your web hosting plan means in bandwidth, here&#8217;s an easy-to-remember number:</p>
<p><strong>3.19 (month kbit) / (sec GB)</strong> – I shall call this the <a href="http://lojic.com/blog/2007/09/03/web-hosting-bandwidth-constant/">Brian Adkins number</a></p>
<p>Under the assumption that traffic from a web server only flows in one direction it means that for every GB (gigabyte) of monthly traffic included in your plan you could consume 3.19 kbit/s constantly. Or for every TB (terabyte) of traffic allowed per month you can transmit data at a constant rate of 3.19 Mbit/s.</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2012/01/3-19-the-web-hosting-bandwidth-constant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New WordPress Plugin: Smart Quotes</title>
		<link>http://ten-fingers-and-a-brain.com/2012/01/new-wordpress-plugin-smart-quotes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-wordpress-plugin-smart-quotes</link>
		<comments>http://ten-fingers-and-a-brain.com/2012/01/new-wordpress-plugin-smart-quotes/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 00:26:37 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[L10n]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=353</guid>
		<description><![CDATA[There is a nifty function in WordPress that automagically turns so-called &#34;straight&#34; or &#34;dumb&#34; quotes into so-called "smart" or "curly" quotes. (Look at the last sentence closely: There's a difference between the various quotation marks.) Different languages use different quotation marks, e.g. Germans use a lower double quotation mark (&#8222;) to open a quotation. The [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Smart Quotes" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/">There is a nifty function in WordPress that automagically turns so-called &quot;straight&quot; or &quot;dumb&quot; quotes into so-called "smart" or "curly" quotes. (Look at the last sentence closely: There's a difference between the various quotation marks.) Different languages use different quotation marks, e.g. Germans use a lower double quotation mark (&#8222;) to open a quotation. The double curly quotation mark that the English use to open (&#8220;) the Germans use to close a quotation. So built right into WordPress is the option for translators to change the look of the smart quotes in the language files. However there are two caveats which I address in the plugin "Smart Quotes": Many languages have alternative styles, depending on personal taste, industry tradition, etc., or some languages are spoken in multiple countries, but countries speaking the same language may still use different quotation marks – e.g. Germans use &#8222;&#8230;&#8220; whereas the German-speaking Swi...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2012%2F01%2Fnew-wordpress-plugin-smart-quotes%2F&amp;via=10fnab&amp;text=New%20WordPress%20Plugin%3A%20Smart%20Quotes&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>I have recently released my newest WordPress plugin to the public:</p>
<p><a href="http://ten-fingers-and-a-brain.com/wordpress-plugins/smart-quotes/">Smart Quotes</a> should appeal to the international audience. E.g. if you&#8217;re a German writer and would like to use German book style quotation marks (&#187;&#8230;&#171;) even when you type so-called &quot;dumb&quot; quotes or use the &lt;q> element: This plugin is for you!</p>
<p>Right now the plugin comes with shortcuts for Croatian/Hungarian/Polish/Romanian style quotation marks (&#8222;&#8230;&#8221;), Czech or German style (&#8222;&#8230;&#8220;), Danish (or German books) style (&#187;&#8230;&#171;), Finnish or Swedish style (&#8221;&#8230;&#8221;), French style (&#171;&nbsp;&#8230;&nbsp;&#187; &ndash; with spaces), Greek/Italian/Norwegian/Portuguese/Russian/Spanish/Swiss style (&#171;&#8230;&#187; &ndash; without spaces), Japanese or Traditional Chinese style (&#12300;&#8943;&#12301;), but you&#8217;re free to manually enter/paste any arbitrary characters or character combinations.</p>
<p><a class="download" href="http://downloads.wordpress.org/plugin/smart-quotes.zip">Download &#8220;Smart Quotes&#8221; (.zip) now</a></p>
<p>After you&#8217;ve <a href="http://wordpress.org/extend/plugins/smart-quotes/installation/">installed</a> the plugin go to your Wrting Settings screen where you will find this:</p>
<p><img src="http://ten-fingers-and-a-brain.com/wp-content/uploads/2012/01/screenshot-1.png" alt="Screenshot of Smart Quotes Settings" width="500" height="129" class="alignnone size-full wp-image-354" /></p>
<p>Right now the plugin comes in English and with a German translation, but for &#8220;Smart Quotes&#8221; I&#8217;d be particularly interested in adding more languages. Contact me if you think you can help! The <a href="http://plugins.svn.wordpress.org/smart-quotes/trunk/smart-quotes.pot">.POT file</a> for this one is really small, so I&#8217;m thinking it could be a quick fix. – If you have never translated software before: <a href="http://forums.lesterchan.net/index.php?topic=108.0">this thread on Lester Chan&#8217;s Forums</a> is a good start and it&#8217;s specific to WordPress plugins.</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2012/01/new-wordpress-plugin-smart-quotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios Plugin to check a Subversion Working Copy for Modifications</title>
		<link>http://ten-fingers-and-a-brain.com/2012/01/nagios-plugin-to-check-a-subversion-working-copy-for-modifications/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nagios-plugin-to-check-a-subversion-working-copy-for-modifications</link>
		<comments>http://ten-fingers-and-a-brain.com/2012/01/nagios-plugin-to-check-a-subversion-working-copy-for-modifications/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 22:29:28 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Nagios Plugins]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagios-plugins]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=343</guid>
		<description><![CDATA[I use revision control systems for almost all of my software development, deployment, and server configuration. When using Subversion there is, technically, no difference between a working copy on my personal or development machines vs. a working copy on a production server. (Yes, you need a working copy on the production server, because exports cannot [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2012/01/nagios-plugin-to-check-a-subversion-working-copy-for-modifications/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Nagios Plugin to check a Subversion Working Copy for Modifications" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2012/01/nagios-plugin-to-check-a-subversion-working-copy-for-modifications/">I use revision control systems for almost all of my software development, deployment, and server configuration. When using Subversion there is, technically, no difference between a working copy on my personal or development machines vs. a working copy on a production server. (Yes, you need a working copy on the production server, because exports cannot be updated that easily.) However, modifications of the checked out code or config files on a production server can cause problems with the next round of updates. Sometimes you just don't notice that there are conflicts that need to be resolved. To make sure I notice when a colleague or I have fallen back into the bad habit of changing things on a production server directly, rather than checking in changes to the repository, I have created a Nagios Plugin: it's called "check_svnstatus" You can download, clone, or fork the plugin from my GitHub repository for Nagios plugins. (I know it's a bit ironic to host this here.) If you're unfami...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2012%2F01%2Fnagios-plugin-to-check-a-subversion-working-copy-for-modifications%2F&amp;via=10fnab&amp;text=Nagios%20Plugin%20to%20check%20a%20Subversion%20Working%20Copy%20for%20Modifications&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2012/01/nagios-plugin-to-check-a-subversion-working-copy-for-modifications/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>I use <a href="http://en.wikipedia.org/wiki/Revision_control">revision control</a> systems for almost all of my software development, deployment, and server configuration. When using <a href="http://subversion.apache.org/">Subversion</a> there is, technically, no difference between a working copy on my personal or development machines vs. a working copy on a production server. (Yes, you need a working copy on the production server, because exports cannot be updated that easily.) However, modifications of the checked out code or config files on a production server can cause problems with the next round of updates. Sometimes you just don&#8217;t notice that there are conflicts that need to be resolved.</p>
<p>To make sure I notice when a colleague or I have fallen back into the bad habit of changing things on a production server directly, rather than checking in changes to the repository, I have created a Nagios Plugin: it&#8217;s called &#8220;check_svnstatus&#8221;</p>
<p><span id="more-343"></span></p>
<p>You can <a href="https://github.com/tfnab/tfnab-nagios-plugins" title="My Nagios Plugins on GitHub">download, clone, or fork the plugin from my GitHub repository for Nagios plugins</a>. (I know it&#8217;s a bit ironic to host this here.) If you&#8217;re unfamiliar with GitHub: <a href="https://github.com/tfnab/tfnab-nagios-plugins/zipball/master" title="My Nagios Plugins on GitHub, .zip download">here&#8217;s a .zip version</a>, and <a href="https://github.com/tfnab/tfnab-nagios-plugins/tarball/master" title="My Nagios Plugins on GitHub, .tar.gz download">here&#8217;s a .tar.gz version</a>.</p>
<h3>Installation and Configuration</h3>
<p>Copy <code>check_svnstatus.sh</code> to your Nagios plugins directory. Usually this will be <code>/usr/lib/nagios/plugins</code> or <code>/usr/local/nagios/libexec</code> but your environment may be different. The plugin needs to be copied to the same server as your working copy, i.e. if you&#8217;re watching working copies on different servers you need the plugin on all of those servers.</p>
<p>Make <code>check_svnstatus.sh</code> executable:</p>
<pre class="brush: bash; title: ; notranslate">
chmod +x check_svnstatus.sh
</pre>
<p>You can test the plugin now by manually invoking it:</p>
<pre class="brush: bash; title: ; notranslate">
/path/to/check_svnstatus.sh -d /your/working-copy
</pre>
<p>You should see &#8220;OK: working copy at /your/working-copy is unmodified&#8221;, but &#8220;CRITICAL: working copy at /your/working-copy contains modifications&#8221; would also be OK for the moment; you can clean up later.</p>
<p>Now we need this to be run from Nagios&#8230; Things will be slightly different depending on whether your working copy resides on the same server as Nagios or on a different server. Lets start with a local working copy, i.e. one that&#8217;s on the same server as your Nagios install.</p>
<p>First you need a Nagios command. If you&#8217;re still using a modified version of the sample configuration files (nothing wrong with that!) append this to <code>commands.cfg</code>:</p>
<pre class="brush: plain; title: ; notranslate">
define command{
  command_name check_local_svnstatus
  command_line $USER1$/check_svnstatus.sh -d $ARG1$
}
</pre>
<p>Then you can add a service definition, e.g. append these lines to <code>localhost.cfg</code>:</p>
<pre class="brush: plain; title: ; notranslate">
define service{
  use                 local-service
  host_name           localhost
  service_description SVN ST /your/working-copy
  check_command       check_local_svnstatus!/your/working-copy
}
</pre>
<p>Reload the Nagios configuration (or, if you get the hint: check in the config changes to your Subversion repository, then run <code>svn update</code> on the config directory on your Nagios server, then run something like <code>service nagios reload</code>) and Nagios will schedule the first check of your working copy&#8230; Things will be very straightforward and self-explaining from here.</p>
<p>Now if your working copy is on a different server than your Nagios install, you need a method to invoke the plugin remotely. There are various methods for doing so, and there tend to be lengthier discussions about the pros and cons, but please keep in mind that this post is <em>not</em> about remote invocation methods. For this example I&#8217;ll be using <a href="http://nagiosplugins.org/man/check_by_ssh">check_by_ssh</a> but <a href="http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf" title="NRPE Documentation (PDF)">NRPE</a> or other methods will work as well. If you&#8217;re unfamiliar with remote invocation and/or you&#8217;ve never run &#8220;check_by_ssh&#8221; before you should get this sorted out first, e.g. by reading <a href="http://www.techrepublic.com/blog/opensource/remotely-monitor-servers-with-the-nagios-checkbyssh-plugin/321" title="Remotely monitor servers with the Nagios check_by_ssh plugin">this post on TechRepublic</a>.</p>
<div class="insert" style="background-color:#fe0;">The following example relies on &#8220;check_by_ssh&#8221; and thus requires additional configuration which is not covered in this article!</div>
<p>Again you need a Nagios command. Append this to <code>commands.cfg</code>:</p>
<pre class="brush: plain; title: ; notranslate">
define command{
  command_name check_ssh_svnstatus
  command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C &quot;/path/to/check_svnstatus.sh -d $ARG1$&quot;
}
</pre>
<p>Note: <code>/path/to/check_svnstatus.sh</code> should be the location on the remote server. This path may be a different than the location of your plugins on the Nagios server itself.</p>
<p>Then you can add a service definition the server&#8217;s .cfg file:</p>
<pre class="brush: plain; title: ; notranslate">
define service{
  use                 generic-service
  host_name           servername
  service_description SVN ST /your/working-copy
  check_command       check_ssh_svnstatus!/your/working-copy
}
</pre>
<p>Once again: reload the Nagios configuration and Nagios will schedule the first check of your working copy&#8230; Things will be as straightforward and self-explaining as they were for a local working copy.</p>
<p>By the way: You can also call this a poor-man&#8217;s <a href="http://en.wikipedia.org/wiki/Intrusion_detection_system" title="Intrusion detection system">IDS</a> as it will trigger alerts when someone exploits your website and drops or alters PHP or other files in your htdocs directory (if you&#8217;re using Subversion to deploy).</p>
<p>Oh, and think about this: It might be good idea to put your Nagios configuration in a Subversion repository. Whether or not you end up monitoring the working copy on the Nagios server.</p>
<h3>Additional reading</h3>
<p>If you&#8217;ve been scratching your head over the &#8220;deployment&#8221; remark in my opening sentence you might want to follow these links:</p>
<ul>
<li><a href="http://josephscott.org/archives/2009/02/installing-wordpress-as-a-subversion-checkout-or-external-in-a-subdirectory/">Joseph Scott: Installing WordPress As A Subversion Checkout (Or External) In A Subdirectory</a></li>
<li><a href="http://codex.wordpress.org/Installing_WordPress_With_Clean_Subversion_Repositories">WordPress Codex: Installing WordPress With Clean Subversion Repositories</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2012/01/nagios-plugin-to-check-a-subversion-working-copy-for-modifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion post-commit hook E-mail report script that sends the diff as an attachment</title>
		<link>http://ten-fingers-and-a-brain.com/2012/01/subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment</link>
		<comments>http://ten-fingers-and-a-brain.com/2012/01/subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 11:27:19 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[E-Mail]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=341</guid>
		<description><![CDATA[I'm using the post-commit hook to send out E-mail notifications when changes are committed to Subversion repositories. If you search the web you'll find a ton of scripts in various languages for this purpose. They all do more or less the same thing: create an E-mail message for the commit, including such details as the [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2012/01/subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Subversion post-commit hook E-mail report script that sends the diff as an attachment" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2012/01/subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment/">I'm using the post-commit hook to send out E-mail notifications when changes are committed to Subversion repositories. If you search the web you'll find a ton of scripts in various languages for this purpose. They all do more or less the same thing: create an E-mail message for the commit, including such details as the revision author, number, timestamp, a list of the paths that were changed, and a diff of the changes. For one particular project I wanted the diff as an attachment, though, rather than inline in the message text. So I ended up writing my own script. It's a Shell script that should work on most Unix/Linux based systems. Source code Installation instructions To install this for your repository: Copy commit-report.sh to the server hosting your repository, for instance to /usr/local/bin, and make sure it's executable (run chmod +x commit-report.sh) Check line #2 of commit-report.sh – you may need to change that address depending on your individual circumstances I remove...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2012%2F01%2Fsubversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment%2F&amp;via=10fnab&amp;text=Subversion%20post-commit%20hook%20E-mail%20report%20script%20that%20sends%20the%20diff%20as%20an%20attachment&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2012/01/subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>I&#8217;m using the <a href="http://svnbook.red-bean.com/en/1.7/svn.ref.reposhooks.post-commit.html">post-commit hook</a> to send out E-mail notifications when changes are committed to Subversion repositories.</p>
<p>If you search the web you&#8217;ll find a ton of scripts in various languages for this purpose. They all do more or less the same thing: create an E-mail message for the commit, including such details as the revision author, number, timestamp, a list of the paths that were changed, and a diff of the changes.</p>
<p>For one particular project I wanted the diff as an attachment, though, rather than inline in the message text. So I ended up writing my own script. It&#8217;s a Shell script that should work on most Unix/Linux based systems.</p>
<p><span id="more-341"></span></p>
<h3>Source code</h3>
<p><script src="https://gist.github.com/1577891.js"> </script></p>
<h3>Installation instructions</h3>
<p>To install this for your repository:</p>
<ol>
<li>Copy <code>commit-report.sh</code> to the server hosting your repository, for instance to <code>/usr/local/bin</code>, and make sure it&#8217;s executable (run <code>chmod +x commit-report.sh</code>)</li>
<li><del>Check line #2 of <code>commit-report.sh</code> – you may need to change that address depending on your individual circumstances</del> <ins>I removed this item later: see <a href="http://ten-fingers-and-a-brain.com/2012/01/subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment/#comment-7811">this comment</a></ins></li>
<li>Edit line #2 of the file <code>post-commit</code>: change <code>/path/to</code> to the correct path for your server, e.g. <code>/usr/local/bin</code></li>
<li>Edit line #2 of the file <code>post-commit</code>: you probably don&#8217;t want to send reports to foo and bar at foo.local but to some other address(es)</li>
<li>If you want a fancy name in the subject line, instead of &#8220;SVN: `basename-of-your-repository`&#8221; append <code>-name "Your fancy name here"</code> to line #2 in <code>post-commit</code></li>
<li>If you haven&#8217;t used the post-commit hook yet, copy the file <code>post-commit</code> to the <code>hooks</code> directory in your repository – Note: Don&#8217;t check it in, but copy it to the respository itself, e.g. in <code>/srv/svn/repositories/myrepo/hooks</code></li>
<li>If you&#8217;ve already used the post-commit hook, and it&#8217;s a Shell script, append line #2 of the file <code>post-commit</code> to your script. If it&#8217;s not a Shell script you&#8217;ll have to figure out a way to call <code>commit-report.sh</code> with the correct parameters in your language</li>
</ol>
<p>You can always test <code>commit-report.sh</code> by invoking it manually.</p>
<h3>Troubleshooting</h3>
<p><strong>Update:</strong> Pointers for troubleshooting have been added later, based on your feedback&#8230;</p>
<ul>
<li>If the script runs without any errors on the console, but you never receive a commit report, change line #2 of <code>commit-report.sh</code>: put something like <code>FROMADDRESS="youremail@yourdomain"</code> in here</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2012/01/subversion-post-commit-hook-e-mail-report-script-that-sends-the-diff-as-an-attachment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Webduino now with support for HTTP Basic access authentication</title>
		<link>http://ten-fingers-and-a-brain.com/2012/01/webduino-now-with-support-for-http-basic-access-authentication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=webduino-now-with-support-for-http-basic-access-authentication</link>
		<comments>http://ten-fingers-and-a-brain.com/2012/01/webduino-now-with-support-for-http-basic-access-authentication/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 15:55:19 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[Webduino]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[authentication]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=337</guid>
		<description><![CDATA[Webduino, the web server library for Arduino, now supports HTTP Basic access authentication. You can download a .zip file of the latest version from GitHub. (Note: The download link does not point to a specific version, but always to the very latest version of Webduino including features and/or bugs that were added/fixed after I wrote [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2012/01/webduino-now-with-support-for-http-basic-access-authentication/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Webduino now with support for HTTP Basic access authentication" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2012/01/webduino-now-with-support-for-http-basic-access-authentication/">Webduino, the web server library for Arduino, now supports HTTP Basic access authentication. You can download a .zip file of the latest version from GitHub. (Note: The download link does not point to a specific version, but always to the very latest version of Webduino including features and/or bugs that were added/fixed after I wrote this post. Here's the front page of the GitHub repository.) Authentication means that you can now protect the web-enabled functions of your Arduino with a username and password. There is at least one other version of Webduino supporting authentication, written by Claudio Baldazzi. It's in this post on the original Google Project site of Webduino, with an example here. When I started working on improvements of the Webduino, plus new features for my own use, I considered using Claudio's version but decided against it for the following reason: With the Claudio's version all pages of the Arduino would be protected by the same username and password. However...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2012%2F01%2Fwebduino-now-with-support-for-http-basic-access-authentication%2F&amp;via=10fnab&amp;text=Webduino%20now%20with%20support%20for%20HTTP%20Basic%20access%20authentication&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2012/01/webduino-now-with-support-for-http-basic-access-authentication/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p><a href="http://ten-fingers-and-a-brain.com/arduino-projects/webduino/">Webduino</a>, the web server library for Arduino, now supports <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">HTTP Basic access authentication</a>. You can <a href="https://github.com/sirleech/Webduino/zipball/master">download a .zip file of the latest version from GitHub</a>. (Note: The download link does not point to a specific version, but always to the very latest version of Webduino including features and/or bugs that were added/fixed after I wrote this post. <a href="https://github.com/sirleech/Webduino">Here&#8217;s the front page of the GitHub repository</a>.)</p>
<p>Authentication means that you can now protect the web-enabled functions of your Arduino with a username and password.</p>
<p>There is at least one other version of Webduino supporting authentication, written by Claudio Baldazzi. It&#8217;s in <a title="Webduino Basic Authentication" href="http://code.google.com/p/webduino/issues/detail?id=6">this post on the original Google Project site of Webduino</a>, with an <a title="Webduino Basic Authentication Sample" href="http://code.google.com/p/webduino/issues/detail?id=7">example here</a>. When I started working on improvements of the Webduino, plus new features for my own use, I considered using Claudio&#8217;s version but decided against it for the following reason:</p>
<p>With the Claudio&#8217;s version all pages of the Arduino would be protected by the same username and password. However I wanted a way to distinguish different user levels. E.g. Person A should be allowed to see on the web whether the lights are on or off, but only Person B is allowed to flick the switch.</p>
<p>Here&#8217;s how I did it.</p>
<p>The WebServer class now has two new methods: <a href="http://ten-fingers-and-a-brain.com/arduino-projects/webduino/httpunauthorized/">httpUnauthorized()</a> sends error 401 back to the client, which in the case of a regular web browser causes the user to see a prompt for username and password. <a href="http://ten-fingers-and-a-brain.com/arduino-projects/webduino/checkcredentials/">checkCredentials()</a> checks whether a username and password have been sent with the request and whether they are valid, i.e. they have certain values. In a Webduino command function you should first run checkCredentials() and depending on the return value either run your &#8220;protected&#8221; code, like turning on the lights, or fire httpUnauthorized(). See the methods&#8217; subpages of the <a title="Webduino API documentation" href="http://ten-fingers-and-a-brain.com/arduino-projects/webduino/#doc">API documentation</a> for example code.</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2012/01/webduino-now-with-support-for-http-basic-access-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Webduino, a Web Server Library for the Arduino Platform, and on favicon.ico</title>
		<link>http://ten-fingers-and-a-brain.com/2011/12/on-webduino-and-on-favicon-ico/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=on-webduino-and-on-favicon-ico</link>
		<comments>http://ten-fingers-and-a-brain.com/2011/12/on-webduino-and-on-favicon-ico/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 01:57:23 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Webduino]]></category>
		<category><![CDATA[favicon.ico]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=284</guid>
		<description><![CDATA[As reported earlier I had been given an Arduino Uno. I subsequently received my Ethernet Shield to hook the board up to the network. I'm clearly heading towards the Internet of things... Although I am still not 100% certain about what I'm going to do with the board (or how many additional ones I am [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2011/12/on-webduino-and-on-favicon-ico/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="On Webduino, a Web Server Library for the Arduino Platform, and on favicon.ico" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2011/12/on-webduino-and-on-favicon-ico/">As reported earlier I had been given an Arduino Uno. I subsequently received my Ethernet Shield to hook the board up to the network. I'm clearly heading towards the Internet of things... Although I am still not 100% certain about what I'm going to do with the board (or how many additional ones I am going to have to buy) one things is pretty clear: It will have to be controllable and/or configurable over a web interface. I found the Webserver example that ships with the Arduino IDE to be rather dull and unflexible. It wasn't long before I stumbled upon Webduino, a very flexible generic Web Server library originally written by Ben Combee. The Webduino project homepage on Google Project Hosting points to this GitHub page. I downloaded the version adapted to Arduino 1.0 and started hacking away. Let me say this now: Webduino does meet my expectations. However after a short while I ran into problems. None of them were to blame on the library, but rather on myself, but that's actually not...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2011%2F12%2Fon-webduino-and-on-favicon-ico%2F&amp;via=10fnab&amp;text=On%20Webduino%2C%20a%20Web%20Server%20Library%20for%20the%20Arduino%20Platform%2C%20and%20on%20favicon.ico&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2011/12/on-webduino-and-on-favicon-ico/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p><a href="http://ten-fingers-and-a-brain.com/2011/12/kosmos-electronic-x3000-meets-arduino-uno/">As reported earlier</a> I had been given an <a href="http://arduino.cc/en/Main/ArduinoBoardUno">Arduino Uno</a>. I subsequently received my <a href="http://arduino.cc/en/Main/ArduinoEthernetShield">Ethernet Shield</a> to hook the board up to the network. I&#8217;m clearly heading towards the Internet of things&#8230; Although I am still not 100% certain about what I&#8217;m going to do with the board (or how many additional ones I am going to have to buy) one things is pretty clear: It will have to be controllable and/or configurable over a web interface.</p>
<p>I found the Webserver example that ships with the <a href="http://arduino.cc/en/Main/Software">Arduino IDE</a> to be rather dull and unflexible. It wasn&#8217;t long before I stumbled upon Webduino, a very flexible generic Web Server library originally written by <a href="http://unwiredben.livejournal.com/290704.html">Ben Combee</a>. The <a href="http://code.google.com/p/webduino/">Webduino project homepage on Google Project Hosting</a> points to <a title="Webduino fork by Chris Lee on GitHub" href="https://github.com/sirleech/Webduino">this GitHub page</a>. I downloaded the version adapted to Arduino 1.0 and started hacking away. Let me say this now: Webduino does meet my expectations.</p>
<p>However after a short while I ran into problems. None of them were to blame on the library, but rather on myself, but that&#8217;s actually not the point of this post&#8230; When I ran <a href="http://www.wireshark.org/">Wireshark</a> to look at the data going over the network I noticed that for every page loaded Firefox also tries to download <a href="http://en.wikipedia.org/wiki/Favicon">favicon.ico</a> from the web server. Since Webduino sends a 400 error back on any requests for resources that have not been defined Firefox just keeps retrying forever.</p>
<p>At around the same time I discovered that, to avoid excess traffic from robots, there is a default <a href="http://en.wikipedia.org/wiki/Robots_exclusion_standard">robots.txt</a> built into Webduino. So I decided to add a default favicon.ico, based on the icon used in the &#8220;Web_Image&#8221; example that ships with Webduino. Now when the first page is requested, Firefox loads the icon file, which actually eats more resources than <em>one</em> 400 error, but it pays off down the road when Firefox caches the icon and does not request it again, saving the Arduino from having to generate many 400 errors&#8230;</p>
<div id="attachment_286" class="wp-caption alignnone" style="width: 310px"><a href="https://github.com/tfnab/Webduino"><img class="size-full wp-image-286" title="Webduino &quot;Hello World!&quot; page with favicon.ico" src="http://ten-fingers-and-a-brain.com/wp-content/uploads/2011/12/Webduino_HelloWorld_favicon.png" alt="Webduino &quot;Hello World!&quot; page with favicon.ico" width="300" height="112" /></a><p class="wp-caption-text">Webduino &quot;Hello World!&quot; page with favicon.ico; this is the default favicon.ico in my version of Webduino</p></div>
<p>And since I see projects hosted on GitHub as an open invitation to fork I ended up with <a href="https://github.com/tfnab/Webduino">my own Webduino project on GitHub</a>. Feel free to look at the code, to fork, clone, whatever (MIT license), and to let me know what you think! (Oh, and I gave the readme some TLC and also added a keywords.txt file for syntax highlighting.)</p>
<p><strong>Update:</strong> I started to write <a href="http://ten-fingers-and-a-brain.com/arduino-projects/webduino/">a &#8220;beautiful&#8221; API documentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2011/12/on-webduino-and-on-favicon-ico/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Kosmos electronic X3000 meets Arduino Uno</title>
		<link>http://ten-fingers-and-a-brain.com/2011/12/kosmos-electronic-x3000-meets-arduino-uno/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=kosmos-electronic-x3000-meets-arduino-uno</link>
		<comments>http://ten-fingers-and-a-brain.com/2011/12/kosmos-electronic-x3000-meets-arduino-uno/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 21:15:51 +0000</pubDate>
		<dc:creator>Martin Lormes</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[geeky]]></category>

		<guid isPermaLink="false">http://ten-fingers-and-a-brain.com/?p=277</guid>
		<description><![CDATA[I found an Arduino Uno under the X-mas tree: I'm still waiting for my Ethernet Shield to ship. In the meantime I wanted to get started with some of the "simple" stuff like controlling single LEDs, triggering events using pushbuttons etc. It came in handy I still had my 1980's "Kosmos electronic X3000" workshop kit [...]]]></description>
				<content:encoded><![CDATA[<div><div style="float: left; margin: 0 0px 5px 0;"><g:plusone size="medium" href="http://ten-fingers-and-a-brain.com/2011/12/kosmos-electronic-x3000-meets-arduino-uno/"></g:plusone></div><div style="float: left; margin: 0 30px 5px 0;"><a class="FlattrButton" style="display:none;" title="Kosmos electronic X3000 meets Arduino Uno" rev="flattr;uid:tfnab;category:text;language:en_GB;button:compact;" href="http://ten-fingers-and-a-brain.com/2011/12/kosmos-electronic-x3000-meets-arduino-uno/">I found an Arduino Uno under the X-mas tree: I'm still waiting for my Ethernet Shield to ship. In the meantime I wanted to get started with some of the "simple" stuff like controlling single LEDs, triggering events using pushbuttons etc. It came in handy I still had my 1980's "Kosmos electronic X3000" workshop kit around, which I used to experiment with when I was a teenage nerd: I guess I'm still a nerd: My heart jumped a bit when I found out they seem to still sell these things. Here's what they look like in combination: You and I know that talking about new ideas prematurely is the best way to kill them. Anyhow you should expect some Arduino related posts over the next year or so...</a></div><div style="float: left; margin: 0 15px 5px 0;"><a style="display:none;" href="http://twitter.com/share?url=http%3A%2F%2Ften-fingers-and-a-brain.com%2F2011%2F12%2Fkosmos-electronic-x3000-meets-arduino-uno%2F&amp;via=10fnab&amp;text=Kosmos%20electronic%20X3000%20meets%20Arduino%20Uno&amp;count=horizontal" class="twitter-share-button">Tweet</a></div><div style="float: left; margin: 0 0px 5px 0;"><fb:like href="http://ten-fingers-and-a-brain.com/2011/12/kosmos-electronic-x3000-meets-arduino-uno/" layout="button_count"></fb:like></div></div><div style="clear: both;"></div><p>I found an <a href="http://www.amazon.com/dp/B004CG4CN4?tag=tenfingeandab-20" title="You can buy Arduino Uno at Amazon.com">Arduino Uno</a> under the X-mas tree:</p>
<p><img src="http://ten-fingers-and-a-brain.com/wp-content/uploads/2011/12/IMG00024-20111228-0243-300x225.jpg" alt="Arduino Uno" title="Arduino Uno" width="300" height="225" class="alignnone size-medium wp-image-278" /></p>
<p>I&#8217;m still waiting for my <a href="http://arduino.cc/en/Main/ArduinoEthernetShield">Ethernet Shield</a> to ship. In the meantime I wanted to get started with some of the &#8220;simple&#8221; stuff like controlling single LEDs, triggering events using pushbuttons etc. It came in handy I still had my 1980&#8242;s &#8220;Kosmos electronic X3000&#8243; workshop kit around, which I used to experiment with when I was a teenage nerd:</p>
<p><img src="http://ten-fingers-and-a-brain.com/wp-content/uploads/2011/12/IMG00029-20111228-2141-300x225.jpg" alt="Kosmos electronic X3000 workshop" title="Kosmos electronic X3000 workshop" width="300" height="225" class="alignnone size-medium wp-image-280" /></p>
<p>I guess I&#8217;m still a nerd: My heart jumped a bit when I found out <a href="http://www.amazon.com/dp/B001ALNDUM?tag=tenfingeandab-20" title="Thames &#038; Kosmos Technology and Electronics Electronics Workshop on Amazon.com">they seem to still sell these things</a>.</p>
<p>Here&#8217;s what they look like in combination:</p>
<p><img src="http://ten-fingers-and-a-brain.com/wp-content/uploads/2011/12/IMG00027-20111228-2140-300x225.jpg" alt="Arduino Uno with Kosmos &quot;breadboard&quot;" title="Arduino Uno with Kosmos &quot;breadboard&quot;" width="300" height="225" class="alignnone size-medium wp-image-279" /></p>
<p>You and I know that talking about new ideas prematurely is the best way to kill them. Anyhow you should expect some <a href="http://arduino.cc/en/">Arduino</a> related posts over the next year or so&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ten-fingers-and-a-brain.com/2011/12/kosmos-electronic-x3000-meets-arduino-uno/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
