<?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>mijit.com &#187; tech</title>
	<atom:link href="http://www.mijit.com/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mijit.com</link>
	<description>re:programmer</description>
	<lastBuildDate>Sat, 29 Oct 2011 08:09:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>/dev/null: Permission Denied</title>
		<link>http://www.mijit.com/2007/09/10/devnull-permission-denied/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=devnull-permission-denied</link>
		<comments>http://www.mijit.com/2007/09/10/devnull-permission-denied/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 18:02:12 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/09/10/devnull-permission-denied/</guid>
		<description><![CDATA[i was getting this error repeatedly on boxes in my home domain. i would set up a system and then, seemingly at random, i would try to ssh to it and it would spout several &#8220;/dev/null: Permission Denied&#8221; as i tried to fire up an ssh-agent. looking at /dev/null, it showed a file mode of [...]]]></description>
			<content:encoded><![CDATA[<p>i was getting this error repeatedly on boxes in my home domain. i would set up a system and then, seemingly at random, i would try to ssh to it and it would spout several &#8220;/dev/null: Permission Denied&#8221; as i tried to fire up an ssh-agent. looking at /dev/null, it showed a file mode of (if i remember correctly,) 600 and owned by root. i had no idea what was even *accessing* /dev/null &#8211; i certainly didn&#8217;t have any cron jobs set up to alter it. googling the problem didn&#8217;t really enlighten me, but i did check my .bashrc scripts and noted that i had set MYSQL_HISTFILE to /dev/null. a-ha! some reports on the web showed that various apps like to set files&#8217; permissions in a sneaky sort of way, so i theorized that perhaps mysql sets the perms on that file to something sensible for a history file (to the detriment of other apps, of course, but mysql isn&#8217;t really expecting to write to a file other people will need, anyway. and mysql isn&#8217;t suid root, so this is still just a guess.) removing this line seems to work, for now, so hopefully i will have solved this. and hopefully this will have helped you, too!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/09/10/devnull-permission-denied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>black is beautiful. and energy efficient!</title>
		<link>http://www.mijit.com/2007/08/20/black-is-beautiful-and-energy-efficient/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=black-is-beautiful-and-energy-efficient</link>
		<comments>http://www.mijit.com/2007/08/20/black-is-beautiful-and-energy-efficient/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 20:48:57 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/08/20/black-is-beautiful-and-energy-efficient/</guid>
		<description><![CDATA[check out Rising Phoenix Design and the Blackback Web Theory. i promise i won&#8217;t say &#8220;i told you so&#8221;. or, check out ecoIron, with their textual analysis of how a Black Google Would Save 750 Megawatt-hours a Year: As noted, an all white web page uses about 74 watts to display, while an all black [...]]]></description>
			<content:encoded><![CDATA[<p>check out <a href="http://www.risingphoenixdesign.com/">Rising Phoenix Design</a> and the <a href="http://www.risingphoenixdesign.com/blackback.html">Blackback Web Theory</a>.</p>
<p>i promise i won&#8217;t say &#8220;i told you so&#8221;.</p>
<p><a href="http://www.risingphoenixdesign.com/blackback.html"><img src='http://www.mijit.com/wp-content/uploads/2007/08/blackback.png' alt='blackback' width="565" /></a></p>
<p>or, check out <a href="http://ecoiron.blogspot.com/">ecoIron</a>, with their textual analysis of how a <a href="http://ecoiron.blogspot.com/2007/01/black-google-would-save-3000-megawatts.html">Black Google Would Save 750 Megawatt-hours a Year</a>:</p>
<blockquote><p>As noted, an all white web page uses about 74 watts to display, while an all black page uses only 59 watts. I thought I would do a little math and see what could be saved by moving a high volume site to the black format.</p>
<p>Take at look at Google, who gets about 200 million queries a day. Let&#8217;s assume each query is displayed for about 10 seconds; that means Google is running for about 550,000 hours every day on some desktop. Assuming that users run Google in full screen mode, the shift to a black background [on a CRT monitor! mjo] will save a total of 15 (74-59) watts. That turns into a global savings of 8.3 Megawatt-hours per day, or about 3000 Megawatt-hours a year. Now take into account that about 25 percent of the monitors in the world are CRTs, and at 10 cents a kilowatt-hour, that&#8217;s $75,000, a goodly amount of energy and dollars for changing a few color codes.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/08/20/black-is-beautiful-and-energy-efficient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the occasional vim error</title>
		<link>http://www.mijit.com/2007/08/14/the-occasional-vim-error/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-occasional-vim-error</link>
		<comments>http://www.mijit.com/2007/08/14/the-occasional-vim-error/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 21:19:28 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/08/14/the-occasional-vim-error/</guid>
		<description><![CDATA[this is something that had been bothering me for ages. i am one of those who keeps virtually all my info in one notes.txt file &#8211; no fancy GTD system, just a bunch of text that i noodle with on an ad hoc basis. i use vim to manage it, and it stays open 24&#215;7 [...]]]></description>
			<content:encoded><![CDATA[<p>this is something that had been bothering me for ages. i am one of those who keeps virtually all my info in one notes.txt file &#8211; no <a href="http://www.davidco.com/">fancy GTD system</a>, just a bunch of text that i noodle with on an ad hoc basis. i use <a href="http://www.vim.org/">vim</a> to manage it, and it stays open 24&#215;7 on multiple machines (via <a href="http://www.gnu.org/software/screen/">screen</a> &#8211; something i&#8217;ll go into another time.)</p>
<p>but, the problem with keeping the window open is that, at least on my fedora boxes, a system cron script comes along once a week and cleans out the /tmp directory &#8212; including the temp files that vim is using to keep state in my editing session. this makes me have to save/close/reopen vim, usually when i try to launch some external command like <a href="http://www.gnu.org/software/textutils/textutils.html">sort</a>.</p>
<p>the solution i found was to touch vim&#8217;s temp file daily, making it look like a &#8220;new&#8221; file to the system cleanup script. vim makes temp file directories in a format like this:</p>
<ul><code>
<pre>
/tmp/v\d??????
</pre>
<p></code></ul>
<p>so, in my personal crontabs, i use this to ferret these out and touch them up-to-date:</p>
<ul><code>
<pre>
find /tmp -follow -type d -name v?????? -exec touch {} &#92;; 2>/dev/null
</pre>
<p></code></ul>
<p>works like a charm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/08/14/the-occasional-vim-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mutt/zimbra spam macros</title>
		<link>http://www.mijit.com/2007/08/12/muttzimbra-spam-macros/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=muttzimbra-spam-macros</link>
		<comments>http://www.mijit.com/2007/08/12/muttzimbra-spam-macros/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 16:31:00 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/08/12/muttzimbra-spam-macros/</guid>
		<description><![CDATA[here are snippets from my .muttrc file which allow me to bounce messages to my zimbra server spam / ham mailboxes, for the purposes of training spamassassin. this was taken from Lucas Nussbaum, but his link appears to be down at the moment. i&#8217;m including these here in case anyone elses googles &#8220;mutt zimbra spam [...]]]></description>
			<content:encoded><![CDATA[<p>here are snippets from my <code>.muttrc</code> file which allow me to bounce messages to my <a href="http://www.zimbra.com/">zimbra</a> server spam / ham mailboxes, for the purposes of training spamassassin. this was taken from <a href="http://www.lucas-nussbaum.net/writings.php?emails">Lucas Nussbaum</a>, but his link appears to be down at the moment. i&#8217;m including these here in case anyone elses googles &#8220;<a href="http://www.google.com/search?hl=en&#038;q=mutt+zimbra+spam+macro">mutt zimbra spam macro</a>&#8220;, like i did for a few weeks to no avail.</p>
<ul><code><br />
macro index S "&lt;bounce-message&gt;spambox@mijit.com\nyd" "Learn as spam"<br />
macro pager S "&lt;bounce-message&gt;spambox@mijit.com\nyd" "Learn as spam"<br />
macro index H "&lt;bounce-message&gt;hambox@mijit.com\nyj" "Learn as ham"<br />
macro pager H "&lt;bounce-message&gt;hambox@mijit.com\nyj" "Learn as ham"<br />
</code></ul>
<p>these allow you to highlight a message in the index or pager, hit &#8220;S&#8221; for spam (or &#8220;H&#8221; for ham,) and the message bounces away to the appropriate zimbra mailbox for automated spamassassin learning. (additionally, the &#8220;S&#8221; for spam macro marks the message for deletion; the &#8220;H&#8221; for ham macro simply moves to the next message.) the tricky bit for me was understanding that mutt allows the &#8220;\n&#8221; newline character to simulate &lt;return&gt; at the end of the &lt;bounce-message&gt; command.</p>
<p>note that you must change &#8220;spambox&#8221; and &#8220;hambox&#8221; to the appropriately named mailboxes for your domain. to see what your current spam mailboxes are, issue the following command as the zimbra user:</p>
<ul><code><br />
zmprov gacf | grep SpamAccount<br />
</code></ul>
<p>to change these values to something more appropriate to your domain, use zmprov again:</p>
<ul><code><br />
zmprov mcf zimbraSpamIsNotSpamAccount &lt;your ham account&gt;@example.com<br />
zmprov mcf zimbraSpamIsSpamAccount &lt;your spam account&gt;@example.com<br />
</code></ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/08/12/muttzimbra-spam-macros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A beginning Test::More suite, VIM discoveries, and FuseFS musings</title>
		<link>http://www.mijit.com/2007/08/10/a-beginning-testmore-suite-vim-discoveries-and-fusefs-musings/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-beginning-testmore-suite-vim-discoveries-and-fusefs-musings</link>
		<comments>http://www.mijit.com/2007/08/10/a-beginning-testmore-suite-vim-discoveries-and-fusefs-musings/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 17:29:01 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/08/10/a-beginning-testmore-suite-vim-discoveries-and-fusefs-musings/</guid>
		<description><![CDATA[A Perl Test::More suite for small networks I&#8217;ve been wanting to implement some simple tests for my home network to make sure everything is running the way I expect it to on an ad-hoc basis. I&#8217;ve got a Nagios setup monitoring my Apache, MySQL, and Zimbra services, but I wanted a bit more granularity to [...]]]></description>
			<content:encoded><![CDATA[<h2>A Perl Test::More suite for small networks</h2>
<p>I&#8217;ve been wanting to implement some simple tests for my home network to make sure everything is running the way I expect it to on an ad-hoc basis. I&#8217;ve got a Nagios setup monitoring my Apache, MySQL, and Zimbra services, but I wanted a bit more granularity to my tests, a command-line interface, and the ability to separate out the &#8220;business logic&#8221; a la MVC.</p>
<p>Since I had documented my server installation routine in chronological order (eg, &#8220;first, unpack the box,&#8221;) I immediately noticed I had roughly determined a five-step overview of the process. Since most tests I&#8217;ve seen run numerically, I decided on:</p>
<ul>
<li>00prereqs.t &#8211; do I have everything I need to run the other tests?</li>
<li>01dns.t &#8211; can I resolve host names, so I can find hosts and services?</li>
<li>02time.t &#8211; is my clock correct (so later time dependencies would work?)</li>
<li>03hosts.t &#8211; can I find all hosts I expect to find?</li>
<li>04services.t &#8211; can I contact all services (SMTP, HTTP, etc) I expect to find?</li>
</ul>
<p>UPDATE: I forgot that I moved the DNS test earlier in the sequence &#8211; my NTP test relies on DNS to find external time masters to get the current time.</p>
<p>Note: I discovered via 02time.t that Net::Time doesn&#8217;t work for me; Net::NTP does. I don&#8217;t know what the difference is, but &#8220;working&#8221; is always a plus in my book. Basically, using it, I test whether localtime is the same as NTP time (see Net::NTP time for details.)</p>
<p>I am not sure whether 04services.t will grow into multiple files for various services, but this works well enough for now. I won&#8217;t go into each individual test in each file for this post, but suffice it to say this is how I now test for sanity from my SVN tree:</p>
<ul><code>
<pre>
~/src/mijit
[204]meatbag$ prove -l t/
t/00prereqs.....ok
t/01time........ok
t/02dns.........ok
t/03hosts.......ok
t/04services....ok
All tests successful.
Files=5, Tests=11,  2 wallclock secs ( 0.97 cusr +  0.26 csys =  1.23 CPU)
</pre>
<p></code></ul>
<h2>VIM discoveries</h2>
<ul>
<li>When using the <code>gq</code> command, the <code>autoindent</code> option can be your friend! This allows indented text to be left-aligned correctly (a necessity for my notes.txt file.)</li>
<li>some <code>matchparen</code> plugin that is installed on some of my machines and not others adds annoying cyan brace-matching highlighting. This drags my eye away <strong>completely</strong> away from the cursor &#8211; bad plugin! The quick fix: :NoMatchParen disables the plugin, and :DoMatchParen enables it again. Do as you like to your <code>plugin/</code> directory.</li>
</ul>
<h2>FuseFS musings:</h2>
<p>Much seems to have been made of FuseFS lately, which I think is a really neat (but not necessarily great,) idea &#8211; and I mean that in a it works in theory, but not reality. At least, that&#8217;s been my limited experience. Given the state of these tools and the tech know-how needed to deploy them, I find myself asking why not just set an expectation that WebDAV can do it for you (yes, I know it has its own problems with various clients requiring certain server headers. Maybe that means we should pressure people <strong>more</strong> to follow open standards.) That said, I have been finding the following quite useful to <a href="http://www.pthree.org/2007/02/10/sshfs/">mount a remote directory to a local directory over SSH:</a></p>
<ul><code>
<pre>
sshfs -p $REMOTE_PORT $REMOTE_HOST:$REMOTE_DIR $LOCAL_DIR
</pre>
<p></code></ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/08/10/a-beginning-testmore-suite-vim-discoveries-and-fusefs-musings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>i love paris in the T:flw.quid55328.com/aaakk/ch@ung</title>
		<link>http://www.mijit.com/2007/06/27/i-love-paris-in-the-tflwquid55328comaaakkchung/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-love-paris-in-the-tflwquid55328comaaakkchung</link>
		<comments>http://www.mijit.com/2007/06/27/i-love-paris-in-the-tflwquid55328comaaakkchung/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 15:23:46 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[art]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/06/27/i-love-paris-in-the-tflwquid55328comaaakkchung/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.mijit.com/wp-content/uploads/2007/06/lv-night.jpg' alt='paris, las vegas, running windows' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/06/27/i-love-paris-in-the-tflwquid55328comaaakkchung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.2 now available</title>
		<link>http://www.mijit.com/2007/05/17/wordpress-22-now-available/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-22-now-available</link>
		<comments>http://www.mijit.com/2007/05/17/wordpress-22-now-available/#comments</comments>
		<pubDate>Fri, 18 May 2007 03:01:40 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/05/17/wordpress-22-now-available/</guid>
		<description><![CDATA[On behalf of the entire WordPress team, I’m proud and excited to announce the immediate availability of version 2.2 “Getz” for download. This version includes a number of new features, most notably Widgets integration, and over two hundred bug fixes. It’s named in honor of tenor saxophonist Stan Getz. &#8211;Matt, from WordPress Here&#8217;s my &#8220;short [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>On behalf of the entire WordPress team, I’m proud and excited to announce <a href="http://wordpress.org/development/2007/05/wordpress-22/">the immediate availability of version 2.2 “Getz”</a> for download. This version includes a number of new features, most notably Widgets integration, and over two hundred bug fixes. It’s named in honor of tenor saxophonist Stan Getz.<br />
&#8211;Matt, from <a href="http://wordpress.com/">WordPress</a></p></blockquote>
<p>Here&#8217;s my &#8220;short list&#8221; of observations:</p>
<ul>
<li>Widgets (ie, AJAX-y sidebar thingies)</li>
<li>Full Atom support (plus new XML-RPC APIs)</li>
<li>Blogger.com integration</li>
<li><a href="http://jquery.com/">jQuery</a> used for internal functions on admin page</li>
<li>Optionally set “home” and “siteurl” options in wp-config.php instead of the database (useful when supporting a dev/prod setup)</li>
<li>Tenor players (eg, Getz) rule</li>
</ul>
<p>if you followed <a href="http://www.mijit.com/2007/05/07/migrating-from-tarballed-wordpress-to-subversioned-wordpress/">my previous post regarding subversion access to WP code</a>, I can attest that the upgrade is now as easy as:</p>
<p><code>    svn switch http://svn.automattic.com/wordpress/trunk/</code></p>
<p>&#8230;and hitting the database upgrade link. I needed to <code>svn switch</code> since, as you may have noticed, I had checked out the 2.1.3 tag, not the trunk. Switching to trunk should mean that all future upgrades are as easy as <code>svn upgrade</code>. Whee, etc!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/05/17/wordpress-22-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Complexifiers v. Simplifiers Redux</title>
		<link>http://www.mijit.com/2007/05/13/complexifiers-v-simplifiers-redux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=complexifiers-v-simplifiers-redux</link>
		<comments>http://www.mijit.com/2007/05/13/complexifiers-v-simplifiers-redux/#comments</comments>
		<pubDate>Sun, 13 May 2007 16:21:25 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/05/13/complexifiers-v-simplifiers-redux/</guid>
		<description><![CDATA[Last year, Murali, from his Thought Garage, expanded on some perspectives I offered in the comments of a Berkun Blog comparing those who &#8220;complexify&#8221; and those who &#8220;simplify.&#8221; For simplifiers familiar with the often-debilitating effects of complexifiers (at least, in the world of software development, where &#8220;real world&#8221; issues like deadlines and deliverables reign,) the [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, Murali, from his <a href="http://blogs.inspions.net/">Thought Garage</a>, <a href="http://blogs.inspions.net/2006/07/28/complexifiers-and-simplifiers-3/">expanded on</a> some <a href="http://www.scottberkun.com/blog/2006/there-are-two-kinds-of-people-complexifiers-and-simplifers/#comment-18431"> perspectives I offered</a> in the comments of a <a href="http://www.scottberkun.com/">Berkun Blog</a> comparing those who &#8220;complexify&#8221; and those who &#8220;simplify.&#8221; For simplifiers familiar with the often-debilitating effects of complexifiers (at least, in the world of software development, where &#8220;real world&#8221; issues like deadlines and deliverables reign,) the problem is <em>what do we do with redundancy when we can&#8217;t take it out back and shoot it in the head?</em></p>
<p>The irony of adding to a lengthy discussion on the topic is hopefully not lost on us, but I feel compelled to add that this is precisely the problem Zen addresses. That is, there is a way to directly experience the truth of our situation without expending excess energy on processes that do not serve us. During walking meditation yesterday, it occurred to me that Yeats said this very thing to me in <em>The Coming of Wisdom with Time</em>:</p>
<blockquote><p>THOUGH leaves are many, the root is one;<br />
Through all the lying days of my youth<br />
I swayed my leaves and flowers in the sun;<br />
Now I may wither into the truth.<br />
&#8211;Yeats, William Butler</p></blockquote>
<p>So, the solution? Read. Read more. Read even yet still more.</p>
<p>Then, go ask a tree.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/05/13/complexifiers-v-simplifiers-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selectively disabling TT wrapper in Catalyst</title>
		<link>http://www.mijit.com/2007/05/08/selectively-disabling-tt-wrapper-in-catalyst/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=selectively-disabling-tt-wrapper-in-catalyst</link>
		<comments>http://www.mijit.com/2007/05/08/selectively-disabling-tt-wrapper-in-catalyst/#comments</comments>
		<pubDate>Wed, 09 May 2007 02:03:22 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/05/08/selectively-disabling-tt-wrapper-in-catalyst/</guid>
		<description><![CDATA[The following is a method for Catalyst sites using Template Toolkit with a site-wide WRAPPER directive to selectively return partial HTML for the purpose of serving Asynchronous HTML and HTTP (ie, &#8220;AHAH&#8217;). Catalyst is a powerful and versatile web development framework that aims to be Perl&#8217;s counterpart to Ruby on Rails, fusing a Model-View-Controller (MVC) [...]]]></description>
			<content:encoded><![CDATA[<p>The following is a method for <a href="http://www.catalystframework.org/">Catalyst</a> sites using <a href="http://www.template-toolkit.org/">Template Toolkit</a> with a site-wide WRAPPER directive to selectively return partial HTML for the purpose of serving Asynchronous HTML and HTTP (ie, &#8220;AHAH&#8217;).</p>
<p>Catalyst is a powerful and versatile web development framework that aims to be Perl&#8217;s counterpart to Ruby on Rails, fusing a Model-View-Controller (MVC) environment with the depth, breadth, and power of CPAN. If you build web sites with <a href="http://www.perl.org/">Perl</a>, you should check it out.</p>
<p>The problem: you want to use TT&#8217;s WRAPPER directive to supply a site-wide wrapper template, but you also want to be able to selectively turn the wrapper off so that you can serve some pages as partial HTML. At first glance, Catalyst&#8217;s config() method might suggest that one could reconfigure your view in your action&#8217;s end(), but that proves fruitless and it clucks in the following manner:</p>
<p><code>[warn] Setting config after setup has been run is not a good idea. </code></p>
<p>My solution: create an <code>end()</code> in your controller that emits &#8220;partial&#8221; HTML fragments by creating a new Template Toolkit object with a locally-defined configuration. (Note that since we override the root controller&#8217;s <code>end()</code>, we must call forward/detach to it if we do not specify the &#8220;partial&#8221; parameter.)</p>
<p><code>sub end : Private {<br />
    my ($self, $c, $file) = @_;<br />
    my $params = $c->request->parameters;<br />
    if (exists $params->{'partial'}) {<br />
        my $html;<br />
        my $tt = Template->new({<br />
            %{ $c->config->{'View::TT'} },<br />
            INCLUDE_PATH => $c->path_to('root'),<br />
            WRAPPER => undef,<br />
        });<br />
        $tt->process($file, $c->stash, \$html) or $c->log->warn($tt->error);<br />
        $c->response->content_type('text/html');<br />
        $c->response->body($html);<br />
    }<br />
    else {<br />
        $c->detach(qw/CE::Controller::Root end/);<br />
    }<br />
}<br />
</code></p>
<p>A more robust solution better-suited for larger projects might be a new view with an alternate configuration (eg, a custom View::TTpartial,) but I wanted to show the logic directly in my controller, allowing full control of the configuration and direct access to the $html.</p>
<p>Coming soon: the &#8220;data island&#8221; solution I ultimately opted for to obviate AHAH for serving map marker data to a Google map.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/05/08/selectively-disabling-tt-wrapper-in-catalyst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>migrating from &#8220;tarballed wordpress&#8221; to &#8220;subversioned wordpress&#8221;</title>
		<link>http://www.mijit.com/2007/05/07/migrating-from-tarballed-wordpress-to-subversioned-wordpress/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=migrating-from-tarballed-wordpress-to-subversioned-wordpress</link>
		<comments>http://www.mijit.com/2007/05/07/migrating-from-tarballed-wordpress-to-subversioned-wordpress/#comments</comments>
		<pubDate>Mon, 07 May 2007 19:42:13 +0000</pubDate>
		<dc:creator>mijit</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mijit.com/2007/05/07/migrating-from-tarballed-wordpress-to-subversioned-wordpress/</guid>
		<description><![CDATA[i just migrated from the tarballed wordpress source code to a locally checked-out copy of the subversion repository. this should allow me to upgrade in the future by using svn update or some equivalent. here&#8217;s how i did it. see the upgrade documentation for details. mkdir mijit.com-new ( cd mijit.com-new &#038;&#038; svn co http://svn.automattic.com/wordpress/tags/2.1.3 . [...]]]></description>
			<content:encoded><![CDATA[<p>i just migrated from the tarballed wordpress source code to a locally checked-out copy of the subversion repository. this should allow me to upgrade in the future by using <code>svn update</code> or some equivalent.</p>
<p>here&#8217;s how i did it. see <a href="http://codex.wordpress.org/Upgrading_WordPress">the upgrade documentation</a> for details.</p>
<p><code>    mkdir mijit.com-new<br />
    ( cd mijit.com-new &#038;&#038; svn co http://svn.automattic.com/wordpress/tags/2.1.3 . )<br />
    cp -pr mijit.com/{.htaccess,wp-config.php,wp-content} mijit.com-new<br />
    mv mijit.com mijit.com-old &#038;&#038; mv mijit.com-new/ mijit.com<br />
</code></p>
<p><strong>note:</strong> on my production server, i ran into a problem where the upgrade page didn&#8217;t work &#8211; it simply showed a white page, no matter how many times i reloaded it. i peppered the php code with <code>die('x')</code> to see what was failing, but it seemed to just crap out at some point in the script execution. then, i discovered the following in my apache error_log:</p>
<p><code>    Allowed memory size of 8388608 bytes exhausted (tried to allocate 0 bytes)</code></p>
<p>aha &#8211; so sucktastic php is crapping out and barely giving any indication that it is to blame! (i don&#8217;t blame the wordpress people for not slavishly checking every memory allocation, but you&#8217;d think php itself could put something cunning like &#8220;php&#8221; in its log lines so i know the error is neither with wordpress nor apache.)</p>
<p>googling that line brings the solution, to increase the memory available to php. not that that stopped me from wondering why the hell an upgrade script (which presumably just updates a version string, based on a cursory examination of the code,) needs a ton of memory anyway:</p>
<p>in /etc/php.ini, bump from 8M to 16M:</p>
<p><code>    memory_limit = 16M</code></p>
<p>installation proceeded flawlessly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mijit.com/2007/05/07/migrating-from-tarballed-wordpress-to-subversioned-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: www.mijit.com @ 2012-02-06 05:20:09 -->
