<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:iprog.com,2007:postingsatom</id>
  <link type="text/html" rel="alternate" href="http://iprog.com/"/>
  <link type="application/atom+xml" rel="self" href="http://iprog.com/postings/atom"/>
  <title>interprogramming articles/news</title>
  <updated>2008-08-16T03:57:00+00:00</updated>
  <entry>
    <id>tag:iprog.com,2007:Posting27</id>
    <published>2008-08-16T03:57:00+00:00</published>
    <updated>2008-08-16T04:15:32+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/08/rails_500_error_ip_spoofing_attack"/>
    <title>Rails 500 error - IP spoofing attack</title>
    <content type="html">&lt;p&gt;Apparently Rails 2.1 has the nifty ability to throw a 500 Internal Server Error with the message &amp;#8220;IP spoofing attack?!&amp;#8221; under certain circumstances.&lt;/p&gt;


	&lt;p&gt;Unfortunately, those circumstances include a common Apache/Mongrel deployment and Yahoo&amp;#8217;s crawler, Slurp, trying to index your site. It&amp;#8217;s possible Apache/Mongrel isn&amp;#8217;t required; I&amp;#8217;m unsure.&lt;/p&gt;


	&lt;p&gt;The key is that Slurp includes both a &lt;code&gt;Client-IP&lt;/code&gt; header (&lt;code&gt;HTTP_CLIENT_IP&lt;/code&gt; by the time it hits Rails) and an &lt;code&gt;X-Forwarded-For&lt;/code&gt; header (&lt;code&gt;HTTP_X_FORWARDED_FOR&lt;/code&gt;). When both are present, Rails assumes something evil is happening and voluntarily dies. Neat.&lt;/p&gt;


	&lt;p&gt;Such a header can be relied on only if it was set by a trusted proxy. Otherwise, it&amp;#8217;s hard to know if it was spoofed. The difficulty is for Rails to know which one, if any, was set by a trusted proxy.&lt;/p&gt;


	&lt;p&gt;I deploy Rails in a common Apache w/mod_proxy_balancer and Mongrel setup. Apache uses &lt;code&gt;X-Forwarded-For&lt;/code&gt; natively, so that&amp;#8217;s the one I want to trust. To make Rails happy, I&amp;#8217;ve just told Apache to delete the &lt;code&gt;Client-IP&lt;/code&gt; header if present.&lt;/p&gt;


	&lt;p&gt;Adding &lt;code&gt;RequestHeader unset Client-IP&lt;/code&gt; to the virtual host configuration seems to do the trick.&lt;/p&gt;


	&lt;p&gt;This does require &lt;code&gt;mod_headers&lt;/code&gt; to be enabled in Apache.&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting26</id>
    <published>2008-08-07T01:42:00+00:00</published>
    <updated>2008-08-07T01:51:53+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/08/announcing_zerigo_ns_dns_service"/>
    <title>Announcing Zerigo: NS -- DNS service</title>
    <content type="html">&lt;p&gt;I&amp;#8217;m pleased to announce my latest service: &lt;a href="http://ns.zerigo.com/"&gt;Zerigo: NS&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Zerigo: NS arose out of my own need for a reliable, easy to use, and affordable &lt;span class="caps"&gt;DNS&lt;/span&gt; service&amp;#8212;not just for a single domain, but for a whole stack of them.&lt;/p&gt;


Key features are:
&lt;ul&gt;
	&lt;li&gt;&lt;span class="caps"&gt;DNS&lt;/span&gt; services for your domains &amp;#8211; no limit on the number of domains&lt;/li&gt;
	&lt;li&gt;Geographically distributed and redundant servers (North America and Europe)&lt;/li&gt;
	&lt;li&gt;Templates, for easy management of many domains&lt;/li&gt;
	&lt;li&gt;Ability to modify records dynamically (so called dynamic-DNS)&lt;/li&gt;
	&lt;li&gt;Configurable TTLs (as low as 5 minutes)&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;Standard service is &lt;em&gt;free&lt;/em&gt;. A premium service is available for very high volume users or those requiring priority support.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://ns.zerigo.com/"&gt;http://ns.zerigo.com/&lt;/a&gt;&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting25</id>
    <published>2008-07-24T17:14:00+00:00</published>
    <updated>2008-07-24T17:20:40+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/07/rails_plugin_limited_sessions_updated"/>
    <title>Rails plugin Limited Sessions updated</title>
    <content type="html">&lt;p&gt;I updated my limited_sessions plugin to improve support for Rails 2.1. It should maintain backwards compatibility.&lt;/p&gt;


	&lt;p&gt;The change surrounds Rails 2.1&amp;#8217;s new partial updates support. Basically, it&amp;#8217;s turned off for sessions so the session is kept current and doesn&amp;#8217;t expire if the user is active.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://iprog.com/project/limited_sessions"&gt;limited sessions&lt;/a&gt;&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting24</id>
    <published>2008-07-18T19:38:00+00:00</published>
    <updated>2008-07-18T19:44:03+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/07/home_depot_just_a_toy"/>
    <title>Home Depot: "Just a toy"</title>
    <content type="html">&lt;p&gt;I was at Home Depot today trying to match paint colors for some exterior trim. I went to Home Depot because they have a self-service color-matching computer.&lt;/p&gt;


	&lt;p&gt;As I&amp;#8217;m trying to use it, and getting rather poor results, a woman asks one of the clerks, &amp;#8220;how well does this work?&amp;#8221; He responded, &amp;#8220;it&amp;#8217;s just a toy.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;Why have something that doesn&amp;#8217;t work and is just a toy&amp;#8212;something not actually useful for your customers? It&amp;#8217;s a breach of trust with those customers.&lt;/p&gt;


	&lt;p&gt;I did get help from another clerk, but I still left the store feeling a bit disillusioned with Home Depot. They obviously don&amp;#8217;t care about me or their other customers&amp;#8212;we&amp;#8217;re just something to be fooled around with.&lt;/p&gt;


	&lt;p&gt;In business, it would be worthwhile to always ask, &amp;#8220;is this actually useful or helpful to my customers?&amp;#8221;&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting23</id>
    <published>2008-07-06T04:29:00+00:00</published>
    <updated>2008-07-06T04:30:57+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/07/for_all_your_needs"/>
    <title>for all your needs</title>
    <content type="html">&lt;p&gt;The phrase &amp;#8220;for all your &lt;insert market&gt; needs&amp;#8221; is pervasive. For all your insurance needs, for all your business needs, for all your printing needs, for all your in-home weekend veterinarian care needs, etc.&lt;/p&gt;


	&lt;p&gt;Does that phrase seem meaningful to you? It doesn&amp;#8217;t to me. Instead, it strikes me as filler&amp;#8212;a way to have a phrase to print or speak when nothing else comes to mind or perhaps when no time has been spent to think of something more meaningful.&lt;/p&gt;


	&lt;p&gt;Spend some time coming up with something interesting to say or at least an interesting way to say it. If your words are only filler, they&amp;#8217;ll just go in one ear and out the other&amp;#8212;not exactly the desired effect.&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting22</id>
    <published>2008-06-23T18:27:00+00:00</published>
    <updated>2008-07-24T17:26:51+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/06/classmates_com_business_model_seems_pretty_fried"/>
    <title>classmates.com's business model seems pretty fried</title>
    <content type="html">&lt;p&gt;classmates.com just sent me one of their usual spam&lt;code&gt;^H^H^H^H&lt;/code&gt;update messages. I&amp;#8217;m struck today by the silliness of their current business model which is to hold data for ransom and require a subscription to get to it.&lt;/p&gt;


	&lt;p&gt;Supposedly I have a guestbook signing. However, they are requiring me to pay them to get to it. That&amp;#8217;s dumb.&lt;/p&gt;


	&lt;p&gt;Here in 2008, data like that is free. I don&amp;#8217;t pay to use facebook, linkedin, or any other of the myriad of social networks. Why should I pay classmates.com? I won&amp;#8217;t and their data can rot&amp;#8212;data I can&amp;#8217;t see might as well not exist.&lt;/p&gt;


	&lt;p&gt;Maybe it&amp;#8217;s time for classmates.com to rethink.&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting21</id>
    <published>2008-06-21T20:37:00+00:00</published>
    <updated>2008-06-21T20:44:59+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/06/xen_freezing_under_load"/>
    <title>xen 3.2 freezing under load</title>
    <content type="html">&lt;p&gt;For a number of weeks now I&amp;#8217;ve been fighting a Xen host (dom0) that&amp;#8217;s been freezing up periodically. It&amp;#8217;s been a complete freeze of the Linux kernel, dom0, all domU&amp;#8217;s, everything. SysRq doesn&amp;#8217;t work either.&lt;/p&gt;


	&lt;p&gt;Today I finally found a reliable way to reproduce it.&lt;/p&gt;


	&lt;p&gt;On this dom0 I have a &lt;span class="caps"&gt;USB&lt;/span&gt; sound adapter attached. Pulseaudio runs in the dom0 so I can have sound from various domU&amp;#8217;s. I had this connected via a powered &lt;span class="caps"&gt;USB 2&lt;/span&gt; hub. It seems that this combination is the problem. Removing just the hub and connecting the &lt;span class="caps"&gt;USB&lt;/span&gt; sound driver directly seems to improve things.&lt;/p&gt;


	&lt;p&gt;I did try to freeze the system generating &lt;span class="caps"&gt;USB&lt;/span&gt; load to another &lt;span class="caps"&gt;USB&lt;/span&gt; device (UPS) but it seemed stable. This could be because I can&amp;#8217;t generate anywhere near the load to a &lt;span class="caps"&gt;UPS&lt;/span&gt; as to a sound adapter.&lt;/p&gt;


	&lt;p&gt;Anyway, I made a couple of other changes a couple weeks ago such that I no longer have to use the hub, so I&amp;#8217;ve pulled it out of the chain entirely.&lt;/p&gt;


	&lt;p&gt;Now I&amp;#8217;m hoping this was the only way to crash the system and that I now have it solved. Only time will tell.&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting20</id>
    <published>2008-04-07T23:09:00+00:00</published>
    <updated>2008-04-21T04:19:57+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/04/compiling_mod_xsendfile_for_mac_os_x"/>
    <title>Compiling mod_xsendfile for OS X</title>
    <content type="html">&lt;p&gt;Today I needed to compile &lt;a href="http://tn123.ath.cx/mod_xsendfile/"&gt;mod_xsendfile&lt;/a&gt; for &lt;span class="caps"&gt;OS X&lt;/span&gt; on Intel. The standard command for this,&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;apxs -cia mod_xsendfile.c&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;resulted in a module that was for i386 only.&lt;/p&gt;


	&lt;p&gt;Apache on Leopard (untested on Tiger) doesn&amp;#8217;t appreciate this, throwing this error:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;4/7/08 5:08:08 PM org.apache.httpd[ 15990] httpd: Syntax error on line 116 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_xsendfile.so into server: dlopen(/usr/libexec/apache2/mod_xsendfile.so, 10): no suitable image found.  Did find:\n\t/usr/libexec/apache2/mod_xsendfile.so: mach-o, but wrong architecture&lt;/p&gt;
	&lt;/blockquote&gt;

	&lt;p&gt;Turns out the solution is pretty simple. Just change the command to apxs to this:&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;apxs -cia -Wc,"-arch x86_64 -arch ppc -arch i386 -arch ppc64" -Wl,"-arch x86_64 -arch ppc -arch i386 -arch ppc64" mod_xsendfile.c&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;This will generate a fat-binary for all four current Mac architectures.&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting19</id>
    <published>2008-02-08T22:06:00+00:00</published>
    <updated>2008-02-08T22:16:02+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2008/02/paging_blog_writers_hello"/>
    <title>paging: blog writers: hello !?!</title>
    <content type="html">&lt;p&gt;one of my pet peeves is a blog that doesn&amp;#8217;t have links to view previous pages of content. it works like this:&lt;/p&gt;


	&lt;p&gt;something i&amp;#8217;m reading has a link to some random blog. i follow it, find the article interesting, and wonder what else of interest might be on this blog. so, i go to the home page and start reading. typically i get to read 5-10 articles and then get to the bottom of the page.&lt;/p&gt;


	&lt;p&gt;first tip: if your blog only shows one or two articles per page, change it. i don&amp;#8217;t want to click and wait that often&amp;#8212;i&amp;#8217;ll end up leaving.&lt;/p&gt;


	&lt;p&gt;at the bottom i frequently find, well, nothing. i&amp;#8217;m looking for a &amp;#8216;next page,&amp;#8217; &amp;#8216;more articles,&amp;#8217; &amp;#8216;older entries,&amp;#8217; or something of the sort. i am amazed at how often there&amp;#8217;s nothing there. sometimes i simply close the window at this point. occasionally i scroll back to the top looking for the links there, although i almost never find them.&lt;/p&gt;


	&lt;p&gt;i have, on occasion, gone digging into the archives section. even then, it&amp;#8217;s usually impossible to find a way to get to a substantial portion of older content. the site i was just at showed about 10 articles for a given month, then an incomplete list of links to some more articles from that month (including duplicate links for all the articles above). still no pager though.&lt;/p&gt;


	&lt;p&gt;lame. don&amp;#8217;t make visitors work that hard to read your site. if your blog or other content-drive site doesn&amp;#8217;t have the ability to easily page through older content, you&amp;#8217;re losing readers. fix it.&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
  <entry>
    <id>tag:iprog.com,2007:Posting18</id>
    <published>2007-12-22T03:57:00+00:00</published>
    <updated>2007-12-22T04:01:35+00:00</updated>
    <link type="text/html" rel="alternate" href="http://iprog.com/posting/2007/12/spotlight_fun"/>
    <title>spotlight fun in leopard</title>
    <content type="html">&lt;p&gt;i upgraded to mac os x 10.5 shortly after it came out. one of the biggest areas of improvement is with spotlight. mostly it&amp;#8217;s just much, much faster.&lt;/p&gt;


	&lt;p&gt;given its speed, i often use spotlight to launch less frequently used applications. today i went to launch locomotive.&lt;/p&gt;


	&lt;p&gt;cmd-space &amp;#8211; l &amp;#8211; o &amp;#8211; c &amp;#8211; o&lt;/p&gt;


	&lt;p&gt;that&amp;#8217;s as far as i got before locomotive was the top hit, ready to launch. that&amp;#8217;s great. more amusing, however, was what was right below it:&lt;/p&gt;


	&lt;p&gt;definition: adjective. crazy.&lt;/p&gt;


	&lt;p&gt;made me smile.&lt;/p&gt;</content>
    <author>
      <name>tm</name>
    </author>
  </entry>
</feed>
