<?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>Walt-O-Matic</title>
	<atom:link href="http://www.wwco.com/~wls/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wwco.com/~wls/blog</link>
	<description>Pure Walt, from Concentrated Thought</description>
	<lastBuildDate>Wed, 01 Sep 2010 01:04:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Could we not word it like that?</title>
		<link>http://www.wwco.com/~wls/blog/2010/07/29/could-we-not-word-it-like-that/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/07/29/could-we-not-word-it-like-that/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 11:42:04 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Funny Quotes]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[HOV HIV Positive toll road tollroad high occupancy vehicle lane 267 dulles wife morning commute work two more people car]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=779</guid>
		<description><![CDATA[My wife drove me into work the other day, and noticing there were two people in the car, she slid into the high occupancy lane of the toll road.
As she did so, she commented, &#8220;You&#8217;re HOV-positive.&#8221;
]]></description>
			<content:encoded><![CDATA[<p>My wife drove me into work the other day, and noticing there were two people in the car, she slid into the high occupancy lane of the toll road.</p>
<p>As she did so, she commented, &#8220;You&#8217;re HOV-positive.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/07/29/could-we-not-word-it-like-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find and Replace in Word using C# .NET</title>
		<link>http://www.wwco.com/~wls/blog/2010/07/03/find-and-replace-in-word-using-c-net/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/07/03/find-and-replace-in-word-using-c-net/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 22:24:31 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Trick]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Workaround]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[C-Sharp]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[DotNet]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[floating]]></category>
		<category><![CDATA[footers]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[MS]]></category>
		<category><![CDATA[MS-WORD]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[region]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[shapes]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[textbox]]></category>
		<category><![CDATA[textboxes]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Visual]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=754</guid>
		<description><![CDATA[Solution to how to do a global search and replace in MS-Word, including across floating text objects, in C#/.NET.]]></description>
			<content:encoded><![CDATA[<p>Heads up, this article contains high quantity of geek content.  Non-geeks should move along.</p>
<p>I&#8217;ve been trying to use Microsoft.Office.Interop.Word to perform a global bulk search and replace operations across an entire document. The problem was, however, if a document contained a floating text box, which manifested itself as a shape object of type textbox, the find and replace wouldn&#8217;t substitute the text for that region.  Even using Word&#8217;s capability to record a macro and show the VBA code wasn&#8217;t helpful, as the source code in BASIC wasn&#8217;t performing the same operation as inside the Word environment.</p>
<p>What I wanted was a simple routine to replace text anywhere inside of a document.  If you Google for this you&#8217;ll get the wrong kind of textbox, the wrong language, people telling you not to use floating textboxes, and all kinds of weird story iterators.</p>
<p>One site seemed to have <A HREF="http://word.mvps.org/FAQs/Customization/ReplaceAnywhere.htm">the solution</A>; many kind thanks to <a href="http://word.mvps.org/AboutMVPs/doug_robbins.htm">Doug Robbins</a>, <a href="http://word.mvps.org/AboutMVPs/greg_maxey.htm">Greg Maxey</a>, Peter Hewett, and <a href="http://word.mvps.org/AboutMVPs/jonathan_west.htm">Jonathan West</a> for coming up with this solution and explaining it so well.</p>
<p>However, the solution was in Visual Basic for Applications, and I needed a C# solution for a .NET project.  Here&#8217;s my port, which works with Office 2010 and Visual Studio 2010 C#/.NET 4.0.  I&#8217;ve left a lot of redundant qualifiers and casting on to help people searching for this article.</p>
<pre class="brush: plain;">
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Office.Interop.Word;

// BEGIN: Somewhere in your code
Application app = null;
Document doc = null;
try
{
  app = new Microsoft.Office.Interop.Word.Application();

  doc = app.Documents.Open(filename, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing);

  FindReplaceAnywhere(app, find_text, replace_text);

  doc.SaveAs(outfilename, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing);
}
finally
{
  try
  {
      if (doc != null) ((Microsoft.Office.Interop.Word._Document) doc).Close(true, Missing, Missing);
  }
  finally { }
  if (app != null) ((Microsoft.Office.Interop.Word._Application) app).Quit(true, Missing, Missing);
}
// END: Somewhere in your code             

// Helper
private static void searchAndReplaceInStory(Microsoft.Office.Interop.Word.Range rngStory, string strSearch, string strReplace)
{
    rngStory.Find.ClearFormatting();
    rngStory.Find.Replacement.ClearFormatting();
    rngStory.Find.Text = strSearch;
    rngStory.Find.Replacement.Text = strReplace;
    rngStory.Find.Wrap = WdFindWrap.wdFindContinue;

    object arg1 = Missing; // Find Pattern
    object arg2 = Missing; //MatchCase
    object arg3 = Missing; //MatchWholeWord
    object arg4 = Missing; //MatchWildcards
    object arg5 = Missing; //MatchSoundsLike
    object arg6 = Missing; //MatchAllWordForms
    object arg7 = Missing; //Forward
    object arg8 = Missing; //Wrap
    object arg9 = Missing; //Format
    object arg10 = Missing; //ReplaceWith
    object arg11 = WdReplace.wdReplaceAll; //Replace
    object arg12 = Missing; //MatchKashida
    object arg13 = Missing; //MatchDiacritics
    object arg14 = Missing; //MatchAlefHamza
    object arg15 = Missing; //MatchControl

    rngStory.Find.Execute(ref arg1, ref arg2, ref arg3, ref arg4, ref arg5, ref arg6, ref arg7, ref arg8, ref arg9, ref arg10, ref arg11, ref arg12, ref arg13, ref arg14, ref arg15);
}

// Main routine to find text and replace it,
//   var app = new Microsoft.Office.Interop.Word.Application();
public static void FindReplaceAnywhere(Microsoft.Office.Interop.Word.Application app, string findText, string replaceText)
{
    // http://forums.asp.net/p/1501791/3739871.aspx
    var doc = app.ActiveDocument;

    // Fix the skipped blank Header/Footer problem
    //    http://msdn.microsoft.com/en-us/library/aa211923(office.11).aspx
    Microsoft.Office.Interop.Word.WdStoryType lngJunk = doc.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.StoryType;

    // Iterate through all story types in the current document
    foreach (Microsoft.Office.Interop.Word.Range rngStory in doc.StoryRanges)
    {

        // Iterate through all linked stories
        var internalRangeStory = rngStory;

        do
        {
            searchAndReplaceInStory(internalRangeStory, findText, replaceText);

            try
            {
                //   6 , 7 , 8 , 9 , 10 , 11 -- http://msdn.microsoft.com/en-us/library/aa211923(office.11).aspx
                switch (internalRangeStory.StoryType)
                {
                    case Microsoft.Office.Interop.Word.WdStoryType.wdEvenPagesHeaderStory: // 6
                    case Microsoft.Office.Interop.Word.WdStoryType.wdPrimaryHeaderStory:   // 7
                    case Microsoft.Office.Interop.Word.WdStoryType.wdEvenPagesFooterStory: // 8
                    case Microsoft.Office.Interop.Word.WdStoryType.wdPrimaryFooterStory:   // 9
                    case Microsoft.Office.Interop.Word.WdStoryType.wdFirstPageHeaderStory: // 10
                    case Microsoft.Office.Interop.Word.WdStoryType.wdFirstPageFooterStory: // 11

                        if (internalRangeStory.ShapeRange.Count &gt; 0)
                        {
                            foreach (Microsoft.Office.Interop.Word.Shape oShp in internalRangeStory.ShapeRange)
                            {
                                if (oShp.TextFrame.HasText != 0)
                                {
                                    searchAndReplaceInStory(oShp.TextFrame.TextRange, findText, replaceText);
                                }
                            }
                        }
                        break;

                    default:
                        break;
                }
            }
            catch
            {
                // On Error Resume Next
            }

            // ON ERROR GOTO 0 -- http://www.harding.edu/fmccown/vbnet_csharp_comparison.html

            // Get next linked story (if any)
            internalRangeStory = internalRangeStory.NextStoryRange;
        } while (internalRangeStory != null); // http://www.harding.edu/fmccown/vbnet_csharp_comparison.html
    }

}
</pre>
<p>Let me know if it worked for you; bug fixes and enhancements welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/07/03/find-and-replace-in-word-using-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holiday Inn, Holiday Over</title>
		<link>http://www.wwco.com/~wls/blog/2010/06/19/holiday-inn-holiday-over/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/06/19/holiday-inn-holiday-over/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 23:07:39 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[avoid]]></category>
		<category><![CDATA[bad]]></category>
		<category><![CDATA[beach]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[holiday]]></category>
		<category><![CDATA[hotel]]></category>
		<category><![CDATA[inn]]></category>
		<category><![CDATA[mertyl]]></category>
		<category><![CDATA[motel]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=720</guid>
		<description><![CDATA[As with most things, it&#8217;s the little details that matter, and for my most recent vacation, everything about staying at Holiday Inn got on my last nerve, so much so that we checked out a day early on a pre-paid room and were glad to do so. This blog is simply a note to myself, [...]]]></description>
			<content:encoded><![CDATA[<p>As with most things, it&#8217;s the little details that matter, and for my most recent vacation, everything about staying at Holiday Inn got on my last nerve, so much so that we checked out a day early on a pre-paid room and were glad to do so. This blog is simply a note to myself, reminding me to avoid that chain when booking hotels in the future.</p>
<p><img alt="Overdraft and Bad WiFi" src="http://www.wwco.com/~wls/livejournal/HolidayInnHolidayOver.png" title="Overdraft and Bad WiFi" class="aligncenter" width="450" height="246" /></p>
<p>So I won&#8217;t forget the why: in my opinion, the first sign something wasn&#8217;t right was literally a sign indicating they would put a hold on accounts that may result in overdraft fees that wouldn&#8217;t then be their fault; nice welcome. There was no in-room refrigerator so we couldn&#8217;t store food or drinks over night.  There were no tissues.  The toilet always took three attempts to flush. The toilet paper was on the opposite wall of the toilet, better than an arm&#8217;s reach away (brilliant).  The tub felt like the was grit on the bottom of it.  The toilet was crammed between the sink and the tub, just enough to bang one&#8217;s elbows.  Same with the soap dishes in the tub, at elbow height.  It was a horrible room design, where just slightly too much space was squeezed out.  For instance, if you sat in a chair, you hit your head on the lamp.  There was no exhaust fan in the bathroom. The wireless was horribly slow and kept requiring an annoying re-authentication process at random. Our room keys spontaneously and simultaneously stopped working, and when we went to the front desk to get them fixes, we were blamed for having them near a cell phone, that we know for a fact that wasn&#8217;t the case.  I could go on, but I just wanted enough keywords so I could later find that place I didn&#8217;t ever want to stay at again.</p>
<p>Admittedly, some of this could have been the room, that hotel, its staff, or that chain. I feel little inclination to explore the matter further, I&#8217;m annoyed that much that I&#8217;m just done.  I don&#8217;t expect perfection, but I also don&#8217;t want to loath returning to have to deal with the next surprise; certainly not on vacation.</p>
<p>But further related insult, though now not too surprising in retrospect, came when we were walking around Broadway at the Beach and noticed a number of signs at ticket areas that said Medieval Times Dinner &amp; Tournament‎, 2 adults for $20.  It was a deal that sounded too good to be true, and was.  There was no branding or other information on the sign, but when one went to purchase the tickets, you couldn&#8217;t; what you got was a rep whipping out an appointment calendar for a timeshare tour.  If you would go take their off-site multi-hour tour and listen to a sales pitch, they&#8217;d &#8220;give&#8221; you the tickets for &#8220;free.&#8221;  But if you wanted to buy what they advertised, they&#8217;d never sell them to you.  It was very bait and switch.  Turns out, it was&#8230; Holiday Inn.  When asked how come it didn&#8217;t say Holiday Inn or indicate there was a sales pitch, we were flat out told that people wouldn&#8217;t come in if they had put up the truth.  This just solidified my vision of the corporate image.</p>
<p>Your own experiences may vary, but having stayed at other places in the same price range, I&#8217;m avoiding this chain.</p>
<p><strong>Walt gives Holiday Inn one thumb down.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/06/19/holiday-inn-holiday-over/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Help Wanted, Carpenter</title>
		<link>http://www.wwco.com/~wls/blog/2010/06/17/help-wanted-carpenter/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/06/17/help-wanted-carpenter/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 19:15:00 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Humor Photos]]></category>
		<category><![CDATA[carpenter]]></category>
		<category><![CDATA[cross]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[highway]]></category>
		<category><![CDATA[jesus]]></category>
		<category><![CDATA[lead]]></category>
		<category><![CDATA[sign]]></category>
		<category><![CDATA[wanted]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=734</guid>
		<description><![CDATA[My wife was driving down a highway in Pennsylvania and looking out the window I saw a scene before me that made me say out loud, &#8220;Oh, that&#8217;s just not right.&#8221;  I instructed my wife to make the next available U-Turn and pull onto the shoulder.  I needed a photo.

There before us was [...]]]></description>
			<content:encoded><![CDATA[<p>My wife was driving down a highway in Pennsylvania and looking out the window I saw a scene before me that made me say out loud, &#8220;Oh, that&#8217;s just not right.&#8221;  I instructed my wife to make the next available U-Turn and pull onto the shoulder.  I needed a photo.</p>
<p><img alt="Makes me wonder what happened to the last one they had." src="http://www.wwco.com/~wls/livejournal/help-wanted-carpenter.png" title="Help Wanted, Carpenter" class="aligncenter" width="450" height="106" /></p>
<p>There before us was a sign that said &#8216;Help Wanted&#8217; &#8216;Lead Carpenter&#8217;.  And, behind it, a set of three crosses, one that belonged to a carpenter.  Either way you look at it, that something happened to their last one, or that the need make more crosses, that&#8217;s most likely not the best location for this particular help wanted sign.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/06/17/help-wanted-carpenter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pages: 16 Exabytes</title>
		<link>http://www.wwco.com/~wls/blog/2010/05/10/pages-16-exabytes/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/05/10/pages-16-exabytes/#comments</comments>
		<pubDate>Mon, 10 May 2010 21:49:28 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Bug Report]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[Humor Photos]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=714</guid>
		<description><![CDATA[Pages just asked OS X for 16 Exabytes.  Got a clue just how large that is?]]></description>
			<content:encoded><![CDATA[<p>So I decided to make some business cards using Pages, however after adding a few tiny JPGs, I started getting the spinning beach ball &mdash; you know the one, the one you&#8217;re never supposed to get in OS X.</p>
<p>So, I decided to open Activity Monitor to see what was up.  </p>
<p>Pages had allocated 16 Exabytes of memory.  My computer has 6 Gig.</p>
<p>Remember, it goes from Megabytes, to Gigabytes (1,000Meg), to Terabytes (1,000Gig), to Petabytes (1,000 TB), to Exabytes (1,000 PB).</p>
<p><CENTER><IMG SRC="http://www.wwco.com/~wls/livejournal/Pages-16Exabytes.png" WIDTH="457" HEIGHT="472" BORDER="1" ALT="16 Exabytes"></CENTER></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/05/10/pages-16-exabytes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netflix Recommends</title>
		<link>http://www.wwco.com/~wls/blog/2010/05/10/netflix-recommends/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/05/10/netflix-recommends/#comments</comments>
		<pubDate>Mon, 10 May 2010 21:13:55 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[Humor Photos]]></category>
		<category><![CDATA[Speculation]]></category>
		<category><![CDATA[Television]]></category>
		<category><![CDATA[Web Places]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=705</guid>
		<description><![CDATA[WTF did Netflix recommend this?]]></description>
			<content:encoded><![CDATA[<p>Apparently because I like John Clease&#8217;s comedic timing, cursing magicians, and canceled 80s comedies, that means I like Carl Sagan&#8217;s COSMOS.</p>
<p><CENTER><IMG SRC="http://www.wwco.com/~wls/livejournal/NetflixRecommends.png" WIDTH="457" HEIGHT="256" BORDER="1" ALT="Netflix Recommends"></CENTER></p>
<p>Here&#8217;s the sad part: they&#8217;re right.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/05/10/netflix-recommends/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An expensive TV recommendation</title>
		<link>http://www.wwco.com/~wls/blog/2010/04/02/an-expensive-tv-recommendation/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/04/02/an-expensive-tv-recommendation/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 22:40:12 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Mishap]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=700</guid>
		<description><![CDATA[So, I&#8217;m at work and we&#8217;re discussing addictive television programs.
My co-worker turns to me and says, &#8220;Have you seen Breaking Bad?&#8221;
I&#8217;m like, &#8220;No. Is it any good?&#8221;
He says, &#8220;It sure is!&#8221;  And then he goes on to tell me how it&#8217;s on AMC, and that&#8217;s it&#8217;s about a chemistry teacher that turns into a [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;m at work and we&#8217;re discussing addictive television programs.</p>
<p>My co-worker turns to me and says, &#8220;Have you seen <a href="http://www.amctv.com:80/originals/breakingbad/about/">Breaking Bad</a>?&#8221;</p>
<p>I&#8217;m like, &#8220;No. Is it any good?&#8221;</p>
<p>He says, &#8220;It sure is!&#8221;  And then he goes on to tell me how it&#8217;s on AMC, and that&#8217;s it&#8217;s about a chemistry teacher that turns into a drug kingpin.  The how and why are part of the enticing drama.</p>
<p>So, I pull out my little scrap paper and write &#8216;<strong>breaking bad</strong>&#8216; in my notes to remind myself to TiVo it.</p>
<p>Normally the story would end there, but my wife happened to empty out my pockets, saw the note &#8220;breaking bad,&#8221; assumed my spelling was atrocious, and concluded she needed to take my car in to have repairs done.</p>
<p>$230 dollars later I&#8217;ve got shiny new brakes.  &#8220;Funny thing is,&#8221; I&#8217;m told, &#8220;the shop didn&#8217;t think they needed replacing.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/04/02/an-expensive-tv-recommendation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Server Problems</title>
		<link>http://www.wwco.com/~wls/blog/2010/04/02/virtual-server-problems/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/04/02/virtual-server-problems/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 22:30:17 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=687</guid>
		<description><![CDATA[I recently switched operating system vendors, and to my surprise when I went to port over the web content from one system to another, things didn&#8217;t go as smoothly as I had hoped.  What used to be /etc/httpd was now /etc/apache2, and inside this directory files were organized differently that I was used to, [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched operating system vendors, and to my surprise when I went to port over the web content from one system to another, things didn&#8217;t go as smoothly as I had hoped.  What used to be /etc/httpd was now /etc/apache2, and inside this directory files were organized differently that I was used to, and so forth.  Still, I would have hoped moving from Apache2 on RedHat to  Apache2 on Ubuntu would have been easier.</p>
<p>Empirical evidence was suggesting that all of my user&#8217;s virtual sites were working, but all of mine, no matter where I had them on the system, were reporting the error: <STRONG>You don&#8217;t have permission to access / on this server.</STRONG></p>
<p>Here&#8217;s what was going on, primarily recounted so if I ever do this to myself in the future, I&#8217;ll know what to look for.</p>
<p>The virtual host files, which now appear in <strong>/etc/apache2/sites-available</strong> as <strong>*.conf</strong> files, had a slight difference.  Some of them had this in their Directory directive:</p>
<ul>Order allow,deny<br />
allow from all</ul>
<p>Mine did not.  But, then again, some other websites did not as well.  Turns out those directives were placed inside their <strong>.htaccess</strong> files.</p>
<p>Now, not all sites had the .htaccess file, and things had been working before without the explicit directive in each virtual host .conf file.</p>
<p>Turns out I had some how tromped on the <STRONG>default</STRONG> file, which contains a directive that looks like this:</p>
<ul>&lt;Directory /&gt;
<ul>Options FollowSymLinks<BR>AllowOverride None</ul>
<p>&lt;/Directory&gt;</ul>
<p>If it is not present, then all virtual hosts <em>must</em> explicitly allow access (via .htaccess or their .conf file).</p>
<p>This directive allows Apache to serve up any file the URL asks for&#8230; which one may not want to do.  It seems the secure way <em>is</em> to edit the virtual host .conf files, and not rely on some default magic.</p>
<p>But, because that was in my old configuration long ago, and not in the new one, my virtual host .conf files didn&#8217;t have it, but my more modern ones for my users did.  Depending on which template I used to base new sites off was how some sites worked and some didn&#8217;t.</p>
<p>After fixing this, I ran into a new problem.  Some sites weren&#8217;t coming up still, but this time with permission errors.</p>
<p>When I migrated over the web content, it preserved user and group ownerships from the other system.  These did not match the new Apache2 user and group on the new system.</p>
<p>However, I got lucky.  There was no user/group mapping on the new system, which meant I could execute a find command to find and fix them.  It looked something like this:</p>
<ul>find /home -nogroup -print<br />
find /home -nouser -print<br />
find /home -group 49 -exec chgrp www-data &#8216;{}&#8217; \;</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/04/02/virtual-server-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Level Perspective</title>
		<link>http://www.wwco.com/~wls/blog/2010/02/14/a-level-perspective/</link>
		<comments>http://www.wwco.com/~wls/blog/2010/02/14/a-level-perspective/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 19:58:00 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Funny Quotes]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[App]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Level]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=684</guid>
		<description><![CDATA[There are a lot of applications available for the iPhone, and thanks to the magic that makes orientation detection possible, some clever person produced an application that visually shows a level, bubble and all.

Today I was witness to a young child asking to borrow an iPhone, and with much curiosity he opened this particular application.
Unfamiliar [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of applications available for the iPhone, and thanks to the magic that makes orientation detection possible, some clever person produced an application that visually shows a level, bubble and all.</p>
<p><CENTER><IMG SRC="http://wwco.com/~wls/livejournal/iPhoneLevel.jpg" WIDTH="400" HEIGHT="264" ALT="iPhone Level"></CENTER></p>
<p>Today I was witness to a young child asking to borrow an iPhone, and with much curiosity he opened this particular application.</p>
<p>Unfamiliar with a level, it&#8217;s function, or operation, he innocently asked, &#8220;What one was supposed to do?&#8221;</p>
<p>&#8220;You&#8217;re supposed to put the bubble between the two marks,&#8221; came the adult explanation.</p>
<p>The kid tilted the iPhone back and forth, watching the bubble slide to and fro, and leveled it holding the bubble between the two lines for a moment.</p>
<p>At that moment he blurted out excitedly, &#8220;Look, I&#8217;m winning!&#8221;</p>
<p>Unfortunately, his excitement caused the bubble to shoot to one end, just as I had time to click a picture of the event.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2010/02/14/a-level-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebCams on OS X</title>
		<link>http://www.wwco.com/~wls/blog/2009/09/23/webcams-on-os-x/</link>
		<comments>http://www.wwco.com/~wls/blog/2009/09/23/webcams-on-os-x/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 14:51:05 +0000</pubDate>
		<dc:creator>Walt Stoneburner</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cameras]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[400]]></category>
		<category><![CDATA[800]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[firewire]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Snow]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[webcam]]></category>
		<category><![CDATA[webcams]]></category>

		<guid isPermaLink="false">http://www.wwco.com/~wls/blog/?p=669</guid>
		<description><![CDATA[Lots of cool software exists for webcams on OS X.]]></description>
			<content:encoded><![CDATA[<p>OS X is capable of using USB and Firewire cameras, with perhaps the most famous being the <a href="http://en.wikipedia.org/wiki/ISight">iSight</a>, second to the Built-in iSight of Apple&#8217;s laptops.</p>
<p><STRONG>Use other cameras!</STRONG><br />
But it turns out you can use a lot of <a href="http://webcam-osx.sourceforge.net/cameras/index.php">third party cameras</a> using the <a href="http://webcam-osx.sourceforge.net/">Macam driver</a>.</p>
<p><STRONG>Use multiple cameras!</STRONG><br />
If you&#8217;re using multiple cameras at once, say for security monitoring, you&#8217;re going to want to take a look at <a href="http://www.securityspy.com/">SecuritySpy</a>, which has motion detection, time lapse, and the ability to view from a remote browser, plus many other features.</p>
<p><STRONG>Barcode Reader!</STRONG><br />
<a href="http://www.evological.com/evobarcode.html">EvoBarcode</a> will let you use your camera as a bar code reader.</p>
<p><STRONG>Web Streaming!</STRONG><br />
<a href="http://www.evological.com/evocam.html">EvoCam</a> will let you stream multiple cameras and push images to servers.</p>
<p><STRONG>Stop Motion Photographer!</STRONG><br />
<a href="http://boinx.com/istopmotion/overview/">iStopMotion</a> will help you make your own stop motion movies.</p>
<p><STRONG>Real-time Special Effects!</STRONG><br />
<a href="http://www.ecamm.com/mac/iglasses/">iGlasses</a> will enhance and alter your video feeds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wwco.com/~wls/blog/2009/09/23/webcams-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
