<?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>Schadenfreude &#187; tutorial</title>
	<atom:link href="http://www.ralree.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ralree.com</link>
	<description>Malicious enjoyment derived from observing someone else's misfortune</description>
	<lastBuildDate>Thu, 18 Mar 2010 02:32:11 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to make a Flash Line Chart in Rails using Ziya</title>
		<link>http://www.ralree.com/2008/02/16/how-to-make-a-flash-line-chart-in-rails-using-ziya/</link>
		<comments>http://www.ralree.com/2008/02/16/how-to-make-a-flash-line-chart-in-rails-using-ziya/#comments</comments>
		<pubDate>Sat, 16 Feb 2008 22:58:15 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ziya]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/how-to-make-a-flash-line-chart-in-rails-using-ziya</guid>
		<description><![CDATA[Ziya is pretty cool, and the documentation is slowly starting to surface.  I was annoyed that I couldn’t find a good example paste of how to make a line chart.  Then I watched the screencast.  It’s the first example he does, so I’m posting it here so those who can’t watch it [...]]]></description>
			<content:encoded><![CDATA[<p>Ziya is pretty cool, and the documentation is slowly starting to surface.  I was annoyed that I couldn’t find a good example paste of how to make a line chart.  Then I watched the <a href="http://www.youtube.com/watch?v=axIMmMHdXzo">screencast</a>.  It’s the first example he does, so I’m posting it here so those who can’t watch it can actually find out how to do it.</p>
<p>I’m going to operate on the precondition that you’ve installed Ziya and included it in your controller properly.  Do the bar chart example before going any further.</p>
<p>Now, make this function in your controller:</p>
<pre><code>
def refresh_chart
  chart = ZIya::Charts::Line.new
  render :text =&gt; chart
end
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2008/02/16/how-to-make-a-flash-line-chart-in-rails-using-ziya/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking a WRT54G v8 With DD-WRT</title>
		<link>http://www.ralree.com/2007/10/06/hacking-a-wrt54g-v8-with-dd-wrt/</link>
		<comments>http://www.ralree.com/2007/10/06/hacking-a-wrt54g-v8-with-dd-wrt/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 15:20:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ddwrt]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/20/hacking-a-wrt54g-v8-with-dd-wrt</guid>
		<description><![CDATA[So, last month sometime, BrainSlayer got DD-WRT working on version 8 of the WRT54G.  Now this was great news to me when I read it since I’ve been wanting to get rid of the crappy LinkSys management from the beginning.  Some of the procedure worked, and some of it didn’t for me.
Do not [...]]]></description>
			<content:encoded><![CDATA[<p>So, last month sometime, BrainSlayer <a href="http://www.dd-wrt.com/phpBB2/viewtopic.php?t=20095">got DD-WRT working on version 8 of the WRT54G</a>.  Now this was great news to me when I read it since I’ve been wanting to get rid of the crappy LinkSys management from the beginning.  Some of the procedure worked, and some of it didn’t for me.</p>
<h2>Do not try this if you don’t know <strong>exactly</strong> what you’re getting into.</h2>
<p><span id="more-3914"></span></p>
<p>So, last month sometime, BrainSlayer <a href="http://www.dd-wrt.com/phpBB2/viewtopic.php?t=20095">got DD-WRT working on version 8 of the WRT54G</a>.  Now this was great news to me when I read it since I’ve been wanting to get rid of the crappy LinkSys management from the beginning.  Some of the procedure worked, and some of it didn’t for me.</p>
<h2>Do not try this if you don’t know <strong>exactly</strong> what you’re getting into.</h2>
<p>Here’s what I ended up doing:</p>
<ul>
<li>Go <a href="http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Frelease+candidates%2FDD-WRT+v24+RC3%2FGENERIC+BROADCOM+%28Linksys%2C+Asus+etc.%29%2FWRT54Gv8%2C+WRT54GSv7/">here</a> and look at the state of things.</li>
<li>Read flashing.txt.  It helped me immensely.</li>
<li>Download <a href="http://www.dd-wrt.com/dd-wrtv2/downloads/release%20candidates/DD-WRT%20v24%20RC3/GENERIC%20BROADCOM%20(Linksys,%20Asus%20etc.)/WRT54Gv8,%20WRT54GSv7/dd-wrt.v24_micro_wrt54gv8.bin">the DD-WRT firmware</a> and the <a href="http://www.dd-wrt.com/dd-wrtv2/downloads/release%20candidates/DD-WRT%20v24%20RC3/GENERIC%20BROADCOM%20(Linksys,%20Asus%20etc.)/WRT54Gv8,%20WRT54GSv7/vxworkskillerGv8.bin">version 8 VXWorks killer</a> and put them in a safe place</li>
<li>I use Ubuntu, so at this point I installed tftp:</li>
</ul>
<pre><code>
sudo apt-get install tftp
</code></pre>
<ul>
<li>Go to the flashing dialog and flash the VXWorks killer firmware you got.</li>
<li>Once the router reboots, get a beer while it warms up.  This should take 1 to 2 minutes.</li>
<li>Unplug the router and plug it back in.</li>
<li>Wait while it boots (20 seconds).</li>
<li>Set your ip and default gateway:</li>
</ul>
<pre><code>
# Replace &lt;interface&gt; with whichever network interface you're using.
sudo ifconfig &lt;interface&gt; 192.168.1.100
sudo route add default gw 192.168.1.1
</code></pre>
<ul>
<li>Ping the router.  Hopefully this works…</li>
</ul>
<pre><code>
hank@rofl:~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.792 ms
</code></pre>
<ul>
<li>Send the new firmware over.  Make sure to <strong><em>set your mode to octet!</em></strong><em></em> You should see a bunch of blinky lights on the router for a few seconds, then tftp should output the number of bytes transferred.</li>
</ul>
<pre><code>
hank@rofl:~$ tftp 192.168.1.1
tftp&gt; mode octet
tftp&gt; put dd-wrt.v24_micro_wrt54gv8.bin
</code></pre>
<ul>
<li>Get another beer.  While you do that, your firmware is being reflashed and DD-WRT is booting up.  You should see the power light go on, then off, then on again, then blink, then stay on.</li>
<li>You should be able to get DHCP now.  Try it:</li>
</ul>
<pre><code>
sudo dhclient &lt;interface&gt;
</code></pre>
<ul>
<li>If that worked, head over to http://192.168.1.1 to the admin console.</li>
<li>Change the settings to your liking.  <strong>The default account is root/admin</strong></li>
<li>Change the maximum connections to 4096 and the TCP and UDP timeouts to 90 each in the main Administration page.</li>
</ul>
<p>This should yield you an awesome setup.  I’m very happy with mine.</p>
<h3>References</h3>
<p><a href="http://lifehacker.com/software/router/hack-attack-turn-your-60-router-into-a-600-router-178132.php">Hack Attack: Turn your $60 router into a $600 router</a></p>
<h3>Files</h3>
<p>Oh, and just in case DD-WRT’s site goes down in the middle of the procedure (like it did to me), here are the files:</p>
<p><a href="http://ralree.info/assets/2007/10/6/dd-wrt.v24_micro_wrt54gv8.bin">Firmware</a><br />
<a href="http://ralree.info/assets/2007/10/6/vxworkskillerv8.bin">VXWorks Killer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/10/06/hacking-a-wrt54g-v8-with-dd-wrt/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fulltext Indexing Wikipedia with Sphinx</title>
		<link>http://www.ralree.com/2007/09/15/fulltext-indexing-wikipedia-with-sphinx/</link>
		<comments>http://www.ralree.com/2007/09/15/fulltext-indexing-wikipedia-with-sphinx/#comments</comments>
		<pubDate>Sat, 15 Sep 2007 22:17:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sphinx]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/fulltext-indexing-wikipedia-with-sphinx</guid>
		<description><![CDATA[So, earlier this year, I decided it would be cool to mirror Wikipedia.  So, I successfully set up a local copy on my system, and it&#8217;s been just sitting there ever since.  But lately, I&#8217;ve been interested in fulltext indexing offered by various indexing engines, and Sphinx has looked especially tasty.  So, [...]]]></description>
			<content:encoded><![CDATA[<p>So, earlier this year, I decided it would be cool to mirror Wikipedia.  So, I successfully set up a local copy on my system, and it&#8217;s been just sitting there ever since.  But lately, I&#8217;ve been interested in fulltext indexing offered by various indexing engines, and <a href="http://www.sphinxsearch.com/">Sphinx</a> has looked especially tasty.  So, I figured I&#8217;d sit down and try it today.</p>
<p>I pointed it at my 16GB of Wikipedia text in my MySQL database.</p>
<p>            <span id="more-3411"></span></p>
<p>So, earlier this year, I decided it would be cool to mirror Wikipedia.  So, I successfully set up a local copy on my system, and it&#8217;s been just sitting there ever since.  But lately, I&#8217;ve been interested in fulltext indexing offered by various indexing engines, and <a href="http://www.sphinxsearch.com/">Sphinx</a> has looked especially tasty.  So, I figured I&#8217;d sit down and try it today.</p>
<p>I pointed it at my 16GB of Wikipedia text in my MySQL database like so:</p>
<h2>sphinx.conf</h2>
<pre><code>
source src1
{
  type        = mysql
  strip_html      = 0
  index_html_attrs  =
  sql_host      = localhost
  sql_user      = wikipedia
  sql_pass      = wikipedia
  sql_db        = wikidb
  sql_query_pre   =
  sql_query     = \
    SELECT old_id, old_text\
    FROM text
  sql_query_post    =
  sql_query_info    = SELECT * FROM text WHERE old_id=$id
}

</code></pre>
<h2>Next, I set up the indexing section.</h2>
<pre><code>
index wikipedia
{
  source      = src1
  path      = /nexus/rofl/sphinx/wikipedia.sphinx
  docinfo     = extern
  morphology      = none
  stopwords     =
  min_word_len    = 1
  charset_type    = utf-8
  min_prefix_len    = 0
  min_infix_len   = 0
}
index wikipediastemmed : wikipedia
{
  path      = /var/data/wikipediastemmed
  morphology    = stem_en
}
indexer
{
  mem_limit     = 512M
}

</code></pre>
<p>I left all the other options as default.  Next, I turned on the indexing and waited for about <strong>2.5 hours</strong>.  Now, bear in mind that 2.5 hours isn&#8217;t all that long to index this much data, especially given the results I&#8217;m about to show you.</p>
<h2>Now it&#8217;s time to test this out!</h2>
<pre><code>

hank@rofl:/usr/local/etc$ time search endothermic
## ....................................................................................................
## ....................................................................................................
## ....................................................................................................
= Sterling D. | title = Cold Fire® is a Hot Fire Extinguisher | publisher =
Company press release | date = Nov. 28, 2003 | url= http://www.greaterthings.com/News/ColdFire/pr031122.html | accessdate = August 21, 2006}}&lt;/ref&gt;
==References==
&lt;references/&gt;
== External links ==
* [http://www.firefreeze.com Fire Freeze Worldwide Inc.]

[[Category:Firefighting]]
        old_flags=utf-8
20. document=112594001, weight=1
        old_id=112594001
        old_text=#REDIRECT[[Endothermic]]
        old_flags=utf-8

words:
1. 'endothermic': 173 documents, 293 hits

real    0m0.831s
user    0m0.004s
sys     0m0.080s

hank@rofl:/usr/local/etc$ time search "hello &#038; world" &gt;/dev/null

real    0m0.659s
user    0m0.032s
sys     0m0.052s

</code></pre>
<h1>Look at that time!!  <strong>0.8 Seconds</strong> to search <strong>16GB of text</strong>!</h1>
<h2>Sphinx is indeed the master of the fulltexting.</h2>
<p>I&#8217;m very impressed.  I&#8217;m sure I will find a use for this soon.</p>
<h1>Update: It&#8217;s actually faster.</h1>
<p>Due to the comment from Sphinx&#8217;s author below, I ran a <code>searchd</code> instance with gets rid of all the overhead when searching from the command line.</p>
<p>Here are some results I got using the Ruby API that&#8217;s included with Sphinx:</p>
<pre><code>
irb(main):010:0&gt; t = Time.now; s.query('(Single &#038; mother) &#038; !father'); puts Time.now - t
0.016864
=&gt; nil
</code></pre>
<h2>It only took <strong>0.017 seconds</strong> to find all instances of single and mother without mention of father in Wikipedia&#8217;s database.</h2>
<p>This is indeed impressive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/09/15/fulltext-indexing-wikipedia-with-sphinx/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to make a Mephisto Plugin</title>
		<link>http://www.ralree.com/2007/02/26/how-to-make-a-mephisto-plugin/</link>
		<comments>http://www.ralree.com/2007/02/26/how-to-make-a-mephisto-plugin/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 00:29:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mephisto]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/how-to-make-a-mephisto-plugin</guid>
		<description><![CDATA[So, I figured I might as well provide a quick tutorial on how to make Mephisto Plugins currently.  Many of the old plugins are broken, so there needs to be a resurgence of plugin development.  Here&#8217;s the basic structure of the Tag Cloud plugin:

mephisto_tag_cloud
 - init.rb README
 - lib
   - mephisto_plugins
 [...]]]></description>
			<content:encoded><![CDATA[<p>So, I figured I might as well provide a quick tutorial on how to make Mephisto Plugins currently.  Many of the old plugins are broken, so there needs to be a resurgence of plugin development.  Here&#8217;s the basic structure of the <a href="/2007/2/25/mephisto-tag-cloud-plugin">Tag Cloud plugin</a>:</p>
<pre><code>
mephisto_tag_cloud
 - init.rb README
 - lib
   - mephisto_plugins
     - tag_cloud.rb
</code></pre>
<p>As you can see, the structure is very simple.  Here&#8217;s my code for <strong>init.rb</strong></p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="co">Liquid</span>::<span class="co">Template</span>.register_filter(<span class="co">MephistoPlugins</span>::<span class="co">TagCloud</span>)
</code></pre>
</div>
</div>
<p>That&#8217;s it!  No <code>require</code> or anything!  Next, I edited <strong>lib/mephisto_plugins/tag_cloud.rb</strong>:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="r">module</span> <span class="cl">MephistoPlugins</span>
  <span class="r">module</span> <span class="cl">TagCloud</span>
    <span class="r">def</span> <span class="fu">size_tag</span>(tag, largest = <span class="i">2</span>)
      size = (<span class="co">Tag</span>.find_by_name(tag).taggings(<span class="pc">true</span>).length + <span class="i">18</span>).to_f / <span class="i">18</span>
      size = largest <span class="r">if</span> size &gt; largest
      <span class="s"><span class="dl">&quot;</span><span class="k">&lt;span style='font-size: </span><span class="il"><span class="dl">#{</span>size<span class="dl">}</span></span><span class="k">em'&gt;&lt;a href='/tags/</span><span class="il"><span class="dl">#{</span>tag<span class="dl">}</span></span><span class="k">'&gt;</span><span class="il"><span class="dl">#{</span>tag<span class="dl">}</span></span><span class="k">&lt;/a&gt;&lt;/span&gt;</span><span class="dl">&quot;</span></span>
    <span class="r">end</span>
  <span class="r">end</span>
<span class="r">end</span>
</code></pre>
</div>
</div>
<p>Holy crap that barely any code at all!  So, the moral of the story is that it&#8217;s very easy to make the plugins once you figure out what to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/02/26/how-to-make-a-mephisto-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Doomsday Clock Tutorial</title>
		<link>http://www.ralree.com/2007/01/13/doomsday-clock-tutorial/</link>
		<comments>http://www.ralree.com/2007/01/13/doomsday-clock-tutorial/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 08:21:07 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/doomsday-clock-tutorial</guid>
		<description><![CDATA[I decided today that I need to make a tutorial to build your own doomsday clock.  After seeing this picture, I felt it was necessary:

]]></description>
			<content:encoded><![CDATA[<p>I decided today that I need to make a tutorial to build your own doomsday clock.  After seeing this picture, I felt it was necessary:</p>
<p><img src="http://modzer0.cs.uaf.edu/~hardwarehank/images/doomsday.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/01/13/doomsday-clock-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.371 seconds -->
