<?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>Jeff Blaine &#187; Musings</title>
	<atom:link href="http://www.kickflop.net/blog/category/musings/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kickflop.net/blog</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 20:59:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Choice</title>
		<link>http://www.kickflop.net/blog/2011/06/26/choice/</link>
		<comments>http://www.kickflop.net/blog/2011/06/26/choice/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 17:44:16 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[Society]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1327</guid>
		<description><![CDATA[The problem is actually that today’s ideology of choice-led capitalism, the idea that everyone is a maker of his or her life, which goes very much against the reality of the social situation, actually pacifies people and makes us constantly turning criticism towards ourselves instead of organizing ourselves and making a critique of the society [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The problem is actually that today’s ideology of choice-led capitalism, the idea that everyone is a maker of his or her life, which goes very much against the reality of the social situation, actually pacifies people and makes us constantly turning criticism towards ourselves instead of organizing ourselves and making a critique of the society we live in.” ~ Renata Salecl</p></blockquote>
<p><iframe width="560" height="349" src="http://www.youtube.com/embed/1bqMY82xzWo" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/06/26/choice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imagine Language Consolidation</title>
		<link>http://www.kickflop.net/blog/2011/05/20/imagine-language-consolidation/</link>
		<comments>http://www.kickflop.net/blog/2011/05/20/imagine-language-consolidation/#comments</comments>
		<pubDate>Sat, 21 May 2011 01:35:14 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1275</guid>
		<description><![CDATA[I started programming in BASIC on a Commodore 64. From there it was GW-BASIC on an 8086 PC, Pascal, C on AIX/Linux, Perl, minimal Java, and for the last 11 years good chunk of Python. I don&#8217;t really consider myself that advanced in the field, frankly. It&#8217;s not my full-time day job. However, if you [...]]]></description>
			<content:encoded><![CDATA[<p>I started programming in BASIC on a Commodore 64.  From there it was GW-BASIC on an 8086 PC, Pascal, C on AIX/Linux, Perl, minimal Java, and for the last 11 years good chunk of Python.  I don&#8217;t really consider myself that advanced in the field, frankly.  It&#8217;s not my full-time day job.</p>
<p>However, if you told me tomorrow that everyone currently working in Perl, Python, or Ruby was going to standardize on one and only one of them, make it rock solid with a phenomenal standard library, and have a major feature release ever year, I would happily ditch the Python I enjoy so much and join the crowd.<span id="more-1275"></span></p>
<p>I haven&#8217;t started the World Scripting Language Standardization Consortium or something, so don&#8217;t take all of this too seriously, but I tweeted this today as something for folks to consider that they might never have:</p>
<blockquote><p>Can you imagine the benefits possible to everyone if everyone agreed to do dev only in ONE of #perl #python #ruby ? ENORMOUS.</p></blockquote>
<p>The first responder stated:</p>
<blockquote><p>very little actually because of the lack of diversity</p></blockquote>
<p>Let&#8217;s put that in direct context and make a full sentence from it so we&#8217;re clear what he&#8217;s saying: &#8220;There would be very little benefit to everyone doing scripting development in 1 language because of the lack of language diversity.&#8221;</p>
<p>To me, that makes no sense whatsoever.</p>
<p>While your language of choice is a religious or emotional topic to you, it really shouldn&#8217;t be to the extent you take it (whomever).  But Perl allows me to parse X.  And in Ruby I have blocks and hoo-hahs!  And Python has a nice way of Y!  Who cares?  It&#8217;s really all the same shit, folks.  It&#8217;s all Smalltalk, Pascal, Lisp, awk, sed, and 20 other things, and the 3 languages all do the same damn thing in the end.  We all have our preferences, but my point is that we pay an astounding cost for that small freedom of preference.  Is it really worth it here?</p>
<p>What if 3 versions of TCP/IP had grown up with the internet, all with the same real end result to 95% accuracy?</p>
<p>Standards bodies exist for a very very good reason, and it&#8217;s not to be The Man keeping you down.</p>
<p>Consider how ridiculous it is that the US still doesn&#8217;t use the metric system and consider how much time and money is wasted dealing directly and indirectly with imperial units.</p>
<p>Now, I wouldn&#8217;t consider myself a web developer, because it sure isn&#8217;t what I do for my day job, but I&#8217;ve been there every part of the way since installing NCSA httpd 0.9, writing HTML in 1994, and having wrapped up a Django 1.3 app last week&#8230; but I don&#8217;t think I need to remind you all of the absolutely hell on earth that was web development from 1998-2010 due to waffling standards and shoddy adherence to the standards that existed during that time.</p>
<p>How many tens of thousands of hours have been wasted by developers implementing the same functionality in new language X that existed in last year&#8217;s language Y?  I wish I knew, but I have to guess it&#8217;s a staggering amount of effort that could have made a single fantasticly stable and thorough language.</p>
<p>How do we practically weigh the value of language choice freedom in the face of global familiarity and standardization for the sake of productivity?</p>
<p>And here we also get into the &#8220;artistic expression&#8221; side of programming and whether that&#8217;s sufficient enough ground to warrant myriad language choices to tickle each developer.  That&#8217;s a huge can of worms.  Are you really that phenomenal an artist that your masterpiece must have Blue shade 102 and not Blue shade 103 only offered by MasterPaintCo?  No, you&#8217;re not.</p>
<p>Oh how we like to feel special and part of something cool.</p>
<p>TID[1] pointed out that an analogy to all of this can be made in the situation of <a href="http://en.wikipedia.org/wiki/Esperanto">Esperanto</a> which went nowhere (and I was ALL FOR, BTW).  It&#8217;s a similar situation, but only on the surface.  I don&#8217;t think it&#8217;s fair to consider the failure of changing the spoken and written language of everyone on the planet, in the face of thousands of years of history&#8230; to Jimmy who chose write his applications in Python since 2001.</p>
<p>If you&#8217;re a programmer&#8217;s programmer, I&#8217;m pretty sure you wouldn&#8217;t stop programming because the language you like was no longer an option.  You&#8217;d bitch and moan, learn it because your livelihood depended on it, become very proficient with it, forget what seemed so enticing about the previous language in a year, and ultimately (the goal) continue to create cool applications that made you happy.</p>
<p>So is the world a better, more productive, and more progressive place with a 5%-new-ideas language every year?  I think it&#8217;s pretty clear where I stand.  We don&#8217;t need another divisive general purpose programming language with a new syntax, and we didn&#8217;t need the last one we got, or probably the one before that, or&#8230;</p>
<p>I&#8217;d be super happy with everyone on the same team using a single amazingly solid and amazingly documented general purpose language.  The language would grow to meet changing needs in the world and all of the time everyone spent previously implementing a new language, learning a new language, or reinventing wheels in some new language, would be spent doing something actually innovative.</p>
<p>I dunno.  Just something to think about.  Or not.</p>
<p>[1] Thanks to <a href="http://insanedreamer.com/">The Insane Dreamer</a> (who may totally disagree with all of the above). We had a thoughtful exchange via twitter on this subject.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/05/20/imagine-language-consolidation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Carbon Footprint of World Community Grid</title>
		<link>http://www.kickflop.net/blog/2011/05/13/carbon-footprint-of-world-community-grid/</link>
		<comments>http://www.kickflop.net/blog/2011/05/13/carbon-footprint-of-world-community-grid/#comments</comments>
		<pubDate>Fri, 13 May 2011 13:56:36 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1267</guid>
		<description><![CDATA[After my first successful overnight contribution of compute power to the World Community Grid, I started wondering about the energy part of that donation, and then the overall CO2 footprint of all of the computing being done. Given our global energy and climate situation, sometimes we have hard decisions to make: Do I reduce my [...]]]></description>
			<content:encoded><![CDATA[<p>After my first successful overnight contribution of compute power to the World Community Grid, I started wondering about the energy part of that donation, and then the overall CO2 footprint of all of the computing being done.  Given our global energy and climate situation, sometimes we have hard decisions to make: Do I reduce my individual CO2 footprint by powering off my PC at night, or do I leave it on and contribute computing power toward solving some of the world&#8217;s other problems?  I don&#8217;t have an answer yet, but figured I&#8217;d at least share my &#8220;napkin&#8221; calculations.<span id="more-1267"></span></p>
<p>The <a href="http://worldcommunitygrid.org">World Community Grid</a>, whose mission is to &#8220;create the world&#8217;s largest public computing grid to tackle projects that benefit humanity&#8221;, reports 466,581 years of compute time has been racked up as of 5/13/2011 9AM.</p>
<p>466,581 years is 4,087,249,560 hours</p>
<p>At 100W assumed for a computing device running at full steam, that&#8217;s 408,724,956 kWh.</p>
<p>According to <a href="http://www.carbonfund.org/site/pages/carbon_calculators/category/Assumptions">carbonfund.org</a>, an average kWh of electricity translates to 1.297 lbs CO2 emissions.</p>
<p>The carbon footprint of the WCG, using my numbers, is 530,116,268 lbs of CO2 since its inception.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/05/13/carbon-footprint-of-world-community-grid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sysadmin-Only Posts</title>
		<link>http://www.kickflop.net/blog/2011/04/04/sysadmin-only-posts/</link>
		<comments>http://www.kickflop.net/blog/2011/04/04/sysadmin-only-posts/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 20:41:55 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1245</guid>
		<description><![CDATA[If you&#8217;re subscribed to my RSS feed generally, and only care about sysadmin posts, the feed for that is: http://www.kickflop.net/blog/category/sysadmin/feed]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re subscribed to my RSS feed generally, and only care about sysadmin posts, the feed for that is: http://www.kickflop.net/blog/category/sysadmin/feed</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/04/04/sysadmin-only-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flickr: You&#8217;re doing it wrong</title>
		<link>http://www.kickflop.net/blog/2011/04/04/flickr-youre-doing-it-wrong/</link>
		<comments>http://www.kickflop.net/blog/2011/04/04/flickr-youre-doing-it-wrong/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 20:38:08 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Quality Control]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1246</guid>
		<description><![CDATA[I go to share a flickr photo of mine with Facebook friends and this is what I&#8217;m presented with. Gee, no thank you, Yahoo/flickr.]]></description>
			<content:encoded><![CDATA[<p>I go to share a flickr photo of mine with Facebook friends and this is what I&#8217;m presented with.  Gee, no thank you, Yahoo/flickr.</p>
<p><a rel="lightbox" href="http://www.kickflop.net/blog/wp-content/uploads/2011/04/yahoo-flickr-facebook.jpg"><img src="http://www.kickflop.net/blog/wp-content/uploads/2011/04/yahoo-flickr-facebook-300x209.jpg" alt="" title="yahoo-flickr-facebook" width="300" height="209" class="alignleft size-medium wp-image-1247" /></a></p>
<div class="clear"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/04/04/flickr-youre-doing-it-wrong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unknown Comrades</title>
		<link>http://www.kickflop.net/blog/2011/03/25/unknown-comrades/</link>
		<comments>http://www.kickflop.net/blog/2011/03/25/unknown-comrades/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 14:22:06 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1239</guid>
		<description><![CDATA[Sometimes I get emotional out of the blue. Today, I am moved, in the midst of all the shit we have to deal with, and all of the atrocities and disasters on our planet, by my fellow creative souls. Here&#8217;s to those of you who create for the joy and stimulation of the process, the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I get emotional out of the blue. Today, I am moved, in the midst of all the shit we have to deal with, and all of the atrocities and disasters on our planet, by my fellow creative souls. Here&#8217;s to those of you who create for the joy and stimulation of the process, the liberation it brings to you, and your continued ability to keep your critical judgment of your efforts in check.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/03/25/unknown-comrades/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One of my first usenet posts</title>
		<link>http://www.kickflop.net/blog/2011/02/15/one-of-my-first-usenet-posts/</link>
		<comments>http://www.kickflop.net/blog/2011/02/15/one-of-my-first-usenet-posts/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 21:33:24 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1155</guid>
		<description><![CDATA[Circa 1992, re: Linux 0.99pl4 and the Persistence of Vision Raytracer (POVRay). To compile Persistence of Vision Raytracer under Linux ( > 0.99pl4 ) FTP to alfred.ccs.carleton.ca and grab /pub/pov-ray/POV-Ray1.0/povsrc.tar.Z in binary mode. I really didn't think it was necessary to ftp the POV sources from the above address and put them on sunsite or [...]]]></description>
			<content:encoded><![CDATA[<p>Circa 1992, re: Linux 0.99pl4 and the Persistence of Vision Raytracer (POVRay).<br />
<span id="more-1155"></span></p>
<pre>
To compile Persistence of Vision Raytracer under Linux ( > 0.99pl4 )

FTP to alfred.ccs.carleton.ca and grab
/pub/pov-ray/POV-Ray1.0/povsrc.tar.Z in binary mode.

I really didn't think it was necessary to ftp the POV sources from
the above address and put them on sunsite or tsx.  You all are big
kids, you can grab it yourself rather than clogging up sunsite and
tsx anymore than they need to be.

Download povsrc.tar.Z to your Linux partition.

1.  mkdir /build
2.  mv povsrc.tar.Z to /
3.  zcat < povsrc.tar.Z | tar xvf -
    this will create a dir called /povsrc
4.  cp /povsrc/machine/unix/* /build
5.  cp /povsrc/source/* /build
6.  cd /build
7.  edit unix.c and comment out the whole function "matherr"
        (I am pretty sure matherr is in unix.c....if you can't find it
        type grep matherr *.c to find which file matherr may be in.

8.  Do ONE of the following:
         -  If you want the +d option on POV to open and display your
            raytrace in an X-window:
                cp xwindows.mak makefile
         -  If you do NOT want the X11 previewer compiled in:
                cp unix.mak makefile

9.      cp unixconf.h config.h  (note: if you use gccconf.h as config.h
        instead, don't forget to change the CC= line in the makefile to
        gcc)  It is safest to just use cc.

10. type make and press enter.....
11. if all goes well, you will have a povray binary file now.
12. move this to wherever you want it (/usr/bin or /usr/local/bin are
good places)

That's it!
You will need to get the include files that povray uses at render time
(textures.inc, shapes.inc, shapesq.inc, colors.inc etc etc) from
alfred.ccs.carleton.ca or just copy them over from your DOS partition
if you use POV under DOS.

Jeff Blaine
jblaine@garnet.acns.fsu.edu
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/02/15/one-of-my-first-usenet-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tracing Linux Hostname Resolution</title>
		<link>http://www.kickflop.net/blog/2011/01/02/tracing-linux-hostname-resolution/</link>
		<comments>http://www.kickflop.net/blog/2011/01/02/tracing-linux-hostname-resolution/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 04:13:44 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=1000</guid>
		<description><![CDATA[This post is a living document. Updates since the original publish dates are noted inline as such. Update 1/11/2011: Nearly all of this article is bunk now, as it turns out the GNU libc developers consider getent (the basis of everything below) to be a debugging tool only. As such, it does abnormal things. I [...]]]></description>
			<content:encoded><![CDATA[<p><em>This post is a living document.  Updates since the original publish dates are noted inline as such.</em></p>
<p><em>Update 1/11/2011: Nearly all of this article is bunk now, as it turns out the GNU libc developers consider getent (the basis of everything below) to be a debugging tool only.  As such, it does abnormal things.  I suggested the man page should indicate as much.  Anyway, here it is&#8230;</em></p>
<p>Let&#8217;s examine hostname resolution on a RHEL 5.5 box on a Sunday night.  I was inspired from reading <a target="_blank" href="http://sysadvent.blogspot.com/2010/12/day-15-down-ls-rabbit-hole.html">Down the &#8216;ls&#8217; Rabbit Hole</a> 2 weeks ago.  I suspect any other modern Linux distro will provide nearly identical results.<span id="more-1000"></span></p>
<p>The short summary is:</p>
<ol>
<li>Read /etc/resolv.conf</li>
<li>Try to use nscd</li>
<li>Try to use nscd again</li>
<li>Read /etc/nsswitch.conf</li>
<li>Load libnss_files.so</li>
<li>Read /etc/host.conf</li>
<li>Try to find IPv6 address in /etc/hosts</li>
<li>Load libnss_dns.so</li>
<li>Load libresolv.so</li>
<li>Perform DNS IPv6 &#8216;AAAA&#8217; query</li>
<li>Try to find IPv4 address in /etc/hosts</li>
<li>Perform DNS IPv4 &#8216;A&#8217; query</li>
</ol>
<p>Read on for the full trace with commentary.</p>
<pre>
strace -f getent hosts www.puppetlabs.com
...
open("/etc/resolv.conf", O_RDONLY)      = 3
...
close(3)                                = 0
</pre>
<p>Looking at the source for <a target="_blank" href="http://ftp.gnu.org/gnu/glibc/<br />
">GNU libc</a> 2.5 (which is what is installed on this box), it appears that /etc/resolv.conf is loaded in resolv/res_init.c and the explanation is given as:</p>
<pre>
/*
 * Resolver state default settings.
 */

/*
 * Set up default settings.  If the configuration file exist, the values
 * there will have precedence.  Otherwise, the server address is set to
 * INADDR_ANY and the default domain name comes from the gethostname().
 *
 * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
 * rather than INADDR_ANY ("0.0.0.0") as the default name server address
 * since it was noted that INADDR_ANY actually meant ``the first interface
 * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
 * it had to be "up" in order for you to reach your own name server.  It
 * was later decided that since the recommended practice is to always
 * install local static routes through 127.0.0.1 for all your network
 * interfaces, that we could solve this problem without a code change.
 *
 * The configuration file should always be used, since it is the only way
 * to specify a default domain.  If you are running a server on your local
 * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
 * in the configuration file.
 *
 * Return 0 if completes successfully, -1 on error
 */
</pre>
<p>Okay.  I guess.  Let&#8217;s move on.</p>
<pre>
...
socket(PF_FILE, SOCK_STREAM, 0)         = 3
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT
(No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 3
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT
(No such file or directory)
close(3)                                = 0
</pre>
<p>Why did you check nscd twice?</p>
<p>GNU libc nscd/nscd_helper.c is the only place with a connect() call referencing /var/run/nscd/socket (aka _PATH_NSCDSOCKET as defined in nscd/nscd-client.h).  The connect() is in open_socket(), which is referenced in two places:</p>
<p>One:</p>
<pre>
/* Try to get a file descriptor for the shared memory segment
   containing the database.  */
static struct mapped_database *
get_mapping (request_type type, const char *key,
             struct mapped_database **mappedp)
</pre>
<p>Two:</p>
<pre>
/* Create a socket connected to a name. */
int
__nscd_open_socket (const char *key, size_t keylen, request_type type,
                    void *response, size_t responselen)
</pre>
<p>Here I took it upon myself to try to build the GNU libc code I was referencing.  I figured I&#8217;d build it with debug symbols and then run getent again under gdb.  The build with CFLAGS=-g spit out an error saying that it <em>must</em> be built with optimization.  So much for that, but I did at least throw in some syslog() calls.  For one, the two attempts to connect to an nscd socket above are in fact from both referenced functions.</p>
<p><em>Update 1/11/2011: This shows my lack of gdb knowledge.  One doesn&#8217;t need to build in debugging symbols to see what I am trying to see.  Commenter Dave W. shows that below with his traces.</em></p>
<pre>
Jan  3 03:57:33 new-host-2 getent: get_mapping() trying to open nscd socket with
open_socket()
Jan  3 03:57:33 new-host-2 getent: __nscd_open_socket() trying to open nscd socket
with open_socket() with open_socket()
</pre>
<p>Is that correct behavior?  Could it be better?  Beats me.  I&#8217;m only taking it that far, but it doesn&#8217;t seem ideal.</p>
<pre>
...
open("/etc/nsswitch.conf", O_RDONLY)    = 3
...
close(3)                                = 0
</pre>
<p>Now we actually get somewhere.  At least we&#8217;re reading the right configuration file at this point.</p>
<p>This is generated from GNU libc nss/nsswitch.c</p>
<pre>
int
__nss_database_lookup (const char *database, const char *alternate_name,
                       const char *defconfig, service_user **ni)
{
...
    service_table = nss_parse_file (_PATH_NSSWITCH_CONF);
</pre>
<p>Fine, moving on.</p>
<pre>
open("/lib64/libnss_files.so.2", O_RDONLY) = 3
...
close(3)                                = 0
</pre>
<p>This is due to &#8220;files&#8221; being first in /etc/nsswitch.conf.  Fine.</p>
<pre>
...
open("/etc/host.conf", O_RDONLY)        = 3
...
close(3)                                = 0
</pre>
<p>The hell?  You already found a valid /etc/nsswitch.conf.  Why would you query this stupid old legacy file?</p>
<p>nss/getXXbyYY_r.c causes this read of /etc/host.conf</p>
<pre>
#ifdef NEED__RES_HCONF
          if (!_res_hconf.initialized)
            _res_hconf_init ();
#endif /* need _res_hconf */
</pre>
<p>Turns out this is hardcoded and not managed/overriden in any way by configure.</p>
<pre>
[jblaine@new-host-2 glibc-2.5]$ grep "#define NEED__RES_HCONF" */*
inet/gethstbyad_r.c:#define NEED__RES_HCONF     1
inet/gethstbynm2_r.c:#define NEED__RES_HCONF    1
inet/gethstbynm_r.c:#define NEED__RES_HCONF     1
</pre>
<p><strong>???</strong> &#8211; feel free to provide a comment on this below.  I don&#8217;t understand the need for this nowadays when we have /etc/nsswitch.conf.</p>
<pre>
...
open("/etc/hosts", O_RDONLY)            = 3
...
close(3)                                = 0
</pre>
<p>Makes sense finally, at least if this was the result of doing what our /etc/nsswitch.conf said (&#8220;files dns&#8221;).</p>
<p><em>Update 1/11/2011: Oddly, this <em>first</em> opening of /etc/hosts is due to trying to resolve www.puppetlabs.com via an IPv6 address.</em></p>
<pre>
open("/lib64/libnss_dns.so.2", O_RDONLY) = 3
...
close(3)                                = 0
...
open("/lib64/libresolv.so.2", O_RDONLY) = 3
...
close(3)                                = 0
</pre>
<p>Fine.</p>
<pre>
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 28) = 0
...
sendto(3, "uw\1\0\0\1\0\0\0\0\0\0\3www\npuppetlabs\3com\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
...
recvfrom(3, "uw\201\200\0\1\0\1\0\1\0\0\3www\npuppetlabs\3com\0"..., 1024, 0,
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, [16]) = 120
close(3)                                = 0
</pre>
<p>DNS traffic, finally.</p>
<p><em>Update 1/10/2011: After coming back to this little exercise tonight armed with Wireshark, I&#8217;ve found that this DNS request is for an IPv6 &#8220;AAAA&#8221; record.  Commenter Dave W. confirmed this below.  Again, this is odd to me that it would try IPv6 first.</em></p>
<pre>
open("/etc/hosts", O_RDONLY)            = 3
...
close(3)                                = 0
</pre>
<p>Why?  What did this and what is the reason?</p>
<p><em>Update 1/11/2011: This is the attempt to look it up as an IPv4 address.  The following lack of expected syslog() output is still a bit mysterious though.</em></p>
<p>Opening /etc/hosts happens in 2 GNU libc functions:</p>
<p>One:</p>
<pre>
void
_sethtent(f)
        int f;
{
        if (!hostf)
                hostf = fopen(_PATH_HOSTS, "r" );
        else
                rewind(hostf);
        stayopen = f;
}
</pre>
<p>Two:</p>
<pre>
struct hostent *
_gethtent()
{
...
        if (!hostf &#038;&#038; !(hostf = fopen(_PATH_HOSTS, "r" ))) {
                __set_h_errno (NETDB_INTERNAL);
                return (NULL);
        }
...
</pre>
<p>Let&#8217;s assume our &#8220;problem&#8221; is _gethtent().  It&#8217;s referenced 3 places:</p>
<p>One:</p>
<pre>
struct hostent *
_gethtbyname2(name, af)
        const char *name;
        int af;
</pre>
<p>Two:</p>
<pre>
struct hostent *
_gethtbyaddr(addr, len, af)
        const char *addr;
        size_t len;
        int af;
</pre>
<p>Three:</p>
<pre>
struct hostent *
gethostent()
</pre>
<p>Oddly, with plenty of syslog() calls in _sethtent() and _gethtent() around where the fopen() of /etc/hosts happens, I cannot get them to be reached.  This odd opening of /etc/hosts remains a mystery.</p>
<p>Moving on.</p>
<pre>
...
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 28) = 0
...
sendto(3, "\256\261\1\0\0\1\0\0\0\0\0\0\3www\npuppetlabs\3com\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
...
recvfrom(3, "\256\261\201\200\0\1\0\2\0\0\0\0\3www\npuppetlabs\3com\0"..., 1024, 0,
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, [16]) = 66
close(3)                                = 0
...
write(1, "74.207.250.144  puppetlabs.com w"..., 5074.207.250.144  puppetlabs.com
www.puppetlabs.com) = 50
exit_group(0)                           = ?
</pre>
<p>Another DNS query before we get our screen output and getent exits.  <strong>Why?</strong></p>
<p><em>Update 1/11/2011: This is the IPv4 query of an &#8220;A&#8221; record finally.</em></p>
<p>Feel free to chime in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2011/01/02/tracing-linux-hostname-resolution/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quality Control : Puppet</title>
		<link>http://www.kickflop.net/blog/2010/12/21/quality-control-puppet/</link>
		<comments>http://www.kickflop.net/blog/2010/12/21/quality-control-puppet/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 20:51:14 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Quality Control]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=977</guid>
		<description><![CDATA[Quality Control is an ongoing series of blog posts where I am moved in rare circumstances to document what is wrong with software or anything else I find significantly rough. The posts are meant to be constructive, and I hope others can see through the likely presence of frustration in my tone to get there. [...]]]></description>
			<content:encoded><![CDATA[<p><i>Quality Control is an ongoing series of blog posts where I am moved in rare circumstances to document what is wrong with software or anything else I find significantly rough.  The posts are meant to be constructive, and I hope others can see through the likely presence of frustration in my tone to get there.</i><span id="more-977"></span></p>
<pre>
facter-1.5.8:beijing> ruby install.rb --destdir=/net/silmaril/export/puppet
...
facter-1.5.8:beijing>
</pre>
<p>Good.</p>
<pre>
puppet-2.6.4:beijing> more README
Documentation (and detailed install instructions) can be found
online at http://docs.puppetlabs.com/.

Additional documentation can also be found at the Puppet Wiki:

http://projects.puppetlabs.com/projects/puppet/wiki/

Generally, you need the following things installed:

* Ruby >= 1.8.1 (earlier releases might work but probably not)

* The Ruby OpenSSL library.  For some reason, this often isn't included
  in the main ruby distributions.  You can test for it by running
  'ruby -ropenssl -e "puts :yep"'.  If that errors out, you're missing the
  library.

  If your distribution doesn't come with the necessary library (e.g., on Debian
  and Ubuntu you need to install libopenssl-ruby), then you'll probably have to
  compile Ruby yourself, since it's part of the standard library and not
  available separately.  You could probably just compile and install that one
  library, though.

* The Ruby XMLRPC client and server libraries.  For some reason, this often
  isn't included in the main ruby distributions.  You can test for it by
  running 'ruby -rxmlrpc/client -e "puts :yep"'.  If that errors out, you're
  missing the library.

* Facter => 1.5.1
  You can get this from < http://puppetlabs.com/projects/facter >
</pre>
<p>Maybe there&#8217;s a good reason, but why are you telling me all of these minimum requirements instead of just checking for it in the build/install process?</p>
<pre>
puppet-2.6.4:beijing> ruby install.rb --destdir=/net/silmaril/export/puppet
which: no ronn in (/usr/bin:/bin:/sbin:/usr/sbin:/net/silmaril/export/puppet/usr/bin)
Could not load facter; cannot install
puppet-2.6.4:beijing>
</pre>
<p>WTF is &#8216;ronn&#8217;?  This is a fully loaded RHEL 5.5 box I am on.</p>
<pre>
puppet-2.6.4:beijing> ruby install.rb --help
which: no ronn in (/usr/bin:/bin:/sbin:/usr/sbin:/net/silmaril/export/puppet/usr/bin)
Could not load facter; cannot install
puppet-2.6.4:beijing>
</pre>
<p>Awesome!</p>
<pre>
puppet-2.6.4:beijing> ruby install.rb --fdgfsdgfds
which: no ronn in (/usr/bin:/bin:/sbin:/usr/sbin:/net/silmaril/export/puppet/usr/bin)
install: invalid option: --fdgfsdgfds
install.rb:92:in `mkdir': Permission denied - /etc/puppet (Errno::EACCES)
        from install.rb:92:in `do_configs'
        from install.rb:492
puppet-2.6.4:beijing>
</pre>
<p>So you got an invalid argument, and continued to try to mkdir?  That doesn&#8217;t seem smart.</p>
<p>I guess I&#8217;ll look at the source for install.rb in order to find the ronn reference?</p>
<pre>
# install.rb
# ...
begin
  if $haverdoc
    ronn = %x{which ronn}
    $haveman = true
  else
    $haveman = false
  end
rescue
  puts "Missing ronn; skipping man page creation"
  $haveman = false
end
# ...
</pre>
<p>So much for displaying that error message.  Why wouldn&#8217;t you also display that along with &#8216;$haveman = false&#8217; after the else clause?</p>
<p>Whatever, let&#8217;s just try to address the fact that Facter is not found.  I&#8217;m not chasing the ronn rabbit down a hole, even though it&#8217;s not clear to me if I need it or not or what the hell it is.</p>
<pre>
puppet-2.6.4:beijing> find /net/silmaril/export/puppet/usr -name fac\*
/net/silmaril/export/puppet/usr/bin/facter
/net/silmaril/export/puppet/usr/lib/ruby/site_ruby/1.8/facter.rb
/net/silmaril/export/puppet/usr/lib/ruby/site_ruby/1.8/facter
/net/silmaril/export/puppet/usr/lib/ruby/site_ruby/1.8/facter/facterversion.rb
/net/silmaril/export/puppet/usr/lib/ruby/site_ruby/1.8/facter/util/fact.rb
puppet-2.6.4:beijing>
</pre>
<p>Apparently /net/silmaril/export/puppet/usr/bin being in my PATH does not mean anything to the Ruby library search logic.  This obviously isn&#8217;t Puppet&#8217;s fault.</p>
<p>Digging around, I find that I can set RUBYLIB for non-standard places holding Ruby libraries/modules.</p>
<pre>
export RUBYLIB=/net/silmaril/export/puppet/usr/lib
    ruby install.rb --destdir=/net/silmaril/export/puppet = FAIL
export RUBYLIB=/net/silmaril/export/puppet/usr/lib/ruby
    ruby install.rb --destdir=/net/silmaril/export/puppet = FAIL
export RUBYLIB=/net/silmaril/export/puppet/usr/lib/ruby/site_ruby
    ruby install.rb --destdir=/net/silmaril/export/puppet = FAIL
export RUBYLIB=/net/silmaril/export/puppet/usr/lib/ruby/site_ruby/1.8
SUCCESS
</pre>
<p>And apparently search for Ruby libraries only works at some unknown-to-me level of directory traversal.  This, too, obviously isn&#8217;t Puppet&#8217;s fault.</p>
<p>So far, this is a pantload of fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2010/12/21/quality-control-puppet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We are angry because we are overly optimistic</title>
		<link>http://www.kickflop.net/blog/2010/12/20/we-are-angry-because-we-are-overly-optimistic/</link>
		<comments>http://www.kickflop.net/blog/2010/12/20/we-are-angry-because-we-are-overly-optimistic/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 15:27:13 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://www.kickflop.net/blog/?p=975</guid>
		<description><![CDATA[We are angry because we are overly optimistic, insufficiently prepared for the frustrations endemic to existence. A man who screams every time he loses his keys or is turned away at an airport is evincing a touching but recklessly naive belief in a world in which keys never go astray and our travel plans are [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>We are angry because we are overly optimistic, insufficiently prepared for the frustrations endemic to existence. A man who screams every time he loses his keys or is turned away at an airport is evincing a touching but recklessly naive belief in a world in which keys never go astray and our travel plans are invariably assured.
</p></blockquote>
<p>- Alain de Botton, “A Week at the Airport” p. 33</p>
<p>Found: <a target="_blank" href="http://ryanfreitas.tumblr.com/post/1706599301/we-are-angry-because-we-are-overly-optimistic">ryanfreitas.tumblr.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kickflop.net/blog/2010/12/20/we-are-angry-because-we-are-overly-optimistic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

