<?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>Hungry Hacker</title>
	<atom:link href="http://www.hungryhacker.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hungryhacker.com</link>
	<description>The Hungry Hacker&#039;s Explanation of Everything</description>
	<lastBuildDate>Tue, 20 Jul 2010 20:26:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Buggy Digital Volume Controls</title>
		<link>http://www.hungryhacker.com/hw/buggy-digital-volume-controls/</link>
		<comments>http://www.hungryhacker.com/hw/buggy-digital-volume-controls/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 20:21:36 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=221</guid>
		<description><![CDATA[My Yamaha HTR-5540 has one of those digital volume controls on it&#8230; the kind that if it&#8217;s off, you can keep turning it. The last couple years it&#8217;s started doing this thing where I&#8217;d be turning it down and it&#8217;d go +1-1+2-1+1-1+2-1. The net result after volume spasming is an increase in volume &#8211; not really what you want at the time.
I decided to take it apart and try and clean the &#8220;pot&#8221; &#8211; it&#8217;s not really a potentiometer, but that&#8217;s what many people would call it anyway and cleaning ...]]></description>
			<content:encoded><![CDATA[<p>My <a href="/exit.html?ebaysearch=yamaha+htr+receiver">Yamaha HTR-5540</a> has one of those digital volume controls on it&#8230; the kind that if it&#8217;s off, you can keep turning it. The last couple years it&#8217;s started doing this thing where I&#8217;d be turning it down and it&#8217;d go +1-1+2-1+1-1+2-1. The net result after volume spasming is an increase in volume &#8211; not really what you want at the time.</p>
<p>I decided to take it apart and try and clean the &#8220;pot&#8221; &#8211; it&#8217;s not really a potentiometer, but that&#8217;s what many people would call it anyway and cleaning it is basically the same principle. It took me a few minutes to get into the machine and access to the front of the volume control &#8211; it involved removing the top cover, then the entire face (after disconnecting a couple of ribbon cables), and then removing the PCB from the plastic face.</p>
<p><a title="Yamaha HTR-5540 &quot;Pot&quot;" href="http://www.flickr.com/photos/51922402@N00/4813270744/"><img class="alignleft" style="float: left;" src="http://farm5.static.flickr.com/4098/4813270744_5cf612d350_t.jpg" alt="Yamaha HTR-5540 &quot;Pot&quot;" /></a>Once I got access to the front of the &#8220;pot&#8221;, I pried open the four tabs holding it together. I grabbed a can of my trusty <strong>CRC 2-26</strong>*, and sprayed a bit in there before putting it back together and twisted it a bit. After pressing the tabs back together, I carefully put the ribbon cables back on, plugged everything in and gave it a shot. There was still some obvious scratchiness and/or errors, but it was markedly better.</p>
<p>I made sure the tabs were down tight, and reassembled the entire unit. Now that I&#8217;ve got a working volume control again (and I don&#8217;t have to find what the hell the kids did with the remote), my receiver works perfectly for my PS3 and my <a href="/hw/spdif-output-on-asus-k8s-la-salmon/">PC&#8217;s digital output</a>.</p>
<p>* A word about 2-26 and spray &#8220;lubricants&#8221;. 2-26 is, according to the manufacturer, a plastic-safe precision lubricant that displaces water and can improve the electrical contact properties of things like switches, relays and stuff. WD-40, on the other hand, is advertised as a lubricant, but I&#8217;ve had terrible luck using at as such. While it doesn&#8217;t seem like it&#8217;s billed as such, in most situations I&#8217;ve used it it acts as a degreaser. Based on my experience cleaning volume controls and such, I wholeheartedly recommend you make the trip to Lowes or wherever and pick up some 2-26 instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/hw/buggy-digital-volume-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing an Office Chair</title>
		<link>http://www.hungryhacker.com/other/fixing-an-office-chair/</link>
		<comments>http://www.hungryhacker.com/other/fixing-an-office-chair/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 02:47:50 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=215</guid>
		<description><![CDATA[Where the hell do I put this?
Anyone that knows me knows I&#8217;m basically a hop skip and a jump from a clinical hoarding dysfunction &#8211; okay it&#8217;s probably not that bad, I really only tend to hang onto things I feel might be useful some day. It&#8217;s worked out pretty good, because that&#8217;s how most of this site came to be.
For some reason, I held onto an office chair that had the wheel broken off of it somehow. Don&#8217;t ask why, I probably won&#8217;t tell. Anyway, while reaching behind her, ...]]></description>
			<content:encoded><![CDATA[<p>Where the hell do I put <em>this</em>?</p>
<p>Anyone that knows me knows I&#8217;m basically a hop skip and a jump from a clinical hoarding dysfunction &#8211; okay it&#8217;s probably not that bad, I really only tend to hang onto things I feel might be useful some day. It&#8217;s worked out pretty good, because that&#8217;s how most of this site came to be.</p>
<p>For some reason, I held onto an office chair that had the wheel broken off of it somehow. Don&#8217;t ask why, I probably won&#8217;t tell. Anyway, while reaching behind her, probably to do something with our new baby, my wife managed to snap the arm on her cheap Target office chair &#8211; unfortunately the arms on most office chairs are an integral part of the structure of the chair, rendering it pretty much useless.</p>
<p>It struck me to make one out of two, and my original plan of attack was simply to unscrew the screws that went into the bottom of the butt-cushion, and swap bases over. That didn&#8217;t work because my old chair, being an &#8220;executive&#8221; model chair had a high back and that obviously meant needed the screws approximately an eighth of an inch further apart.</p>
<p><a title="Fixing an Office Chair - Retaining Clip" href="http://www.flickr.com/photos/51922402@N00/4755589041/"><img class="alignleft" style="float: left;" src="http://farm5.static.flickr.com/4075/4755589041_09109464f0_t.jpg" alt="Fixing an Office Chair - Retaining Clip" /></a>What I found next was a small &#8220;retaining clip&#8221; on a shaft at the bottom that appeared to match on both chairs. After gingerly removing it and carefully dismantling the chair, I discovered that they indeed were a match.</p>
<p><a title="Fixing an Office Chair" href="http://www.flickr.com/photos/51922402@N00/4755589935/"><img class="alignright" style="float: right;" src="http://farm5.static.flickr.com/4096/4755589935_4a7e8c456c_t.jpg" alt="Fixing an Office Chair" /></a>I picked the better looking set of bearings (trivial really, considering the ones in mind were destroyed, see photo), put some good old axle grease in there and reassembled my chair on Sabriena&#8217;s wheels/base.</p>
<p>The end result, while rough and obviously worn, is a chair that&#8217;ll probably last us until we get enough money to buy another one&#8230; like any sane person would have by this point.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/other/fixing-an-office-chair/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Buying a little more time from my Microsoft Optical Mouse</title>
		<link>http://www.hungryhacker.com/hw/microsoft-mouse-fix/</link>
		<comments>http://www.hungryhacker.com/hw/microsoft-mouse-fix/#comments</comments>
		<pubDate>Sun, 23 May 2010 22:39:54 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[soldering]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=185</guid>
		<description><![CDATA[I love my mouse. No, I don&#8217;t think you quite understand &#8211; I love my mouse. It&#8217;s not like it&#8217;s anything special either, you can get one off of eBay for about five bucks&#8230; but of course it was about $35 when I got it, back when optical mouses were still somewhat new. In fact it&#8217;s only quite recently that most new computers came with an optical mouse.
But even so, this mouse has served me well. It&#8217;s now called the &#8220;Microsoft Optical Mouse Basic&#8220;, but back when I got it ...]]></description>
			<content:encoded><![CDATA[<p>I love my mouse. No, I don&#8217;t think you quite understand &#8211; I <em>love</em> my mouse. It&#8217;s not like it&#8217;s anything special either, <a href="/exit.html?ebaysearch=microsoft+optical+mouse+basic">you can get one off of eBay</a> for about five bucks&#8230; but of course it was about $35 when I got it, back when optical mouses were still somewhat new. In fact it&#8217;s only quite recently that most new computers came with an optical mouse.</p>
<p>But even so, this mouse has served me well. It&#8217;s now called the &#8220;<a href="/exit.html?ebaysearch=microsoft+optical+mouse+basic">Microsoft Optical Mouse Basic</a>&#8220;, but back when I got it I think it was just called the &#8220;Optical Wheel Mouse&#8221;. Regardless, it&#8217;s out-lived virtually all my wife&#8217;s mousing devices, most of which have been the wireless variety. I&#8217;m now used to the cord on it, we have quite the rapport and it never seems to get in the way&#8230; and it&#8217;s nice not having to change out batteries every freakin&#8217; month.</p>
<p>Unfortunately though I have this rather nasty habit of highlighting and un-highlighting text while I read it. It annoys my wife no-end, the constant click-click-clicking while I&#8217;m engrossed in something particularly interesting, but I figure at least it&#8217;s better than me mutilating my fingers which is my other annoying concentration-habit.</p>
<p>The end result is that the micro-switch for my left mouse button has reached the end of it&#8217;s operating life. It <a href="http://en.wikipedia.org/wiki/Switch#Contact_bounce">bounces</a> now, and dragging anything with it is a nightmare. I have a new mouse on the way (I actually bought one already, but it&#8217;s defective so it went back, and now I&#8217;m waiting again), but I can&#8217;t keep using my computer like this.</p>
<p><a title="Mouse Guts" href="http://www.flickr.com/photos/51922402@N00/4632946797/"><img class="alignleft" style="float: left;" src="http://farm5.static.flickr.com/4027/4632946797_ee433a4726_t.jpg" alt="Mouse Guts" /></a>So I took my mouse apart with a view to switch out the left mouse button switch from another mouse &#8211; unfortunately they&#8217;re different switches and it won&#8217;t physically fit in my mouse&#8230; so I came up with a hackish solution in the mean time. I simply de-soldered the left mouse-button switch, and the switch under the middle mouse button, and swapped them.</p>
<p>I reasoned that the occasional, unintentional double-click on the middle mouse button probably wouldn&#8217;t anger me as much as the much more likely double-left-click&#8230; and how often do you ever drag with the middle mouse button on Windows systems?</p>
<p>Never.</p>
<p>So it should live until my new mouse gets here, at which point it&#8217;ll serve me well as a backup or for when I&#8217;m roped into fixing some asshole&#8217;s computer. Also, I apologize for the lack of technical content in this article. <img src='http://www.hungryhacker.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/hw/microsoft-mouse-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lspci for Windows&#8230; Sort of&#8230;</title>
		<link>http://www.hungryhacker.com/os/lspci-win32/</link>
		<comments>http://www.hungryhacker.com/os/lspci-win32/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 18:22:04 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=176</guid>
		<description><![CDATA[Spike on IRC was commenting about how much of a pain in the arse it is to track down drivers for unknown hardware on Windows, and how easy it is under Linux using lspci. I sat and thought about it &#8211; lspci can&#8217;t possibly pluck hardware strings from nowhere, there has to be some sort of database&#8230; and there is, and best of all there&#8217;s a web-based front end to it.
So here&#8217;s how to do it yourself in a few easy steps&#8230; first, right-click My Computer and choose properties. Then, ...]]></description>
			<content:encoded><![CDATA[<p><strong>Spike</strong> on IRC was commenting about how much of a pain in the arse it is to track down drivers for unknown hardware on Windows, and how easy it is under Linux using <a href="http://linux.die.net/man/8/lspci">lspci</a>. I sat and thought about it &#8211; lspci can&#8217;t possibly pluck hardware strings from nowhere, there has to be some sort of database&#8230; and there is, and best of all there&#8217;s a <a href="http://pci-ids.ucw.cz/read/PC/">web-based front end to it</a>.</p>
<p>So here&#8217;s how to do it yourself in a few easy steps&#8230; first, <strong>right-click My Computer and choose properties</strong>. Then, go to the <strong>Hardware tab</strong>, and pick <strong>Device Manager</strong>.</p>
<p><a title="lspci for Windows" href="http://www.flickr.com/photos/51922402@N00/4554797903/"><img class="alignleft" style="float: left;" src="http://farm4.static.flickr.com/3179/4554797903_1ecc773908_t.jpg" alt="lspci for Windows" /></a></p>
<p>Navigate to your unknown device, double-click it and then pick the <strong>Details tab</strong>. Find the <strong>Hardware Ids</strong> entry, and look for the most detailed entry. My shitty SiS network adaptor&#8217;s is &#8220;<em>PCI\VEN_1039&amp;DEV_0900</em>&#8220;.</p>
<p>Navigate to the PCI Devices database in a browser on an internet-connected computer. In my case, I&#8217;m looking for vendor ID 1039, so I&#8217;ll click &#8220;1&#8243; and scroll down&#8230; and I&#8217;ll find the Vendor &#8220;Silicon Integrated Systems [SiS]&#8220;, which is to be expected. Click into the Vendor entry and look for the Device ID.</p>
<p>That should hopefully give you the correct Google-snacks to track down a driver for the hardware. <img src='http://www.hungryhacker.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/os/lspci-win32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Super-caching with TimThumb</title>
		<link>http://www.hungryhacker.com/sw/super-caching-with-timthumb/</link>
		<comments>http://www.hungryhacker.com/sw/super-caching-with-timthumb/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 20:26:12 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=165</guid>
		<description><![CDATA[This website doesn&#8217;t actually use TimThumb &#8211; our hack of the Arthemia theme instead uses Flickr for all it&#8217;s image hosting, so it&#8217;s just easier to hack the theme to understand how to pull different sizes of Flickr images instead.
However, we have another site that my wife&#8217;s internet services company hosts that needed to be optimized for Digg/Slashdot-style surges, and it does use TimThumb &#8211; extensively in fact.
The Problem
TimThumb does have a caching engine built in which will, if your permissions are set up correctly, prevent the thumbnail from having ...]]></description>
			<content:encoded><![CDATA[<p>This website doesn&#8217;t actually use <a href="http://code.google.com/p/timthumb/">TimThumb</a> &#8211; our hack of the <a href="http://michaelhutagalung.com/2008/05/arthemia-magazine-blog-wordpress-theme-released/">Arthemia</a> theme instead uses <a href="http://flickr.com/">Flickr</a> for all it&#8217;s image hosting, so it&#8217;s just easier to hack the theme to understand how to pull different sizes of Flickr images instead.</p>
<p>However, we have another site that my wife&#8217;s internet services company hosts that needed to be optimized for Digg/Slashdot-style surges, and it does use TimThumb &#8211; extensively in fact.</p>
<h2>The Problem</h2>
<p>TimThumb does have a caching engine built in which will, if your permissions are set up correctly, prevent the thumbnail from having to be re-generated each request. However, it does require the PHP script to run each time to return the cached file (in fact, the PHP script simply takes all the arguments, concatenates them together, generates an MD5 hash, then looks for that file).</p>
<p>If you&#8217;re using mod_php, this probably isn&#8217;t a huge deal&#8230; it&#8217;s not going to be the bottleneck for surges of traffic &#8211; mod_php and your heavy-weight Apache processes will be. If you&#8217;re using php-cgi or php-fcgi, however, having quite a few thumbnails on the page (such as themes like Arthemia) is going to cause you quite a headache. You could have at least 10 or 15 extra php processes per page load&#8230; even required to just answer an If-Modified-Since request!</p>
<h2>Proposed Solution: Hack TimThumb</h2>
<p>I don&#8217;t know if this is the greatest idea, but it seems to work. Our idea was simply to make TimThumb cache files in the same manner that Donncha&#8217;s WP-Super-Cache plugin does, and then the web server can simply fling out pre-thumbnailed images all day long without invoking php at all.</p>
<p>The first thing we had to do was modify TimThumb to save cached thumbnails in this manner, for which you can find a rough patch here:</p>
<ul>
<li><a href="/downloads/patches/timthumb.supercache.diff">Patch for  TimThumb to enable path-based caching</a></li>
</ul>
<p>It&#8217;s not perfect, because it requires you to edit the script and point it at your thumbnails directory. We made ours /thumbs in the website&#8217;s root directory, and you have to point it at the<em> operating system&#8217;s fully-qualified</em> path to that directory. We then saved the modified version of the script into our /thumbs/ directory so we could access it easily.</p>
<p>The format is then /thumbs/&lt;width&gt;/&lt;height&gt;/&lt;path/to/image&gt;. A quick check of the file system shows it&#8217;s caching the files properly and finding the cached versions okay. Now to remove PHP from the equation.</p>
<h2>Rewrite Rules</h2>
<p><code>%cat .htaccess<br />
RewriteEngine On<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule ^([0-9]+)/([0-9]+)/(.+)$ /thumbs/timthumb.php?src=$3&amp;w=$1&amp;h=$2&amp;zc=1&amp;q=100 [L]</code></p>
<p>I stole this rewrite rule from WP-Super-Cache, basically it just checks if the file isn&#8217;t a file, and it isn&#8217;t a directory, and then passes it in an argument to TimThumb. You can edit the zoom/crop and quality settings globally here &#8211; if you want them adjustable on a per-image basis you&#8217;ll need to hack the script to include those in the cache path instead.</p>
<p>If the file exists (which it will, if it&#8217;s been cached) Apache can simply pass that file out as a static file, PHP is never invoked for that image. When combined with nginx as a reverse proxy, we&#8217;ve found this resulted in a dramatic increase in performance for just one page-view alone. Because of our WP-Super-Cache rules for nginx will also work for these cached images, nginx can hand out upwards of around 7,000 thumbnails a second &#8211; more than enough to saturate a gigabit pipe on reasonable hardware.</p>
<h2>Editing the Theme</h2>
<p>Next up is editing the theme to call our new thumbnail URL &#8211; unfortunately, there&#8217;s no way around this process&#8230; it&#8217;s tedious. Replace:</p>
<p><code>&lt;p&gt;&lt;img src="&lt;?php echo bloginfo('template_url'); ?&gt;/scripts/timthumb.php?src=&lt;?php echo get_option('home'); ?&gt;/&lt;?php<br />
$values = get_post_custom_values("Image"); echo $values[0]; ?&gt;&amp;amp;w=&lt;?php echo $width; ?&gt;&amp;amp;h=&lt;?php echo $height; ?&gt;&amp;amp;zc=1&amp;amp;q=100"<br />
alt="&lt;?php the_title(); ?&gt;" width="&lt;?php echo $width; ?&gt;px" height="&lt;?php echo $height; ?&gt;px"  /&gt;&lt;/p&gt;</code></p>
<p>with:</p>
<p><code>&lt;p&gt;&lt;img src="/thumbs/&lt;?php echo $width; ?&gt;/&lt;?php echo $height; ?&gt;/&lt;?php<br />
$values = get_post_custom_values("Image"); echo $values[0]; ?&gt;"<br />
alt="&lt;?php the_title(); ?&gt;" width="&lt;?php echo $width; ?&gt;px" height="&lt;?php echo $height; ?&gt;px"  /&gt;&lt;/p&gt;</code></p>
<h2>Caveats</h2>
<p>There are a couple of downsides to this&#8230; first of all, there&#8217;s no automatic garbage collection. I don&#8217;t suppose it&#8217;s that big of a deal, because realistically you&#8217;re probably going to want to keep the thumbnailed images around anyway.</p>
<p>As mentioned above, unless you want to hack your URL scheme to include those arguments &#8211; you lose the ability to control the quality and the zoom/crop arguments on a per-image basis.</p>
<h2>Related Links</h2>
<ul>
<li><a href="/downloads/patches/timthumb.supercache.diff">Patch for TimThumb to enable path-based caching</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/sw/super-caching-with-timthumb/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Low-pressure Spyder with Pure Energy Regulator</title>
		<link>http://www.hungryhacker.com/paintball/low-pressure-spyder-with-pure-energy-regulator/</link>
		<comments>http://www.hungryhacker.com/paintball/low-pressure-spyder-with-pure-energy-regulator/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 22:31:52 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Paintball]]></category>
		<category><![CDATA[spyder]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=61</guid>
		<description><![CDATA[When I bought this el-cheapo regulator from a paintball shop, they said it wouldn&#8217;t really be suitable for low-pressure. Well, it turns out they&#8217;re wrong! According to the Pure Energy Vertical Inline Regulator manual, the default configuration is good from 550 to 900 PSI. Removal of a shim from inside the regulator body drops the adjustable range from 275 to 500 PSI &#8211; about the working range I&#8217;m thinking to be optimal for my low-pressure marker.
Removing the shim couldn&#8217;t be easier &#8211; shown in the picture to the left is ...]]></description>
			<content:encoded><![CDATA[<p>When I bought this el-cheapo regulator from a paintball shop, they said it wouldn&#8217;t really be suitable for low-pressure. Well, it turns out they&#8217;re wrong! According to the <a href="http://www.paintballsolutions.com/?page_id=69">Pure Energy Vertical Inline Regulator manual</a>, the default configuration is good from 550 to 900 PSI. Removal of a shim from inside the regulator body drops the adjustable range from 275 to 500 PSI &#8211; about the working range I&#8217;m thinking to be optimal for my low-pressure marker.</p>
<p><a title="Pure Energy Regulator" href="http://www.flickr.com/photos/51922402@N00/4528852437/"><img class="alignleft" style="float: left;" src="http://farm5.static.flickr.com/4022/4528852437_a543f15770_t.jpg" alt="Pure Energy Regulator" /></a>Removing the shim couldn&#8217;t be easier &#8211; shown in the picture to the left is my regulator, taken apart because my O-rings were bad. It&#8217;s not necessary to disassemble the bottom &#8220;swivel feed&#8221; of the regulator like I have, just remove it from your marker&#8217;s ASA, then grab the two sections shown in the photo and unscrew them apart. Note that the bottom potion &#8220;swivels&#8221; and if you&#8217;re trying to turn the regulator body in relation to the inlet tube you&#8217;ll get a whole lotta nowhere.</p>
<p>Once you have it in two pieces (there&#8217;s a spring in there but it shouldn&#8217;t shoot apart like a blow-back marker does when you take out the field-strip pin) remove the short, fat main spring. Underneath it, probably stuck to the piston is the shim. If it&#8217;s stuck, take something soft-ish like a pencil and push the piston out gently, then use something like an exacto-knife to separate the shim from the piston.</p>
<p><a title="Pure Energy Regulator" href="http://www.flickr.com/photos/51922402@N00/4528854375/"><img class="alignleft" style="float: left;" src="http://farm5.static.flickr.com/4007/4528854375_e4243e382b_t.jpg" alt="Pure Energy Regulator" /></a>To the left, you can see the mainspring and the shim out of the regulator, and stuck together. You should be able to separate them with your fingers, the only thing that was holding them together on mine was the surface tension of the lubricant from inside the regulator. By the way, unless you&#8217;re planning on lubricating the regulator, try not to wipe off too much of the lubricant.</p>
<p>It should then just be a simple matter of putting everything but the shim back in the regulator the way you found it, and re-assembling your marker. You&#8217;ll have to play with the adjuster to get the pressure where you want it, I&#8217;m going to wait until my gauge and new springs get here before playing with it further, so expect another post in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/paintball/low-pressure-spyder-with-pure-energy-regulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UPnP-IGD on FreeBSD with PF</title>
		<link>http://www.hungryhacker.com/os/upnp-igd-on-freebsd-with-pf/</link>
		<comments>http://www.hungryhacker.com/os/upnp-igd-on-freebsd-with-pf/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:17:24 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://test.hungryhacker.com/?p=49</guid>
		<description><![CDATA[I used to always run either OpenBSD or FreeBSD powered routers &#8211; basically since around 2000 (before that it was Linux, but we don&#8217;t speak of those days anymore). In recent years, starting with my Cayman 3546 router I just started enjoying the simplicity that appliance-type devices offered.
Our most recent setup has been a Linksys WRT54G, which has been rather crap in it&#8217;s duties really. For some reason it&#8217;s consistently dropping packets and possibly rebooting (but with the garbage default firmware, there&#8217;s absolutely no way to tell if it&#8217;s rebooted ...]]></description>
			<content:encoded><![CDATA[<p>I used to always run either OpenBSD or FreeBSD powered routers &#8211; basically since around 2000 (before that it was Linux, but we don&#8217;t speak of those days anymore). In recent years, starting with my Cayman 3546 router I just started enjoying the simplicity that appliance-type devices offered.</p>
<p>Our most recent setup has been a Linksys WRT54G, which has been rather crap in it&#8217;s duties really. For some reason it&#8217;s consistently dropping packets and possibly rebooting (but with the garbage default firmware, there&#8217;s absolutely no way to tell if it&#8217;s rebooted or not) so I decided to replace it with a FreeBSD machine again &#8211; at least temporarily.</p>
<p>Networking in fwaggle-land these days is not without it&#8217;s new challenges, bumped well up from &#8220;lolsecurityissue&#8221; to &#8220;must have, design requirement&#8221; is Universal Plug and Play, or UPNP for short.</p>
<h2>The Lowdown on UPNP</h2>
<p>UPNP-IGD is both a terrible idea and an awesome idea at the same time &#8211; or more accurately: it&#8217;s an awesome idea, but a terrible implementation. Basically in it&#8217;s &#8220;Internet Gateway Device&#8221; form, it allows devices behind a firewall to arbitrarily set up port forwarding and open those ports temporarily, completely transparently to the user. For computing, this is probably unwanted &#8211; malware can easily make use of it and your firewall&#8217;s essentially useless.</p>
<p>But for gaming on consoles, it&#8217;s a godsend. It&#8217;s the difference between an awful experience on a Playstation 3, and an event-free, enjoyable gaming experience.</p>
<h2>Setting up Routing</h2>
<p>For the purposes of this article (which is already long enough, thanks to my story-telling) I&#8217;ll assume you&#8217;re familiar with setting up NAT under FreeBSD. We&#8217;re also going to assume you&#8217;re using the PF packet filter from OpenBSD &#8211; if you&#8217;re not and you&#8217;re clever enough to work out setting up NAT with one of the others, figuring out PF can be done in an afternoon.</p>
<p>We&#8217;ll assume at this point that your machine is up, routing and translating traffic correctly and is protected by some form of firewall ruleset in PF. We&#8217;re also going to assume you have a working DHCP server and all your machines are able to connect to the internet in some form. Now we make the top of your PF ruleset look like this:</p>
<p><samp>scrub on dsl0 no-df<br />
nat on dsl0 from lan0:network to any -&gt; (dsl0) static-port<br />
rdr-anchor miniupnpd</samp></p>
<p>Obviously interface names need changing (or you can rename your interfaces, like I did &#8211; which requires only a one-line change in /etc/rc.conf if you happen to swap cards out for a different card/driver later on, instead of grepping for fxp0 in /usr/local/etc/. Reload the ruleset in PF if you haven&#8217;t already:</p>
<p><samp>pfctl -f /etc/pf.conf</samp></p>
<p>Let&#8217;s explain what&#8217;s going on here. First of all, it appears as though PF might scrub at least partially by default these days &#8211; I&#8217;m not sure about this, I haven&#8217;t confirmed it, but my Playstation was complaining about fragmented packets not going through and some Google searching appeared to indicate the PS3 likes to do dumb shit like sending fragmented packets with the DF bit set. This rule helped immensely and removed all complaints from my PS3 once miniupnpd was enabled.</p>
<p>Adding static-port prevents PF from re-arranging port numbers on the WAN side as it makes sense, which might break stuff occasionally, but for our purposes it&#8217;ll break far more if PF re-arranges port numbers on UDP traffic &#8211; internet games on consoles are stupid. If Modern Warfare 2 sends game data from port 3658, to another host on port 3658, and the packet doesn&#8217;t arrive with source port 3658, the host appears to drop it.</p>
<h2>Configuring MiniUPNPd</h2>
<p>Now that you have an anchor set up for MiniUPNPd to add rules to, it&#8217;s time to configure the daemon itself. Copy the miniupnpd.conf.sample to miniupnpd.conf in /usr/local/etc, and then start editing it with your favourite editor. The important bits I changed are:</p>
<p><samp>ext_ifname=dsl0 # the interface name of your WAN device<br />
listening_ip=10.0.0.1 # the LAN IP of your router<br />
secure_mode=yes # this is default, but I wanted to point out what a great idea it is<br />
allow 1024-65535 0.0.0.0/0 1024-65535 # access control, but you can do it via PF anyway</samp></p>
<p>secure_mode is important &#8211; UPNP-IGD specs allow devices to set up firewall rules for other devices, which is where the broken-by-design issues with regards the UPNP spec come into play. You almost certainly do not want to allow this, and I can&#8217;t for the life of me figure out any reason you would need such functionality.</p>
<p>Access control can be configured based on IPs, you can also firewall the UPNP service (UDP port 5555) so that your network doesn&#8217;t appear to even support UPNP for hosts that you&#8217;d rather not have it. Our network is configured to assign all consoles into a /24 of their own, and to only allow those IPs to use the UPNP service. You can be as draconian as you like with UPNP access control, either via MiniUPNPd&#8217;s configuration or just by firewalling the UPNP service.</p>
<h2>Testing it out</h2>
<p>The first step was testing the internet configuration in the network settings menu. After correctly allowing UPNP, I successfully reached &#8220;NAT Type 2&#8243; as far as the Playstation 3 is concerned. Next it was time to test if a game would actually work, so I loaded up Modern Warfare 2 and tried it out. At first I had &#8220;NAT Type: Strict&#8221; which basically meant that I was boned, until I found the above gotcha about source ports. Adding a static-port keyword to my ruleset in PF and reloading gave me &#8220;NAT Type: Open&#8221;, and I was all set.</p>
<p>With our PS3s in their own subnet, I&#8217;m able to enjoy hassle-free internet gaming without sacrificing the security of the rest of our network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/os/upnp-igd-on-freebsd-with-pf/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>S/PDIF Output on Asus K8S-LA &#8220;Salmon&#8221;</title>
		<link>http://www.hungryhacker.com/hw/spdif-output-on-asus-k8s-la-salmon/</link>
		<comments>http://www.hungryhacker.com/hw/spdif-output-on-asus-k8s-la-salmon/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 19:46:09 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[pcm]]></category>
		<category><![CDATA[soldering]]></category>

		<guid isPermaLink="false">http://test.hungryhacker.com/?p=29</guid>
		<description><![CDATA[Ever since I got a PlayStation 2 and found the joy of games that support Pro Logic II, I&#8217;ve had a thing for surround sound. It&#8217;s like this perverse fixation that gives me a boner every time &#8211; you haven&#8217;t played games like Need for Speed: Underground 2 or Ace Combat 5 until you&#8217;ve played them with Pro Logic II. Seriously, the effect is that dramatic.
The PS3 is even better because most games support Dolby Digital 5.1 native &#8211; the PS2 lacked the processing power to generate this signal dynamically, ...]]></description>
			<content:encoded><![CDATA[<p>Ever since I got a PlayStation 2 and found the joy of games that support Pro Logic II, I&#8217;ve had a thing for surround sound. It&#8217;s like this perverse fixation that gives me a boner every time &#8211; you haven&#8217;t played games like <a href="http://fwaggle.org/lnk/nfsu2">Need for Speed: Underground 2</a> or <a href="http://fwaggle.org/lnk/acecombat5">Ace Combat 5</a> until you&#8217;ve played them with Pro Logic II. Seriously, the effect is that dramatic.</p>
<p>The PS3 is even better because most games support Dolby Digital 5.1 native &#8211; the PS2 lacked the processing power to generate this signal dynamically, only pre-rendered cut-scenes had Dolby Digital.</p>
<p>I started out modest &#8211; an old &#8220;Paramount&#8221; Pro Logic decoder, which I eventually traded in for a Yamaha 5.1 receiver. This thing is great &#8211; it&#8217;ll fill up a huge room with modest speakers no trouble at all, and it&#8217;s been in our &#8220;great room&#8221; since we moved out here. Unfortunately, our &#8220;nice TV&#8221; broke permanently, and we shut off our satellite TV in favor of streaming NetFlix&#8230; meaning my beautiful receiver was relegated to my younger brothers in law playing PS2 on it.</p>
<p>This morning I decided enough of that, I&#8217;d bring it up here and use it in our bedroom. Story time over: I decided to see if I could hack digital output from my HP Pavilion a1213w desktop. I checked the motherboard, it&#8217;s an Asus K8S-LA &#8220;Salmon&#8221; board&#8230; bit of a piece of shit really, but it does the job.</p>
<p><a class="flickr-image alignleft" title="S/PDIF on Asus K8S-LA" href="http://www.flickr.com/photos/fwaggle/4411082135/"><img src="http://farm5.static.flickr.com/4034/4411082135_c568a9d310_t.jpg" alt="S/PDIF on Asus K8S-LA" /></a>It sports a RealTek (ugh!) on-board audio with 5.1 output. Awesome &#8211; but no digital output in sight. Searching for the manual, I found an S/PDIF output on the board which requires a <a href="http://fwaggle.org/lnk/spdif">daughter-board to give you a coaxial/ToSLink output</a>. Check eBay &#8211; ~$20&#8230; fffffuuuuuu that.</p>
<p>A quick Google search shows plenty of <a href="http://www.frontx.com/pro/p1062_030.html">other folks hacking their own</a> so I decided to give it a shot. Ratting through my box of parts, I came up with a 4-pin CD-ROM-Audio cable from years gone past and cut it apart. I also dug out an RCA cable (I went with Coaxial for the PC since my PS3 will be using the only available ToSLink socket on the receiver) and cut it up too.</p>
<p><a class="flickr-image alignright" title="S/PDIF on Asus K8S-LA" href="http://www.flickr.com/photos/fwaggle/4411847904/"><img src="http://farm3.static.flickr.com/2702/4411847904_e316e404cc_t.jpg" alt="S/PDIF on Asus K8S-LA" /></a>A simple hack really. Pins 1+2 are ground and digital-out respectively, with the third pin being +5vdc for powering the bits for ToSLink communication&#8230; irrelevant for my purposes. I carefully cut the connector to a little larger than the three-pin connector, then used a Dremel with a sanding wheel to smooth it to a perfect three-pin shape. I pulled the unused extra wire out, since I didn&#8217;t want to accidentally short my mobo&#8217;s +5vdc. I had the black wire on the GND pin and the white on the S/PDIF pin (see diagram at left) and it was a simple matter of soldering colors to colors to connect the RCA. Route it out the back of my PC and into my receiver.</p>
<p><a class="flickr-image alignleft" title="lolrealtek" href="http://www.flickr.com/photos/fwaggle/4411874930/"><img src="http://farm3.static.flickr.com/2724/4411874930_d51acd17c7_t.jpg" alt="lolrealtek" /></a>Digging through the RealTek control panel&#8217;s &#8220;Multi-Channel Sound Manager&#8221;, the instant I clicked &#8220;Enable Digital Output&#8221; the PCM light came on my receiver and I&#8217;m good to go. Turn off all the DSP shit the kids had turned on, and my iTunes output is so manly I need chest hair supplements to keep up.</p>
<p><strong>Update:</strong> Okay so apparently my RealTek card can&#8217;t output Dolby Pro Logic II (or even anything remotely close to surround sound) over S/PDIF &#8211; PCM is it (and PCM is limited to two channels). According to <a href="http://forums.overclockers.com.au/showthread.php?t=418833">a thread on Overclockers</a>, most sound cards are limited like this&#8230; if you want surround sound in games, you&#8217;re stuck using the analog outputs and the 6ch input on my receiver.</p>
<p>So I scrounged up some 3.5mm to RCA cables, and hooked it up&#8230; and low and behold I have full surround on games like <a href="http://fwaggle.org/lnk/l4d">Left4Dead</a>. I press the 6ch button on my remote, and I&#8217;m switching back to digital output, so I can take advantage of my receiver&#8217;s vastly superior DAC for music. Not optimal, but the best I can probably do without a heinously expensive Pro Logic II capable sound card. <img src='http://www.hungryhacker.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/hw/spdif-output-on-asus-k8s-la-salmon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RedStar v2 WordPress Theme</title>
		<link>http://www.hungryhacker.com/meta/redstar-v2-wordpress-theme/</link>
		<comments>http://www.hungryhacker.com/meta/redstar-v2-wordpress-theme/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 01:59:50 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://test.hungryhacker.com/?p=15</guid>
		<description><![CDATA[So I thought since we&#8217;re gearing up to re-release the site I&#8217;d spend a little time talking about our lovely WP theme. Our goal was to create a throwback to one of the earliest themes on our website, &#8220;RedStar&#8221;, which as you might guess featured a rather prominent red star.
It also, much to the dismay of others, featured some rather politically motivated photography&#8230; in fact many of our themes did. We decided that, in the interests of a wider audience, we&#8217;d do away with that &#8211; plus we couldn&#8217;t find ...]]></description>
			<content:encoded><![CDATA[<p>So I thought since we&#8217;re gearing up to re-release the site I&#8217;d spend a little time talking about our lovely WP theme. Our goal was to create a throwback to one of the earliest themes on our website, &#8220;RedStar&#8221;, which as you might guess featured a rather prominent red star.</p>
<p>It also, much to the dismay of others, featured some rather politically motivated photography&#8230; in fact many of our themes did. We decided that, in the interests of a wider audience, we&#8217;d do away with that &#8211; plus we couldn&#8217;t find a good high-res photo that was copyright free and I&#8217;m not quite rich enough to pay for stock photography.</p>
<p>So instead, I took a high-res photo of the GU1 &#8220;Extreme&#8221; graphics board out of my Indigo2, and based the theme off of that. You can just see the tip of the SGI logo under the top of the star on our header.</p>
<p>We started coding a theme from scratch, but decided in the end to just hack up a pre-made one. We borrowed &#8220;<a href="http://michaelhutagalung.com/2008/05/arthemia-magazine-blog-wordpress-theme-released/">Arthemia</a>&#8221; from <a href="http://michaelhutagalung.com/" target="_blank">Michael Hutagalung</a>, and pretty much just reversed the color schemes. Rather than roll new images for the rounded edges, we decided to make use of CSS3&#8242;s blossoming features&#8230; after all, Google&#8217;s trashing IE6 so that gives us an excuse to as well. The great news is that it should degrade gracefully for the most part, which was always important to us.</p>
<p>As time goes by we&#8217;ll be ripping out more of the IE6-based insanity from the theme, cleaning it up and making it lighter and faster. I&#8217;m sure it&#8217;ll take us quite a while to find all the little stuff that&#8217;s buried in it, but the results will be worth it.</p>
<p>Eventually we&#8217;ll likely release it under the terms of the GPL (not my favorite license, but the license to WP and Arthemia leaves us little options) once we feel the code is clean enough.</p>
<h2>Thumbnailing</h2>
<p>We use Flickr, so we ditched the thumbnailer included in the script &#8211; TimThumb. However, it we were to use it, we would likely turbocharge TimThumb with aggressive caching.</p>
<h2>Social Media Icons</h2>
<p>In order to speed things up, we decided to take the &#8220;sociable&#8221; icons included with the theme, throw them away, spruce the icons up a bit with a couple of free icon sets (<a href="http://findicons.com/pack/2229/social_media_mini">Social Media Mini</a> and <a href="http://findicons.com/pack/2155/social_media_bookmark">Social Media Bookmark</a>, courtesy of FindIcons) and then merge them into a CSS Sprite.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/meta/redstar-v2-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Organized Chaos</title>
		<link>http://www.hungryhacker.com/meta/organized-intro/</link>
		<comments>http://www.hungryhacker.com/meta/organized-intro/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 23:08:27 +0000</pubDate>
		<dc:creator>OrganizedChaos</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://test.hungryhacker.com/your-mom/</guid>
		<description><![CDATA[Hello world, OrganizedChaos here.
Welcome to the new Hungry Hacker.  I will add more to this later.
]]></description>
			<content:encoded><![CDATA[<p>Hello world, OrganizedChaos here.</p>
<p>Welcome to the new Hungry Hacker.  I will add more to this later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/meta/organized-intro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
