<?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>nerdnotes.org &#187; nerdnotes</title>
	<atom:link href="http://nerdnotes.org/category/nerdnotes/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdnotes.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 17 Dec 2010 22:55:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Limit bandwidth needed for system updates</title>
		<link>http://nerdnotes.org/2010/12/limit-bandwidth-needed-for-system-updates/</link>
		<comments>http://nerdnotes.org/2010/12/limit-bandwidth-needed-for-system-updates/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 22:52:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/?p=148</guid>
		<description><![CDATA[Watching movies online and updating my Ubuntu laptop at the same time doesn&#8217;t go well together with my DSL internet connection. This apt configuration snippet, makes sure apt will not consume your bandwith: It should be placed in a file in /etc/apt/apt-conf.d/. For more info, consult the apt.conf man page.]]></description>
			<content:encoded><![CDATA[<p>Watching movies online and updating my Ubuntu laptop at the same time doesn&#8217;t go well together with my DSL internet connection. This apt configuration snippet, makes sure apt will not consume your bandwith:</p>
<pre class="brush: bash; title: ; notranslate">
Acquire
{
        Queue-mode &quot;access&quot;;
        http
        {
                Dl-Limit &quot;20&quot;;
        };
};
</pre>
<p>It should be placed in a file in /etc/apt/apt-conf.d/. For more info, consult the apt.conf man page.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2010/12/limit-bandwidth-needed-for-system-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cakephp logger plugin</title>
		<link>http://nerdnotes.org/2010/04/cakephp-logger-plugin/</link>
		<comments>http://nerdnotes.org/2010/04/cakephp-logger-plugin/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 09:32:19 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[tail -f]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/?p=137</guid>
		<description><![CDATA[For one of my projects, I wanted to have a live view of the cake log file in the admin page. What started out as some hacked controller methods, turned into a plugin that can be inserted in any random cake app. Ingredients: a php implementation of the unix tail command, by Paul Gregg a [...]]]></description>
			<content:encoded><![CDATA[<p>For one of my projects, I wanted to have a live view of the cake log file in the admin page. What started out  as some hacked controller methods, turned into a plugin that can be inserted in any random cake app. Ingredients:</p>
<ul>
<li>a <a href="http://www.pgregg.com/projects/php/code/tail-10.php">php implementation</a> of the unix tail command, by <a href="http://www.pgregg.com">Paul Gregg</a></li>
<li>a session variable to keep track of what part of the log file has been sent</li>
<li>some jquery code (using the <a href="http://www.360innovate.co.uk/blog/2009/03/periodicalupdater-for-jquery/">periodicalupdater</a> plugin) that adds new lines to a div element as they appear in the log file, scrolls down so the new content becomes visible</li>
</ul>
<p>The online demo consist of a <a href="http://cakephp-logger-demo.nerdnotes.org/">bare cake &#8216;install&#8217;</a> with the plugin dropped into the plugins directory. As you can see, there&#8217;s no models, views or controllers. Visiting the app will actually log some messages to the debug log. To monitor the log file, visit the <a href="http://cakephp-logger-demo.nerdnotes.org/logger/loggers/">plugin path</a>.<br />
I&#8217;ve also added two links that lets you add lines to the debug log.</p>
<p>The theoretical advantage of using a plugin is that you can simply drop the code in the plugins directory and voila! it works!<br />
 In practice, it&#8217;s quite annoying that plugins are similar to, but not exactly structured like cake apps. For example: images and js code should be placed in the vendors folder instead of webroot. Secondly: app_model.php and app_controller.php need to be prefixed by the (singular) plugin name.<br />
Finally, it&#8217;s not clear how to integrate the plugin with your actual cake app. Like using the app&#8217;s authentication methods to only allow &#8216;admin&#8217; users to view the log file.</p>
<p>I&#8217;m actually not sure a plugin is the right way of implementing an online &#8216;tail -f&#8217;. A component might do a better job. What do you think?</p>
<p> <a href="http://cakephp-logger-demo.nerdnotes.org/logger/loggers/">Online demo</a></p>
<p>The plugin can be <a href="http://nerdnotes.org/wp-content/uploads/2010/04/logger.tgz">downloaded here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2010/04/cakephp-logger-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cakeshell</title>
		<link>http://nerdnotes.org/2010/03/cakeshell/</link>
		<comments>http://nerdnotes.org/2010/03/cakeshell/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 13:04:34 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/?p=133</guid>
		<description><![CDATA[I&#8217;ve written a little wrapper script to ease the execution of cake shells. Just by creating symbolic links, you can turn any custom) cake shell into a shell command that can be called from any location. Ie: you don&#8217;t have to cd to your cake app directory. Just make sure the symlink is in your [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a little wrapper script to ease the execution of cake shells. Just by creating symbolic links, you can turn any custom) cake shell into a shell command that can be called from any location. Ie: you don&#8217;t have to cd to your cake app directory. Just make sure the symlink is in your $PATH.<br />
<code><br />
$ ./cakeshell<br />
Error: script should be symlinked<br />
cakeshell 0.1 - (c)2010 nerdnotes.org</p>
<p>This wrapper script is built in order to ease running cake shells.</p>
<p>Usage:<br />
The script should be located somewhere your cake directory structure.<br />
Make sure you configure the relative path of the cake script from the<br />
directory this script lives in (REL_CAKE_PATH).</p>
<p>For each of the shells you want to be available, create a symlink to<br />
./cakeshell with the name of the cake shell you want to execute</p>
<p>Example*<br />
*using some real world paths here</p>
<p>To simplify the following cake shell call:</p>
<p>./cake/console/cake bake</p>
<p>You'll need to do this once:</p>
<p>cd ~/bin<br />
ln -s ../public_html/cakesite/cakeshell bake</p>
<p>If ~/bin is in your PATH, you can simply run the bake script from anywhere</p>
<p></code><br />
That&#8217;s the output, here&#8217;s the <a href="/wp-content/cakeshell.txt">script itself</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2010/03/cakeshell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mt-daapd</title>
		<link>http://nerdnotes.org/2010/01/mt-daapd/</link>
		<comments>http://nerdnotes.org/2010/01/mt-daapd/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 23:07:15 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[logfile]]></category>
		<category><![CDATA[mt-daapd]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/?p=128</guid>
		<description><![CDATA[Mt-daapd is an &#8216;iTunes&#8217; server that you can run on a linux system holding your music collection. When fiddling around with configuration, I came accros the following error message in the syslog: Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load I was trying to setup a custom transcoding script. That required to load the &#8216;ssc-script.so&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Mt-daapd is an &#8216;iTunes&#8217; server that you can run on a linux system holding your music collection.<br />
When fiddling around with configuration, I came accros the following error message in the syslog:</p>
<blockquote><p>Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
</p></blockquote>
<p>I was trying to setup a custom transcoding script. That required to load the &#8216;ssc-script.so&#8217; plugin first.<br />
When increasing the log level, it gave a more descriptive hint to what is going on:</p>
<blockquote><p>No codectypes specified for script transcoder.<br />
Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
</p></blockquote>
<p>After uncommenting the following line in /etc/mt-daapd.conf:</p>
<pre class="brush: plain; title: ; notranslate">ssc_codectypes = ogg,flac,alac
</pre>
<p>&#8230;it showed no error messages anymore:</p>
<blockquote><p>Loaded plugin /usr/lib/mt-daapd/plugins/ssc-script.so (ssc-script/svn-1696)
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2010/01/mt-daapd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP Email component</title>
		<link>http://nerdnotes.org/2009/10/cakephp-email-component/</link>
		<comments>http://nerdnotes.org/2009/10/cakephp-email-component/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 22:11:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[phpmailer]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/?p=120</guid>
		<description><![CDATA[This is quite a simple component that integrates PHPMailer with CakePHP. Save the following code to /app/controllers/components/email.php In addition to that, make sure phpmailer is installed in /app/vendors/phpmailer. I just extracted the phpmailer archive in /app/vendors/ and created a symlink: $ tar xzf PHPMailer_v5.0.2.tar.gz $ ln -s PHPMailer_v5.0.2 phpmailer Usage In your controller code, make [...]]]></description>
			<content:encoded><![CDATA[<p>This is quite a simple component that integrates <a href="http://phpmailer.worxware.com/index.php?pg=phpmailer">PHPMailer</a> with <a href="http://cakephp.org">CakePHP</a>. Save the following code to /app/controllers/components/email.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php 

App::import('Vendor', 'PhpMailer', array('file' =&gt; 'phpmailer' . DS . 'class.phpmailer.php'));

/*
    Depends on &quot;unhtml&quot;
*/

class EmailComponent extends PHPMailer
{
	// phpmailer
	var $Mailer = 'sendmail'; // choose 'sendmail', 'mail', 'smtp'
	var $unhtml_bin = '/usr/bin/unhtml';

	// component
	var $controller;

	function startup( &amp;$controller )
	{
		$this-&gt;controller = &amp;$controller;
	}

	function renderBody($view)
	{
		// render the view and use its output to set the body text of the email
		$this-&gt;Body = $this-&gt;controller-&gt;render('emails/' . $view, 'email');

		// reset the output of the controller
		$this-&gt;controller-&gt;output = '';

		// create plain text version of the email
		//
		// create temporary files
		$htmlfile = tempnam(TMP, 'htmlfile');
		$textfile = tempnam(TMP, 'textfile');

		// write html to temporary file
		file_put_contents($htmlfile, $this-&gt;Body);

		// convert the html file to plain text
		$cmd = &quot;cat $htmlfile | $this-&gt;unhtml_bin &gt; $textfile&quot;;
		system($cmd);

		// set the plain text body of the email
		$this-&gt;AltBody = file_get_contents($textfile);

		// remove temporary files
		unlink($htmlfile);
		unlink($textfile);
	}
}

?&gt;
</pre>
<p>In addition to that, make sure phpmailer is installed  in /app/vendors/phpmailer. I just extracted the phpmailer archive in /app/vendors/ and created a symlink:<br />
<code><br />
$ tar xzf PHPMailer_v5.0.2.tar.gz<br />
$ ln -s PHPMailer_v5.0.2 phpmailer<br />
</code><br />
<strong>Usage</strong><br />
In your controller code, make sure the component is included by adding it to the components array:</p>
<pre class="brush: php; title: ; notranslate">
var $components = array('Email');
</pre>
<p>In app/views/layouts, create a new layout called email.ctp. It should contain something like:</p>
<pre class="brush: php; title: ; notranslate">
&lt;html&gt;
&lt;body&gt;
&lt;?php echo $content_for_layout; ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Let&#8217;s send some emails!</strong><br />
In controller snippet, the renderBody(&#8216;test&#8217;) call will create a html email from the view in app/views/users/emails/test.ctp. Additionally, a plain text version will be generated using &#8216;unhtml&#8217;. Unhtml has a package in the Ubuntu / Debian repository.<br />
The action works just like rendering a normal view. The $this->Email object is just an instance of PHPMailer and all PHPMailers&#8217; methods and properties apply.</p>
<pre class="brush: php; title: ; notranslate">
function testmail()
{
	// *Some notes*
	// Email methods:    http://phpmailer.worxware.com/index.php?pg=methods
	// Email properties: http://phpmailer.worxware.com/index.php?pg=properties
	//
	// Email configuration is done in /app/controllers/components/email.php

	$this-&gt;set(compact('some', 'vars'));

	// the email content is just a (html) view in app/views/{controller}/emails/testmail.ctp
	$this-&gt;Email-&gt;renderBody('test');

	// subject
	$this-&gt;Email-&gt;Subject = 'Test from example.com';

	// sender
	$this-&gt;Email-&gt;SetFrom('test@example.com', 'Test');

	// recipients
	$this-&gt;Email-&gt;AddAddress('joe@example.com', 'Joe');
	$this-&gt;Email-&gt;AddAddress('jane@example.com', 'Jane');

	// send!
	$this-&gt;Email-&gt;Send();
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/10/cakephp-email-component/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arduino footprints</title>
		<link>http://nerdnotes.org/2009/07/arduino-footprints/</link>
		<comments>http://nerdnotes.org/2009/07/arduino-footprints/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 11:59:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/07/20/arduino-footprints/</guid>
		<description><![CDATA[Here&#8217;s an Eagle component library with the Arduino Duemilanove and the Nano. If you&#8217;re planning to integrate Arduino&#8217;s as a component in your PCB design, this is a great way to start! I&#8217;ve basically merged and edited the two components from other existing libraries: merriman.lbr, source http://sites.google.com/site/adifferentlemming jet-lib.lbr, source:http://www.flatline.net The Arduino library can be opened [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an <a href="http://www.cadsoft.de/">Eagle</a> component library with the <a href="http://arduino.cc">Arduino</a> <a href="http://arduino.cc/en/Main/ArduinoBoardDuemilanove">Duemilanove</a> and the <a href="http://arduino.cc/en/Main/ArduinoBoardNano">Nano</a>. If you&#8217;re planning to integrate Arduino&#8217;s as a component in your PCB design, this is a great way to start! I&#8217;ve basically merged and edited the two components from other existing libraries:
<ul>
<li><a href="http://sites.google.com/site/adifferentlemming/Home/projects/arduino/merriman.lbr.zip?attredirects=0">merriman.lbr</a>, source <a href="http://sites.google.com/site/adifferentlemming/Home/projects/arduino#TOC-Arduino-Abuse">http://sites.google.com/site/adifferentlemming</a></li>
<li><a href="http://www.flatline.net/Projects/Misc/jet-lib.lbr">jet-lib.lbr</a>, source:<a href="http://www.flatline.net/journal/2008/10/04/eagle-library-arduino-nano/">http://www.flatline.net</a></li>
</ul>
<p>The <a href='http://nerdnotes.org/wp-content/uploads/2009/07/arduino.lbr' title='Arduino library'>Arduino library</a> can be opened in Eagle 4.15. What to expect? Here are some screenshots:<br />
<a href='http://nerdnotes.org/wp-content/uploads/2009/07/arduino-symbol.png' title='Arduino symbols'><img src='http://nerdnotes.org/wp-content/uploads/2009/07/arduino-symbol.thumbnail.png' alt='Arduino symbols' /></a><a href='http://nerdnotes.org/wp-content/uploads/2009/07/arduino-package.png' title='Arduino packages'><img src='http://nerdnotes.org/wp-content/uploads/2009/07/arduino-package.thumbnail.png' alt='Arduino packages' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/07/arduino-footprints/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cakephp ThumbnailHelper</title>
		<link>http://nerdnotes.org/2009/04/cakephp-thumbnailhelper/</link>
		<comments>http://nerdnotes.org/2009/04/cakephp-thumbnailhelper/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 17:44:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/04/07/cakephp-thumbnailhelper/</guid>
		<description><![CDATA[This thumbnail helper is based on the one published by Studio Canaria. Additional features are multiple size caching and an extra method which is a truly drop-in replacement for $html->image(). Usage: Installation: Download thumbnail.txt Rename it to thumbnail.php and place it in /app/views/helpers/ download phpThumb() Extract the phpThumb archive in a directory named /app/vendors/phpthumb/ Add [...]]]></description>
			<content:encoded><![CDATA[<p>This thumbnail helper is based on the one published by <a href="http://www.studiocanaria.com/articles/cakephp_thumbnail_helper">Studio Canaria</a>. Additional features are multiple size caching and an extra method which is a truly drop-in replacement for $html->image().<br />
Usage:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

echo $thumbnail-&gt;image('picture.jpg', array(
 	'alt' =&gt; 'test thumbnail',
 	'width' =&gt; '100',
 	'height' =&gt; '75'
 	)
 );

// result:
// &lt;img src=&quot;/img/thumbs/100x75/picture.jpg&quot;
//	alt=&quot;test thumbnail&quot; height=&quot;75&quot; width=&quot;100&quot;&gt;

?&gt;
</pre>
<p>Installation:</p>
<ul>
<li>Download <a href='http://nerdnotes.org/wp-content/uploads/2009/04/thumbnail.txt' target="_blank" title='thumbnail.txt'>thumbnail.txt</a></li>
<li>Rename it to thumbnail.php and place it in /app/views/helpers/</li>
<li><a href="http://phpthumb.sourceforge.net/#download">download</a> <a href="http://phpthumb.sourceforge.net">phpThumb()</a></li>
<li>Extract the phpThumb archive in a directory named /app/vendors/phpthumb/</li>
<li>Add &#8216;Thumbnail&#8217; to the &#8216;helpers&#8217; array your controller</li>
<li>Create a directory named &#8216;thumbs&#8217; in /app/webroot/img/. Make sure it&#8217;s writable for the webserver.</li>
</ul>
<p>That&#8217;s it!<br />
In the above example, the thumb helper will first check if there is a file named /app/webroot/img/thumbs/100&#215;75/picture.jpg. If it isn&#8217;t there yet, it will instantiate phpThumb and create the thumbnail.<br />
For more advanced usage, there&#8217;s also the render() method. It will give you the flexibility to use images located outside /app/webroot/img and also make use of most of the <a href="http://phpthumb.sourceforge.net/demo/docs/phpthumb.readme.txt">phpThumb options</a>.<br />
Advanced example:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

$thumb = $thumbnail-&gt;render(
	$data['Picture']['path'],
	array(
		'w' =&gt; 320,
		'h' =&gt; 200,
		'ra' =&gt; 10
	),
	'5271a9e66c99c84c092d7fd81cebcd57'
);

echo $html-&gt;image($thumb);

?&gt;
</pre>
<p>This will generate a picture named /app/webroot/img/thumbs/320&#215;200/5271a9e66c99c84c092d7fd81cebcd57.jpg, which is a 10 degrees rotated thumbnail of the original image specified with $data['Picture']['path'].</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/04/cakephp-thumbnailhelper/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>explorerTree demo files</title>
		<link>http://nerdnotes.org/2009/04/explorertree-demo-files/</link>
		<comments>http://nerdnotes.org/2009/04/explorertree-demo-files/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 15:35:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/04/06/tree-demo-files/</guid>
		<description><![CDATA[To save you some typing, this archive contains a working example of the tree helper code described in the bakery. The archive includes cake 1.2, three images and jquery. In the js-code, some hard-coded paths were corrected. It also contains a file named tree.sql which contains a dump of the database including some sample data.]]></description>
			<content:encoded><![CDATA[<p><img src='http://nerdnotes.org/wp-content/uploads/2009/04/tree.png' alt='tree.png' /><br />
To save you some typing, <a href="http://nerdnotes.org/wp-content/uploads/2009/04/tree.tgz">this archive</a> contains a working example of the <a href="http://bakery.cakephp.org/articles/view/creating-an-explorer-like-navigation">tree helper</a> code described in the bakery. The archive includes cake 1.2, three images and jquery. In the js-code, some hard-coded paths were corrected. It also contains a file named tree.sql which contains a dump of the database including some sample data.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/04/explorertree-demo-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cakephp, user_dir and mod_rewrite</title>
		<link>http://nerdnotes.org/2009/04/cakephp-user_dir-and-mod_rewrite/</link>
		<comments>http://nerdnotes.org/2009/04/cakephp-user_dir-and-mod_rewrite/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 08:53:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/04/02/cakephp-user_dir-and-mod_rewrite/</guid>
		<description><![CDATA[Here&#8217;s a little note on getting a cakephp app working in your public_html directory. In order to get the mod_rewrite configuration working, add a RewriteBase rule to the .htaccess files in the cakephp source. If your app is located in /home/me/public_html/cakesite/ and the URL to the site is http://host/~me/cakesite you&#8217;ll need to change the following [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little note on getting a cakephp app working in your public_html directory. In order to get the mod_rewrite configuration working, add a RewriteBase rule to the .htaccess files in the cakephp source. If your app is located in /home/me/public_html/cakesite/ and the URL to the site is http://host/~me/cakesite you&#8217;ll need to change the following .htaccess files:</p>
<blockquote><p>
/home/me/public_html/cakesite/.htaccess<br />
/home/me/public_html/cakesite/app/webroot/.htaccess
</p></blockquote>
<p>Add the following line to these files, just below the line stating &#8220;RewriteEnginge On&#8221;:</p>
<pre class="brush: css; title: ; notranslate">
RewriteBase /~me/cakesite/
</pre>
<p>For example, the first .htaccess file will look like:</p>
<pre class="brush: css; title: ; notranslate">
&lt;ifModule mod_rewrite.c&gt;
	RewriteEngine on
	RewriteBase /~me/cakesite/
	RewriteRule    ^$ app/webroot/    [L]
	RewriteRule    (.*) app/webroot/$1 [L]
&lt;/ifModule&gt;
</pre>
<p><strong>Bonus notes with instructions for Debian/Ubuntu systems</strong><br />
You should have mod_rewrite enabled:</p>
<blockquote><p>
$ sudo a2enmod rewrite<br />
$ sudo /etc/init.d/apache2 force-reload
</p></blockquote>
<p>To make sure the use of .htaccess files is actually allowed. In the Directory section of your apache configuration, there should be a line like:</p>
<blockquote><p>
AllowOverride FileInfo
</p></blockquote>
<p>Also, be sure to force-reload Apache after making this change.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/04/cakephp-user_dir-and-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>cmdline screenshots in OSX</title>
		<link>http://nerdnotes.org/2009/02/cmdline-screenshots-in-osx/</link>
		<comments>http://nerdnotes.org/2009/02/cmdline-screenshots-in-osx/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 13:25:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/02/18/cmdline-screenshots-in-osx/</guid>
		<description><![CDATA[Geekology describes a nice osx builtin command to create screen captures: screencapture. I wanted to create a screenshot of a mouse interaction. That requires some sort of a delay after initiating the capture. The &#8220;-T&#8221; option described facilitates this. It looks like the -T option is missing in the tiger version of this utility. Of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.geekology.co.za">Geekology</a> describes a nice osx builtin command to create screen captures: screencapture. I wanted to create a screenshot of a mouse interaction. That requires some sort of a delay after initiating the capture. The &#8220;-T&#8221; option <a href="http://www.geekology.co.za/blog/2009/02/mac-os-x-quick-tip-taking-screenshots-from-the-command-line/">described</a> facilitates this. It looks like the -T option is missing in the tiger version of this utility. Of course you can use &#8216;sleep&#8217; to wait a couple of seconds:</p>
<pre class="brush: css; title: ; notranslate">
$ sleep 5;screencapture -C ~/Desktop/screenshot.png
</pre>
<p>See also my previous post on <a href="http://nerdnotes.org/2005/03/27/screenshots/">screenshots</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/02/cmdline-screenshots-in-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

