<?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>Mon, 05 Sep 2011 03:44:34 +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>Our DSL Modem was overheating&#8230;</title>
		<link>http://www.hungryhacker.com/hw/our-dsl-modem-was-overheating/</link>
		<comments>http://www.hungryhacker.com/hw/our-dsl-modem-was-overheating/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 03:44:34 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[heatsink]]></category>
		<category><![CDATA[nastyhax]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=241</guid>
		<description><![CDATA[Every summer, without fail, our DSL likes to drop on hot evenings.
I even bought another modem at a yard sale, thinking that maybe ours was on the fritz &#8211; but no&#8230; same M.O.: laggy/lossy connection, then no connection, go downstairs and the modem&#8217;s really hot to the touch. It probably doesn&#8217;t help that it&#8217;s in a small closet under our stairs with the router and everything else, but even if we keep the door open with a box fan blowing in there it still does it.
As I was throwing away ...]]></description>
			<content:encoded><![CDATA[<p>Every summer, without fail, our DSL likes to drop on hot evenings.</p>
<p>I even bought another modem at a yard sale, thinking that maybe ours was on the fritz &#8211; but no&#8230; same M.O.: laggy/lossy connection, then no connection, go downstairs and the modem&#8217;s really hot to the touch. It probably doesn&#8217;t help that it&#8217;s in a small closet under our stairs with the router and everything else, but even if we keep the door open with a box fan blowing in there it still does it.</p>
<p><a title="Turbocharged DSL Modem by fwaggle, on Flickr" href="http://www.flickr.com/photos/fwaggle/5933683015/"><img class="alignleft" style="float: left;" src="http://farm7.static.flickr.com/6027/5933683015_84f6760284_m.jpg" alt="Turbocharged DSL Modem" width="240" height="180" /></a>As I was throwing away a bunch of old stuff, I happened upon an old add-on DVR I&#8217;d bought to steal the drive out of. I opened the lid just to see if there was anything else in there I may want, and there it is &#8211; a small square heatsink just the perfect size for the little ARM (I think? Could be MIPS though) CPU in our SpeedStream 4100. I pulled it off, then used a razor to scrape all the old thermal pad off. I mixed up some thermal expoxy, applied a really thin layer and glued it to the top of the CPU in the modem, as you can see on the left.</p>
<p>We since went about 4 nights with no disconnects, despite the fact the top of the heatsink still got a bit warm to the touch. I was not taking any chances though, I wanted to attach a fan to it as well.</p>
<p><a title="Turbocharged DSL Modem by fwaggle, on Flickr" href="http://www.flickr.com/photos/fwaggle/5933685171/"><img class="alignright" style="float: right;" src="http://farm7.static.flickr.com/6124/5933685171_0588352a6e_m.jpg" alt="Turbocharged DSL Modem" width="240" height="180" /></a>It&#8217;s been a while since I&#8217;ve had an excuse to get this uhh&#8230;. <a href="http://www.afrotechmods.com/">AfroTech</a> on any project. I&#8217;m terminally lazy and still obsessed with genuinely attempting to do things The Right Way, so this site hasn&#8217;t seen much action as of late. Anyway, I grabbed an old squirrelcage fan I&#8217;ve had laying around a while &#8211; I don&#8217;t know how many CFM this thing is rated for, but let me tell you on 12v it is like a hair dryer. I scrounged up an old 5vDC PSU to power it because I didn&#8217;t quite need it to roar that bad.</p>
<p><a title="Turbocharged DSL Modem by fwaggle, on Flickr" href="http://www.flickr.com/photos/fwaggle/5933687035/"><img class="alignleft" style="float: left;" src="http://farm7.static.flickr.com/6018/5933687035_7a6a49b9a5_m.jpg" alt="Turbocharged DSL Modem" width="240" height="180" /></a>I cut a hole in the top of the DSL modem for the heatsink to poke through into the front of the fan. I thought about having the exhaust blow inwards, but frankly it looked stupid &#8211; not to mention flimsy. In the end I decided to go negative pressure, with the exhaust blowing off the side.</p>
<p>The top of the modem is quite curved, so it really didn&#8217;t fit all that well when I affixed the fan to it. So I broke out some latex based sealent and caked it around the gaps. The air is sucked in via the vents under the board, makes its way around the board and over the heatsink and out the exhaust.</p>
<p>So I took a break from authoring this post, and it&#8217;s now about a week short of 2 months since I started working on it. The uptime on the modem speaks for itself:</p>
<p><code>Time Since Last Sync 031 days 20:56:49</code></p>
<p>I actually rebooted the modem at that time on purpose, it turned out it was a problem at AT&amp;T&#8217;s end. For all intents and purposes, the modem&#8217;s been up and synced since I plugged it in. Considering we&#8217;ve had some really really hot days here, that&#8217;s a huge improvement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/hw/our-dsl-modem-was-overheating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review: Logitech G330 Headset</title>
		<link>http://www.hungryhacker.com/other/review-logitech-g330-headset/</link>
		<comments>http://www.hungryhacker.com/other/review-logitech-g330-headset/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 18:34:10 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=234</guid>
		<description><![CDATA[Ever since I started using Ventrilo and Teamspeak waaaaaaaay back in the day, I&#8217;ve always just used my USB headset from my Playstation2. It was made by Logitech, and served me well on SOCOM and friends, so I thought it&#8217;d be fine on Vent. Fast forward almost four years later, and the dog has eaten it, it&#8217;s held together by duct-tape, and the output doesn&#8217;t work so I wear it around my neck while I use another pair of headphones.
So while we were doing our after-christmas-toy-shopping, I decided there needed ...]]></description>
			<content:encoded><![CDATA[<p>Ever since I started using Ventrilo and Teamspeak waaaaaaaay back in the day, I&#8217;ve always just used my USB headset from my Playstation2. It was made by Logitech, and served me well on SOCOM and friends, so I thought it&#8217;d be fine on Vent. Fast forward almost four years later, and the dog has eaten it, it&#8217;s held together by duct-tape, and the output doesn&#8217;t work so I wear it around my neck while I use another pair of headphones.</p>
<p>So while we were doing our after-christmas-toy-shopping, I decided there needed to be room in the budget for a new headset. I ended up going with the <a href="http://peen.us/g330">Logitech g330</a>, and here&#8217;s what I think after using them a few months with Mumble.</p>
<h2>The good&#8230;</h2>
<p><strong>These things are comfortable.</strong> You&#8217;ll read that in almost every review, so allow me to elaborate a little bit. My old headphones (sans microphone) were also the behind-the-ear type, but that little over-ear strap to keep them from sliding down around your neck would start to make my ears ache after a while. I can literally wear these things for hours, and sometimes after everyone gets off Mumble I still have them on my head and I don&#8217;t notice.</p>
<p><strong>They don&#8217;t echo.</strong> My old headset had it&#8217;s microphone boom made out of hard plastic &#8211; it was the bit that snapped and is held together with duct tape. I never really noticed it until I started using Mumble, but that hard plastic transmits vibrations from the headphone speaker, up the boom and back into the mic. The g330&#8242;s boom is made from the same shit as Gumby, and do you ever hear of people complaining about Gumby echoing? I didn&#8217;t think so.</p>
<p><strong>They sound reasonable.</strong> Let&#8217;s be honest, they&#8217;re no <a href="http://peen.us/sennheiser">Sennheisers</a>, but they&#8217;re not awful. Apparently I sound a lot less &#8220;telephony&#8221; than I did before, but I&#8217;m not sure how much of that is because the mic is better and how much of it is due to the above-mentioned echo factor, and Mumble not trying to de-echo it.</p>
<p><strong>They&#8217;re USB and 3.5mm.</strong> This was one of the selling points to me. I like to be able to use them on my PC as well as my PS3. When on my PC, I will generally use the sound card&#8217;s output because I think it sounds just a hint better than the USB, and it doesn&#8217;t disappear as a Windows device when I unplug the headset.</p>
<p>When I plug it into my PS3, I need a USB for the Microphone &#8211; but I probably don&#8217;t want to hear just the <em>voice comms</em>, I want to hear everything. Having headphones on and still using my TV&#8217;s speakers would put me at a huge disadvantage in an FPS. So I plug only the mic into the USB adapter, and the headphone plug into the TV. Bingo bango, best of both worlds.</p>
<h2>The Bad&#8230;</h2>
<p><strong>They sound reasonable.</strong> I mean, this isn&#8217;t entirely bad, but I don&#8217;t want a reader to come away thinking these are the best sounding things ever. The fact they sit on your ear instead of around it doesn&#8217;t really help, I don&#8217;t think (and might be why I think even my cheap-ass older headphones sound marginally better on output).</p>
<p><strong>The cable&#8217;s a bit short.</strong> Not a huge deal &#8211; it&#8217;s long enough that if your PC is on your desk, it&#8217;ll reach without you sitting all weird. If your PC is on the floor, you might have to do some re-arranging. Compared to the old PS2 Logitech headphones, with what seems like 10&#8242; of cable, it&#8217;s a big difference. It&#8217;s non-trivial to use these things while sitting on a couch in front of a TV &#8211; you will likely want a USB extender or something similar &#8211; or you could upgrade to a wireless/Bluetooth headset.</p>
<h2>The conclusion:</h2>
<p>These were definitely a good buy, in my humble opinion. I&#8217;m not only a moderately-avid gamer, I also run a <a href="http://www.mumbledog.com">Mumble host</a>&#8230; so naturally I use the shit out of these things, and I really have never had a situation where I wished I&#8217;d bought something better.</p>
<p>I bought mine at Best Buy for about $35, simply because I had to have them right then. If you check <a href="http://peen.us/g330">eBay</a>, there are probably better deals &#8211; but be warned there are certainly much worse deals too ($75? Who the fuck are you kidding?).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/other/review-logitech-g330-headset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD on Linode</title>
		<link>http://www.hungryhacker.com/os/freebsd-on-linode/</link>
		<comments>http://www.hungryhacker.com/os/freebsd-on-linode/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 16:55:53 +0000</pubDate>
		<dc:creator>fwaggle</dc:creator>
				<category><![CDATA[Operating Systems]]></category>

		<guid isPermaLink="false">http://www.hungryhacker.com/?p=226</guid>
		<description><![CDATA[Judging from the Google search results, this is a pretty hot-button issue&#8230; there are plenty of claims it works, but no one wants to say how it&#8217;s done. What follows is a rough essay taken directly from my notes, which was repeated multiple times so I believe I got all the kinks out of it, and ended up with a &#8220;working&#8221; FreeBSD 8.1-R i386 installation on a Linode. I say &#8220;working&#8221; because it has a tendency to crash under heavy load &#8211; there&#8217;s clearly still much work to be done ...]]></description>
			<content:encoded><![CDATA[<p>Judging from the Google search results, this is a pretty hot-button issue&#8230; there are plenty of claims it works, but no one wants to say how it&#8217;s done. What follows is a rough essay taken directly from my notes, which was repeated multiple times so I believe I got all the kinks out of it, and ended up with a &#8220;working&#8221; FreeBSD 8.1-R i386 installation on a Linode. I say &#8220;working&#8221; because it has a tendency to crash under heavy load &#8211; there&#8217;s clearly still much work to be done on FreeBSD&#8217;s paravirtualization code.</p>
<p><strong>Note: </strong>These instructions worked for me, but I can&#8217;t guarantee there&#8217;s not something I did by &#8220;muscle memory&#8221; and didn&#8217;t document. I repeated this process about 6 or 7 times, and each time found something new I&#8217;d forgotten to write down. It also stands to reason that these instructions may stop working at any point, for any reason &#8211; I can&#8217;t provide support for these instructions as by the time you read this I will likely not have a Linode any longer. <img src='http://www.hungryhacker.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>First, you&#8217;ll need a <a href="http://www.linode.com/?r=a89f3508f373297a30ea4ffc1f9a67ab4b61d3b7">Linode</a>, if you don&#8217;t already have one &#8211; any size will do, depending on what you actually want to do with it&#8230; but there&#8217;s no minimum Linode size for FreeBSD itself. Then next thing you&#8217;ll want to do is <strong>file a ticket with support</strong> &#8211; Linodes default to vcpus=4, which will choke FreeBSD at the moment. They won&#8217;t increase this setting of course, but they will happily lower it for you. Simply give them your Linode # and ask them to reduce vcpus to 1 and they&#8217;ll make the change. You can continue setting everything up, they&#8217;ll just tell you that the Linode needs to be powered off and restarted before the setting will take effect &#8211; which we&#8217;ll do when we go to boot FreeBSD anyway &#8211; and chances are by the time they respond you&#8217;ll be about ready to reboot into FreeBSD for the first time.</p>
<h3>Configuring the Disks</h3>
<p>Go into the Linode manager, and trash any existing configuration it may have generated for you, along with any disks. Create a new disk image, 64MB should be plenty, and make it ext2 &#8211; we&#8217;ll be using this disk to store our FreeBSD kernels, PV-GRUB&#8217;s configuration, that sort of thing.</p>
<p>Next, create a ~512MB or so raw disk, which we&#8217;ll be dd&#8217;ing a FreeBSD image over in a rather nasty fashion. Make it whatever size you need for your image, most FreeBSD &#8220;minimal&#8221; images weigh in at around 200MB or so, so 512MB should be plenty.</p>
<p>Finally, use up the rest of your disk space with another &#8220;raw&#8221; disk image, which is where our main FreeBSD installation will live.</p>
<h3>Setting up Profiles</h3>
<p>Next, create a new profile&#8230; I called mine &#8220;finnix&#8221; but you can call it &#8220;Linux Rescue&#8221; or anything you like. Set it&#8217;s kernel as &#8220;Recovery (finnix)&#8221;, set xvda to the &#8220;recovery &#8211; finnix (iso)&#8221;, xvdb to your ext2 kernel storage disk, xvdc to your temporary FreeBSD root (the littler one), and set the initrd to &#8220;finnix (initrd)&#8221;.</p>
<p>Create another new profile, we&#8217;ll call this one &#8220;FreeBSD&#8221;. Set kernel to pv-grub, 32-bit (might be called x86_32 or something), xvda is your kernel store, xvdb is your main FreeBSD disk, xvdc is your &#8220;rescue&#8221; FreeBSD disk.</p>
<p>Note: laying the disks out this way will have the unfortunate side-effect of having your main disk live on xbd1 in FreeBSD &#8211; there&#8217;s no way around this, the ext2 disk has to be disk zero for GRUB to run unattended. <img src='http://www.hungryhacker.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p style="text-align: center;"><a title="FreeBSD on Linode" href="http://www.flickr.com/photos/51922402@N00/5026168683/"><img class="alignnone" src="http://farm5.static.flickr.com/4131/5026168683_f00e89fb18_o.png" alt="FreeBSD on Linode" /></a></p>
<h3>Booting into finnix</h3>
<p>Finnix is a &#8220;live CD&#8221; style Linux, which will work from a RAMdisk and not occupy or otherwise hold any disks, leaving you free to do things like dd images over them and such. Now we need a kernel &#8211; you have two options here. One, you can build one yourself on another machine, put it on a webserver, and curl it across; or two you can use the one graciously provided by Aprogas in <a href="http://forums.freebsd.org/showthread.php?t=10268">this forum thread</a>. If you decide to use his images (I did to bootstrap the process), I&#8217;d suggest mirroring them someplace yourself in case you screw up and need to do it multiple times.</p>
<p>If you&#8217;re building your own kernel, see the notes below &#8211; at the time of writing the default XEN kernel won&#8217;t work.</p>
<p>Now we need to put our kernel in place:</p>
<pre># mount /dev/xvdb /mnt
# curl http://path.to/kernel.gz | gunzip &gt; /mnt/kernel
# umount /mnt</pre>
<p>Now extract and write the image over your temporary root disk:</p>
<pre># curl http://path.to/root.img.gz | gunzip &gt; /dev/xvdc</pre>
<p>Sync (I&#8217;m not sure if this is necessary, but it&#8217;s a habit) and reboot:</p>
<pre># sync
# reboot</pre>
<p>From the Linode manager or LISH, boot your FreeBSD profile. You should end up at the grub menu, so point it directly at your kernel (I&#8217;m led to believe chain loading the BSD loader won&#8217;t work under paravirtualization):</p>
<pre>grubdom&gt; kernel (hd0)/kernel
grubdom&gt; boot</pre>
<p>Because we bypassed the FreeBSD loader, it&#8217;s extremely probably FreeBSD won&#8217;t know where to find it&#8217;s root partition. We&#8217;ll point it at our temporary root partition:</p>
<pre>mountroot&gt; ufs:/dev/xbd2s1a</pre>
<p>You should now have booted FreeBSD, and be able to login as root (you&#8217;re on the console, and if you&#8217;re using Aprogas&#8217;s image, there will be no password on root at the moment).</p>
<h3>Installation</h3>
<p>There&#8217;s a lot of gotchas in this portion, so try and pay attention to what you&#8217;re doing (and don&#8217;t rely on me). First thing to do is fdisk /dev/xbd1 and note the geometry, because for some reason the fdisk inside sysinstall won&#8217;t be able to tell it, and will set it to 0/0/0, which will cause sysinstall to blow up when you try to partition the drive.</p>
<p>Start sysinstall, and go into fdisk. Set your geometry as noted before (mine was: cylinders=2015 heads=255  sectors/track=63), and then use the entire disk for a Freebsd slice. Write your changes, then back out to the label editor. Create your partitions how you&#8217;d like them&#8230; for testing I just made a 512MB swap (not sure if I&#8217;d need it or not), and then used the rest of the disk for one giant partition. Set the mountpoints for your partitions with root as /mnt, because / is already in use at the moment. Write your changes out, no boot loader (I&#8217;m pretty sure it doesn&#8217;t work anyway) then bail out of sysinstall.</p>
<p>When you&#8217;re out of sysinstall, mount all your partitions under /mnt, because for me they wouldn&#8217;t stay mounted inside sysinstall. You might need to newfs them, I did sometimes and didn&#8217;t others.</p>
<p>Back into sysinstall, go into options and pick your OS version (any kernel you&#8217;re likely to build is going to have -pX on the end of it, which will not be a valid FTP path for installation), and then <em>make sure</em> you set the install root to /mnt.</p>
<p>Back out, and do a standard install, without clobbering any of your partitions. I can&#8217;t recall if you need to set the geometry again if you&#8217;re not actually writing anything out. Select your distributions and install them, if you&#8217;re using Aprogas&#8217;s images the network is already configured (DHCP). Let it fly.</p>
<p>Once you&#8217;re out of sysinstall, make sure all your partitions are mounted, then configure /mnt/etc/fstab the way it should be&#8230; it&#8217;s very likely sysinstall didn&#8217;t wind up making one, but if it did, it may not be sane &#8211; it may have /mnt as the mount points for everything, and you&#8217;ll want to set them back to /.</p>
<p>Also ensure that /mnt/etc/rc.conf is correct &#8211; it may not even exist. You probably want at least sshd_enable=&#8221;YES&#8221; in it. Finally, chroot /mnt, set a root password, and create at least one non-root account. Make sure it&#8217;s in wheel.</p>
<p>Exit chroot, unmount everything and reboot. At the grub profile again:</p>
<pre>grubdom&gt; kernel (hd0)/kernel
grubdom&gt; boot</pre>
<p>Then this time at the kernel&#8217;s &#8220;where the hell is my root partition&#8221; prompt (actual location of your root partition may vary):</p>
<pre>mountroot&gt; ufs:/dev/xbd1s1d</pre>
<p>If everything went according to plan, you should be inside of a working FreeBSD installation at this point&#8230; but it won&#8217;t boot unattended. If your kernel has ext2fs compatibility, you can fix that from inside FreeBSD (otherwise it&#8217;s back to finnix). Either way, mount your kernel store partition under say, /mnt, then:</p>
<pre># mkdir -p /mnt/boot/grub
# cat &gt; /mnt/boot/grub/menu.lst
default 0
timeout 5
title FreeBSD
kernel (hd0)/kernel
^D
# umount /mnt</pre>
<p>Now PV-GRUB should boot unattended (sidenote, i have &#8220;timeout 5&#8243;, but for some reason grub instantly boots freebsd). I haven&#8217;t figured out how to pass the root partition to the kernel yet, so see the notes below about compiling that into the kernel.</p>
<h3>Compiling a new Kernel</h3>
<p>8.0-RELEASE kernels will boot and apparently function fine in Linode if they&#8217;re built with the XEN configuration. Anything newer will panic on boot because of the new x86bios stuff, which is called from atkbd, but Linodes don&#8217;t actually use the atkbd device (console functions fine without it)&#8230;</p>
<p>&#8230; so copy the XEN config to something (I called mine &#8220;LINODE&#8221;) and edit it. I commented out the lines for atkbd, aktbdc, kbdmux, and psm &#8211; though I&#8217;m not sure all that is necessary.</p>
<p>If you haven&#8217;t already got it, you&#8217;ll likely want &#8220;options EXT2FS&#8221; so you can install new kernels without shipping them off to another machine and rebooting into finnix. Finally, you&#8217;ll need to tell FreeBSD kernel where to find it&#8217;s root partition so I used:</p>
<pre>options ROOTDEVNAME=\"ufs:xbd1s1d\"</pre>
<p>Build and install your new kernel, noting that it&#8217;ll land in /boot/kernel. You need to get it over to the kernel store where GRUB can find it &#8211; if you have EXT2FS compatability, that&#8217;s as simple as mounting the ext2 partition in /mnt, and cp /boot/kernel/kernel /mnt/kernel. Unmount all partitions and reboot.</p>
<p>At first I didn&#8217;t have EXT2FS compatibility, so I had to gzip the kernel, scp it to another webserver, boot into finnix and curl it back the same way we initially got the kernel up.</p>
<p>Finally, at the time of writing you&#8217;ll be spammed with messages (approximately one every 10 seconds) about the &#8220;hypervisor wallclock nudging TOD&#8221;. It doesn&#8217;t appear to effect anything, so I commented this message out in the kernel sources (sys/i386/xen/clock.c:344 at the time of writing)&#8230; that&#8217;s probably bad, but that&#8217;s up to you.</p>
<p>One more boot, and the Linode should boot completely unattended, including when it falls and can&#8217;t get up and lassie needs to restart it. Which will happen. A lot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hungryhacker.com/os/freebsd-on-linode/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>1</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>5</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>3</slash:comments>
		</item>
	</channel>
</rss>

