<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Hwarf Nugen</title>
	
	<link>http://hwarf.com</link>
	<description>﻿Random</description>
	<lastBuildDate>Thu, 25 Aug 2011 18:06:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/hwarf" /><feedburner:info uri="hwarf" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Configure PhpStorm to Auto-complete CakePHP Models, Views, and Controllers</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/poNFWMToWwA/</link>
		<comments>http://hwarf.com/blog/2011/08/24/configure-phpstorm-to-auto-complete-cakephp-models-and-controllers/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 02:47:10 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Technology / Computing]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=296</guid>
		<description><![CDATA[After playing around a bit today I finally figured out how to get PhpStorm to auto-complete methods for models and controllers. Here&#8217;s what you need to do. &#160; Removing Multiple Definitions First, let&#8217;s tackle the multiple definitions problem that we see below. &#160; There are multiple places defining AppController. We need to remove the ones [...]]]></description>
			<content:encoded><![CDATA[<p>After playing around a bit today I finally figured out how to get PhpStorm to auto-complete methods for models and controllers. Here&#8217;s what you need to do.</p>
<p>&nbsp;</p>
<h3>Removing Multiple Definitions</h3>
<p>First, let&#8217;s tackle the multiple definitions problem that we see below.</p>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/multiple_definitions1.png" rel="1" class="thickbox no_icon" title="Multiple Definitions Exist"><img class="size-medium wp-image-297 aligncenter" title="Multiple Definitions Exist" src="http://hwarf.com/wp-content/uploads/2011/08/multiple_definitions1-300x80.png" alt="Multiple Definitions Exist" width="300" height="80" /></a></p>
<p>&nbsp;</p>
<p>There are multiple places defining AppController. We need to remove the ones that are included in the following locations from our &#8216;Directories&#8217; in the project&#8217;s settings.</p>
<p>The two locations are:</p>
<ul>
<li>$CAKEHOME/cake/console</li>
<li>$CAKEHOME/cake/tests</li>
</ul>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.07.17-PM.png" rel="2" class="thickbox no_icon" title="Exclude Directories"><img class="size-medium wp-image-304 aligncenter" title="Exclude Directories" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.07.17-PM-300x126.png" alt="Exclude Directories" width="300" height="126" /></a></p>
<p>Next we need to mark the following file as plain text.</p>
<ul>
<li>$CAKEHOME/cake/libs/controllers/app_controller.php</li>
</ul>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/multiple_definitions2.png" rel="3" class="thickbox no_icon" title="Mark as Plain Text"><img class="size-medium wp-image-301 aligncenter" title="Mark as Plain Text" src="http://hwarf.com/wp-content/uploads/2011/08/multiple_definitions2-268x300.png" alt="Mark as Plain Text" width="268" height="300" /></a></p>
<p>You should now see that PhpStorm is no longer complaining about multiple definitions. If it is you may want to check your plugins/components to see if they&#8217;re mucking it up. If they are, just mark the file with the definition as plain text.</p>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.18.36-PM.png" rel="4" class="thickbox no_icon" title="Multiple Definitions Resolved"><img class="size-medium wp-image-305 aligncenter" title="Multiple Definitions Resolved" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.18.36-PM-300x108.png" alt="Multiple Definitions Resolved" width="300" height="108" /></a></p>
<p style="text-align: left;">Auto-completion should now work for the controller. However, it&#8217;s still not working correctly on our model.</p>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.24.40-PM.jpg" rel="5" class="thickbox no_icon" title="Auto-complete works, but not on the model"><img class="aligncenter size-medium wp-image-308" title="Auto-complete works, but not on the model" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.24.40-PM-300x67.jpg" alt="Auto-complete works, but not on the model" width="300" height="67" /></a></p>
<h3 style="text-align: left;">Adding the Model</h3>
<p style="text-align: left;">To fix the model we need to add a magic property to the class.</p>
<p style="text-align: left;">

<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009933; font-style: italic;">/**<br />
&nbsp;*@property ModelName $ModelName<br />
&nbsp;*/</span></div></div>

</p>
<p style="text-align: left;">Here&#8217;s an example from the controller we&#8217;ve been working in.</p>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.31.34-PM.png" rel="6" class="thickbox no_icon" title="@property ModelName $ModelName"><img class="aligncenter size-medium wp-image-311" title="@property ModelName $ModelName" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.31.34-PM-300x140.png" alt="@property ModelName $ModelName" width="300" height="140" /></a></p>
<p> We can now auto-complete on our models in the controller.</p>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.32.56-PM.png" rel="7" class="thickbox no_icon" title="Auto-complete works on the model"><img class="aligncenter size-medium wp-image-312" title="Auto-complete works on the model" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.32.56-PM-300x85.png" alt="Auto-complete works on the model" width="300" height="85" /></a></p>
<h3>Defining Model Relationships</h3>
<p>Lastly, we need to add magic properties to our models to define its relationships with other models. Basically, for each &#8220;belongs to&#8221; relationship defined in the model&#8217;s file you need to add the magic property comment.</p>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.38.33-PM.png" rel="8" class="thickbox no_icon" title="Define belongs to relationships"><img class="aligncenter size-full wp-image-314" title="Define belongs to relationships" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.38.33-PM.png" alt="Define belongs to relationships" width="281" height="208" /></a></p>
<p>We can now auto-complete these relationships.</p>
<p style="text-align: center;"><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.40.03-PM.png" rel="9" class="thickbox no_icon" title="Auto-complete model relationships"><img class="aligncenter size-medium wp-image-315" title="Auto-complete model relationships" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-24-at-10.40.03-PM-300x147.png" alt="Auto-complete model relationships" width="300" height="147" /></a></p>
<h3>Setting Up Helper Auto-completion in Views</h3>
<p>To get auto-completion working in views we need to include a file created by <a  href="https://gist.github.com/junichi11" onclick="pageTracker._trackPageview('/outgoing/gist.github.com/junichi11?referer=');">junichi11</a> over at GitHub.</p>
<p>Download this file and save it in a directory somewhere outside of your current project. I did this so I could use the same file on multiple projects.</p>
<ul>
<li><a  href="https://gist.github.com/934219" onclick="pageTracker._trackPageview('/outgoing/gist.github.com/934219?referer=');">CakePHP Helper Code Completion</a></li>
</ul>
<p>Now add that directory to your current project.</p>
<p>Open a view file and add the following variable definition.</p>
<p>

<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009933; font-style: italic;">/**<br />
&nbsp;*@var $this View<br />
&nbsp;*/</span></div></div>

</p>
<p>You should now be able to auto-complete helpers in your view!</p>
<p><a  href="http://hwarf.com/wp-content/uploads/2011/08/Screen-shot-2011-08-25-at-1.23.03-PM.png" class="thickbox no_icon" rel="gallery-296" title="Auto-completion of Helpers"><img class="aligncenter size-medium wp-image-337" title="Auto-completion of Helpers" src="http://hwarf.com/wp-content/uploads/2011/08/Screen-shot-2011-08-25-at-1.23.03-PM-300x197.png" alt="Auto-completion of Helpers" width="300" height="197" /></a></p>
<h3>Core Component Auto-Completion</h3>
<p>Add the following to your app_controller.php file and this will add component auto-completion.</p>
<p>

<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009933; font-style: italic;">/**<br />
 * CakePHP Component &amp;amp; Model Code Completion<br />
 * @author junichi11<br />
 *<br />
 * ==============================================<br />
 * CakePHP Core Components<br />
 * ==============================================<br />
 * @property AuthComponent $Auth<br />
 * @property AclComponent $Acl<br />
 * @property CookieComponent $Cookie<br />
 * @property EmailComponent $Email<br />
 * @property RequestHandlerComponent $RequestHandler<br />
 * @property SecurityComponent $Security<br />
 * @property SessionComponent $Session<br />
 */</span></div></div>

</p>]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2011/08/24/configure-phpstorm-to-auto-complete-cakephp-models-and-controllers/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2011/08/24/configure-phpstorm-to-auto-complete-cakephp-models-and-controllers/</feedburner:origLink></item>
		<item>
		<title>SABnzbd URL Bookmarklet (NZBMatrix)</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/X62jAGrYnso/</link>
		<comments>http://hwarf.com/blog/2010/04/21/sabnzbd-bookmarklet-nzbmatrix/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 01:45:01 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Technology / Computing]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=256</guid>
		<description><![CDATA[Here&#8217;s a simple bookmarklet that will take the URL of the current page you&#8217;re on and tell SABnzbd to download it. It works great if you&#8217;re using NZBMatrix and on the page for the post you&#8217;re wanting to download. Perfect for your mobile browser. javascript:location.href='http://yourhost:8080/api?mode=addurl&#38;name='+encodeURIComponent&#40;location.href&#41;+'&#38;apikey=yourapikey'; Be sure to insert your SABnzbd API key and hostname [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple bookmarklet that will take the URL of the current page you&#8217;re on and tell SABnzbd to download it. It works great if you&#8217;re using NZBMatrix and on the page for the post you&#8217;re wanting to download. Perfect for your mobile browser.</p>

<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">javascript<span style="color: #339933;">:</span>location.<span style="color: #660066;">href</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'http://yourhost:8080/api?mode=addurl&amp;name='</span><span style="color: #339933;">+</span>encodeURIComponent<span style="color: #009900;">&#40;</span>location.<span style="color: #660066;">href</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'&amp;apikey=yourapikey'</span><span style="color: #339933;">;</span></div></div>

<p>Be sure to insert your SABnzbd API key and hostname (or IP address) into the bookmarklet&#8217;s code.</p>
]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2010/04/21/sabnzbd-bookmarklet-nzbmatrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2010/04/21/sabnzbd-bookmarklet-nzbmatrix/</feedburner:origLink></item>
		<item>
		<title>Perl Find and Replace One Liner</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/5fOltlJkXeE/</link>
		<comments>http://hwarf.com/blog/2010/01/20/perl-find-and-replace-one-liner/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 01:37:18 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=253</guid>
		<description><![CDATA[I&#8217;m constantly needing a way to easily change a line in a bunch of configuration files. I thought I&#8217;d share the way I do it here. perl -p -i -e 's/oldstring/newstring/g' * This allows you to use a regular expression and perform the find and replace.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m constantly needing a way to easily change a line in a bunch of configuration files. I thought I&#8217;d share the way I do it here.</p>

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/oldstring/newstring/g'</span> <span style="color: #000000; font-weight: bold;">*</span></div></div>

<p>This allows you to use a regular expression and perform the find and replace.</p>]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2010/01/20/perl-find-and-replace-one-liner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2010/01/20/perl-find-and-replace-one-liner/</feedburner:origLink></item>
		<item>
		<title>Lake Michigan Motorcycle Trip Pictures</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/QlzRRYItzLo/</link>
		<comments>http://hwarf.com/blog/2009/08/06/lake-michigan-pictures/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 02:21:58 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=204</guid>
		<description><![CDATA[Here&#8217;s the few shots that were taken while Dad and I were out touring Lake Michigan. [flickr-gallery mode="photoset" photoset="72157622634235926"]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the few shots that were taken while Dad and I were out touring Lake Michigan.</p>

[flickr-gallery mode="photoset" photoset="72157622634235926"]<br />]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2009/08/06/lake-michigan-pictures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2009/08/06/lake-michigan-pictures/</feedburner:origLink></item>
		<item>
		<title>Cleveland Metroparks Zoo – PACE Summer Picnic</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/EaK42Eh4BJ4/</link>
		<comments>http://hwarf.com/blog/2009/07/18/cleveland-zoo-2009/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 01:16:28 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=219</guid>
		<description><![CDATA[[flickr-gallery mode="photoset" photoset="72157622509806403"]]]></description>
			<content:encoded><![CDATA[[flickr-gallery mode="photoset" photoset="72157622509806403"]<br />]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2009/07/18/cleveland-zoo-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2009/07/18/cleveland-zoo-2009/</feedburner:origLink></item>
		<item>
		<title>BlackBerry WordPress</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/lBGF9stc8to/</link>
		<comments>http://hwarf.com/blog/2009/07/16/blackberry-wordpress/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 02:34:48 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hwarf.com/2009/07/16/blackberry-wordpress/</guid>
		<description><![CDATA[This was posted via the new WordPress Blackberry application. Be sure to check it out. WordPress.org]]></description>
			<content:encoded><![CDATA[This was posted via the new WordPress Blackberry application. Be sure to check it out. <a  href="http://blackberry.wordpress.org" alt="Wordpress.org" onclick="pageTracker._trackPageview('/outgoing/blackberry.wordpress.org?referer=');">WordPress.org</a>]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2009/07/16/blackberry-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2009/07/16/blackberry-wordpress/</feedburner:origLink></item>
		<item>
		<title>HOWTO: Set the SSHD Idle Timeout</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/BKnA5R_df4c/</link>
		<comments>http://hwarf.com/blog/2009/06/24/sshd-idle-timeout/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 14:03:37 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Technology / Computing]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=196</guid>
		<description><![CDATA[Here&#8217;s something that I usually forget to change from the default and then get annoyed when my terminal hangs. As root open your sshd_config file in an editor. su - vim /etc/ssh/sshd_config Add the following lines. ClientAliveInterval 600 ClientAliveCountMax 3 Restart the sshd process. service sshd restart That&#8217;s it. That will keep you logged in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something that I usually forget to change from the default and then get annoyed when my terminal hangs.</p>

<ol>
	<li>As root open your sshd_config file in an editor.

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">su</span> -<br />
<span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>sshd_config</div></div>

</li>
	<li>Add the following lines.

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ClientAliveInterval <span style="color: #000000;">600</span><br />
ClientAliveCountMax <span style="color: #000000;">3</span></div></div>

</li>
	<li>Restart the sshd process.

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">service sshd restart</div></div>

</li>
</ol>

<p>That&#8217;s it. That will keep you logged in for 30 minutes at a time without activity. (600 seconds x 3)</p>]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2009/06/24/sshd-idle-timeout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2009/06/24/sshd-idle-timeout/</feedburner:origLink></item>
		<item>
		<title>Motorcycle Trip 2009 – Lake Michigan</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/IyL9cj6fhUc/</link>
		<comments>http://hwarf.com/blog/2009/06/15/motorcycle-trip-2009-lake-michigan/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 23:55:07 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=192</guid>
		<description><![CDATA[Below is the initial route for Dad and I&#8217;s motorcycle trip for 2009. We&#8217;re going to be traveling July 25th &#8211; July 30th. The only set in stone destination is Oshkosh, WI for Airventure. View Larger Map]]></description>
			<content:encoded><![CDATA[<p>Below is the initial route for Dad and I&#8217;s motorcycle trip for 2009. We&#8217;re going to be traveling July 25th &#8211; July 30th. The only set in stone destination is Oshkosh, WI for <a  href="http://www.airventure.org/" onclick="pageTracker._trackPageview('/outgoing/www.airventure.org/?referer=');">Airventure</a>.</p>

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=d&amp;source=s_d&amp;saddr=elyria,+oh&amp;daddr=ludington,+mi+to:44.645208,-86.099854+to:Lake+Michigan+Scenic+Hwy%2FUS-2+to:oshkosh,+wi+to:ludington,+mi+to:elyria,+oh&amp;geocode=%3B%3B%3BFZxWvwId-NLp-g%3B%3B%3B&amp;hl=en&amp;mra=dpe&amp;mrcr=1&amp;mrsp=2&amp;sz=7&amp;via=2,3&amp;sll=43.715535,-85.308838&amp;sspn=5.27246,12.282715&amp;ie=UTF8&amp;ll=43.604262,-84.012451&amp;spn=5.695864,12.293701&amp;output=embed"></iframe><br /><small><a  href="http://maps.google.com/maps?f=d&#038;source=embed&#038;saddr=elyria,+oh&#038;daddr=ludington,+mi+to:44.645208,-86.099854+to:Lake+Michigan+Scenic+Hwy%2FUS-2+to:oshkosh,+wi+to:ludington,+mi+to:elyria,+oh&#038;geocode=%3B%3B%3BFZxWvwId-NLp-g%3B%3B%3B&#038;hl=en&#038;mra=dpe&#038;mrcr=1&#038;mrsp=2&#038;sz=7&#038;via=2,3&#038;sll=43.715535,-85.308838&#038;sspn=5.27246,12.282715&#038;ie=UTF8&#038;ll=43.604262,-84.012451&#038;spn=5.695864,12.293701" style="color:#0000FF;text-align:left" onclick="pageTracker._trackPageview('/outgoing/maps.google.com/maps?f=d_038_source=embed_038_saddr=elyria_+oh_038_daddr=ludington_+mi+to_44.645208_-86.099854+to_Lake+Michigan+Scenic+Hwy_2FUS-2+to_oshkosh_+wi+to_ludington_+mi+to_elyria_+oh_038_geocode=_3B_3B_3BFZxWvwId-NLp-g_3B_3B_3B_038_hl=en_038_mra=dpe_038_mrcr=1_038_mrsp=2_038_sz=7_038_via=2_3_038_sll=43.715535_-85.308838_038_sspn=5.27246_12.282715_038_ie=UTF8_038_ll=43.604262_-84.012451_038_spn=5.695864_12.293701&amp;referer=');">View Larger Map</a></small>]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2009/06/15/motorcycle-trip-2009-lake-michigan/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2009/06/15/motorcycle-trip-2009-lake-michigan/</feedburner:origLink></item>
		<item>
		<title>M3U Playlist Copy Script</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/qhoThyw-hl4/</link>
		<comments>http://hwarf.com/blog/2009/04/04/m3u-playlist-copy-script/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 19:58:00 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[Technology / Computing]]></category>
		<category><![CDATA[mp3 m3u music]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=180</guid>
		<description><![CDATA[A couple of months ago I picked up a Garmin Nuvi 760 on the cheap. As it turns out this great GPS unit can also play music quite well, especially for riding on the motorcycle. The only problem was there was no good way to get playlists on the device that I could find. Enter [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago I picked up a Garmin Nuvi 760 on the cheap. As it turns out this great GPS unit can also play music quite well, especially for riding on the motorcycle. The only problem was there was no good way to get playlists on the device that I could find. Enter the following bash script. This script will read an m3u file, copy all associated mp3 files, and generate a new m3u file. Now all I have to do is specifiy m3u files that I exported from <a  href="http://www.getsongbird.com/" onclick="pageTracker._trackPageview('/outgoing/www.getsongbird.com/?referer=');">Mozilla Songbird</a> and the path to the Garmin&#8217;s SD card.</p>

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #666666; font-style: italic;"># April 4, 2009</span><br />
<span style="color: #666666; font-style: italic;"># m3u_cp.sh</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Take an m3u file and copy all associated mp3 files</span><br />
<span style="color: #666666; font-style: italic;"># to a destination directory and generate a new m3u.</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Used to copy m3u playlists from computer to Garmin.</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-lt</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: m3u_cp.sh some.m3u /dst&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Read the m3u file into an array</span><br />
<span style="color: #7a0874; font-weight: bold;">declare</span> <span style="color: #660033;">-a</span> M3U<br />
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #ff0000;">&quot;$1&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span><br />
<br />
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> LINE <span style="color: #000000; font-weight: bold;">&lt;&amp;</span><span style="color: #000000;">10</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; M3U<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$count</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #007800;">$LINE</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>count++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span>-<br />
<br />
<span style="color: #666666; font-style: italic;"># Determine the m3u's filename</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> =~ <span style="color: #7a0874; font-weight: bold;">&#91;</span>^<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>m3u <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #007800;">m3u_path</span>=<span style="color: #ff0000;">&quot;$2/<span style="color: #007800;">$BASH_REMATCH</span>&quot;</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #666666; font-style: italic;"># If playlist arleady exists, delete it</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$m3u_path</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$m3u_path</span>&quot;</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Loop through the m3u lines</span><br />
<span style="color: #007800;">i</span>=<span style="color: #000000;">0</span><br />
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-lt</span> <span style="color: #800000;">${#M3U[@]}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># The current line is a comment, do nothing with it</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #800000;">${M3U[$i]:0:1}</span> = <span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${M3U[$i]}</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$m3u_path</span>&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#Current line is a path to an mp3 file</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># Get the current songs filename</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #800000;">${M3U[$i]}</span> =~ <span style="color: #7a0874; font-weight: bold;">&#91;</span>^<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>mp3 <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">song</span>=<span style="color: #007800;">$BASH_REMATCH</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">mpath</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${M3U[$i]}</span> <span style="color: #000000; font-weight: bold;">|</span> &nbsp;<span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">'\r'</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># if the song doesn't exist, copy it to the desitnation folder</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;$2/<span style="color: #007800;">$song</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> File Exists <span style="color: #660033;">--</span> <span style="color: #007800;">$song</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> Copying <span style="color: #660033;">--</span> <span style="color: #007800;">$song</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$mpath</span>&quot;</span> <span style="color: #ff0000;">&quot;$2/<span style="color: #007800;">$song</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># Write the song in the m3u file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$song</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$m3u_path</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The regex for finding the song's filename is fraked up.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">i</span>=i+<span style="color: #000000;">1</span><br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></div></div>

<p>In the middle of writing this I really started wondering why I used bash. Perl would&#8217;ve been a lot easier.</p>]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2009/04/04/m3u-playlist-copy-script/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2009/04/04/m3u-playlist-copy-script/</feedburner:origLink></item>
		<item>
		<title>SVN+SSH Howto: Subversion Quick and Simple</title>
		<link>http://feedproxy.google.com/~r/hwarf/~3/wDaU8zKEZVI/</link>
		<comments>http://hwarf.com/blog/2009/03/11/svnssh/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 13:57:36 +0000</pubDate>
		<dc:creator>Joshua Glemza</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://hwarf.com/?p=171</guid>
		<description><![CDATA[Here&#8217;s a quick and simple way to create a Subversion repository while maintaining security by using SSH and the filesystem permissions. Create users and add them to a group. There are a bunch of different ways to do this. I am only showing you how to create a group. groupadd svn-users Make a directory to [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick and simple way to create a Subversion repository while maintaining security by using SSH and the filesystem permissions.</p>
<ol>
	<li>Create users and add them to a group. There are a bunch of different ways to do this. I am only showing you how to create a group.

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd svn-users</div></div>

</li>
	<li>Make a directory to house the repository.

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>project</div></div>

</li>
	<li>Create the repository.

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>project</div></div>

</li>
	<li>Change permissions to allow the group read/write access.

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>project<br />
<span style="color: #c20cb9; font-weight: bold;">chgrp</span> svn-users db db<span style="color: #000000; font-weight: bold;">/</span>transactions db<span style="color: #000000; font-weight: bold;">/</span>write-lock db<span style="color: #000000; font-weight: bold;">/</span>revs db<span style="color: #000000; font-weight: bold;">/</span>revprops hooks locks<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">2770</span> db db<span style="color: #000000; font-weight: bold;">/</span>transactions db<span style="color: #000000; font-weight: bold;">/</span>revs db<span style="color: #000000; font-weight: bold;">/</span>revprops<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">660</span> db<span style="color: #000000; font-weight: bold;">/</span>write-lock<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">750</span> hooks<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">770</span> locks</div></div>

</li>
</ol>

<p>You can now have your users access the repository over SSH.</p>

<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svn</span>+ssh:<span style="color: #000000; font-weight: bold;">//</span>username<span style="color: #000000; font-weight: bold;">@</span>server.example.com<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>project</div></div>

<p>If your clients are on Windows, I recommend using <a  href="http://tortoisesvn.tigris.org/" onclick="pageTracker._trackPageview('/outgoing/tortoisesvn.tigris.org/?referer=');">TortoiseSVN</a>.<p>
<p>Credit goes to the <a  href="http://reallylongword.org/svn/" onclick="pageTracker._trackPageview('/outgoing/reallylongword.org/svn/?referer=');">Carnival of Technology</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://hwarf.com/blog/2009/03/11/svnssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://hwarf.com/blog/2009/03/11/svnssh/</feedburner:origLink></item>
	</channel>
</rss>

