<?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>I Drivel</title>
	<atom:link href="http://blog.justinlintz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.justinlintz.com</link>
	<description>whatever comes to mind</description>
	<lastBuildDate>Wed, 12 Oct 2011 01:37:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>NRPE returning no output?</title>
		<link>http://blog.justinlintz.com/2011/10/nrpe-returning-no-output/</link>
		<comments>http://blog.justinlintz.com/2011/10/nrpe-returning-no-output/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 01:37:13 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=200</guid>
		<description><![CDATA[<p>command[check_recent_core]=PLUGINPATH/check_recent_core.sh --file="$ARG1" --freshness=$ARG2$</p> <p>Spot the error? I only wasted an hour of my life and another 30 minutes of co-workers trying to figure out why I kept getting a "NRPE: No output returned from plugin" error in Nagios. The issue? $ARG1 is missing a closing &#8220;$&#8221;. *slams head on desk* </p> ]]></description>
				<content:encoded><![CDATA[<p><tt>command[check_recent_core]=PLUGINPATH/check_recent_core.sh --file="$ARG1" --freshness=$ARG2$</tt></p>
<p>Spot the error?  I only wasted an hour of my life and another 30 minutes of co-workers trying to figure out why I kept getting a <tt>"NRPE: No output returned from plugin"</tt> error in Nagios.  The issue?  <tt>$ARG1</tt> is missing a closing &#8220;$&#8221;.  *slams head on desk*  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2011/10/nrpe-returning-no-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful C Debug Macro</title>
		<link>http://blog.justinlintz.com/2011/09/useful-c-debug-macro/</link>
		<comments>http://blog.justinlintz.com/2011/09/useful-c-debug-macro/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 05:22:21 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=184</guid>
		<description><![CDATA[<p>Tonight I took the plunge to get back into some more C coding. In getting my environment setup I came across a useful debugging macro. This macro will output the filename and line number every time it&#8217;s expanded. I wanted to make sure I understood how the macro was working before just copying and <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2011/09/useful-c-debug-macro/">Useful C Debug Macro</a></span>]]></description>
				<content:encoded><![CDATA[<p>Tonight I took the plunge to get back into some more C coding.  In getting my environment setup I came across a <a href="http://stackoverflow.com/questions/2429333/c-debugging-macro-with-different-debug-sources/2429406#2429406">useful debugging macro</a>.  This macro will output the filename and line number every time it&#8217;s expanded.  I wanted to make sure I understood how the macro was working before just copying and pasting it into my source code so I&#8217;ve broken it down below for myself and others to understand.</p>
<p>Here is a copy of the code that I slightly modified to also include the function name from where the debug macro is being used.<br />
<script src="http://gist.github.com/1192247.js"></script></p>
<p>First we check if the <tt>DEBUG</tt> macro has been defined at all.  If it has been, we declare a function-like <tt>_DEBUG</tt> macro that will get expanded to our debugging function.  If <tt>DEBUG</tt> has not been defined, we still declare our function-like macro the same but with just no body so the macro will not be expanded to anything.</p>
<p>Our <tt>_DEBUG</tt> macro makes use of a few predefined macros:<br />
<tt>__FILE__</tt>: Expands to the current file name.  This will not print the shortname of the file.<br />
<tt>__FUNCTION__</tt>: Expands to the current function the code is being executed from.  This is a C99 and GCC feature only.<br />
<tt>__LINE__</tt>: Expands to the current line number in the file</p>
<p>We also make use of &#8216;variadic macros&#8217; aka macros that accept a variable number of arguments.  A variadic macro can be defined named or unnamed.  We use the named method which involves putting an argument name followed by &#8216;&#8230;&#8217; which is later referenced by just using the argument name in the macro body.  An unnamed variadic macro just involves using &#8216;&#8230;&#8217; and later referenced in the macro body using the predefined macro <tt>__VA_ARGS__</tt></p>
<p>A default format string is passed into <tt>printf</tt> to take care of the formatting for the filename, function name and line number.  Immediately after the default format string, we specify the <tt>fmt</tt> argument we used that will get assigned our own format string that we pass into the <tt>_DEBUG</tt> macro.  This will all get expanded to <tt>"%s:%s:%d: " "val of fmt"</tt> which is valid C syntax. </p>
<p>To activate the <tt>_DEBUG</tt> macro we can define <tt>DEBUG</tt> in our gcc command</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-D</span> DEBUG</div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2011/09/useful-c-debug-macro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Stay Puft Marshmallow Man Moment</title>
		<link>http://blog.justinlintz.com/2011/04/my-stay-puft-marshmallow-man-moment/</link>
		<comments>http://blog.justinlintz.com/2011/04/my-stay-puft-marshmallow-man-moment/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 02:11:58 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=154</guid>
		<description><![CDATA[<p>A couple years ago I was sitting at a poker table for my final interview for a sys admin position with . It had been a long day of mentally exhausting questions, and the interview was coming to a close. The person I was interviewing with sat for a moment and pondered his next <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2011/04/my-stay-puft-marshmallow-man-moment/">My Stay Puft Marshmallow Man Moment</a></span>]]></description>
				<content:encoded><![CDATA[<p>A couple years ago I was sitting at a poker table for my final interview for a sys admin position with <company name redacted>.  It had been a long day of mentally exhausting questions, and the interview was coming to a close.  The person I was interviewing with sat for a moment and pondered his next question for me.  </p>
<p>&#8220;You&#8217;ve got a building across the street with a bunch of data on a server.  The building is on fire.  You&#8217;ve got a connection between the two buildings.  What&#8217;s the fastest way to get the data over to you before the building burns down?&#8221;</p>
<p>&#8220;I&#8217;d use dd over netcat&#8221;<br />
<em>What the fuck did I just say?</em> </p>
<p>The interviewer gave me a strange look and asked me to elaborate.  </p>
<p>I knew right away what I said was not the best answer.  In fact, I knew anything I would have said at that very moment would have been wrong.  As soon as I heard the question, <a href="http://www.youtube.com/watch?v=4JVkonHpxKk#t=0m56s">&#8220;I couldn&#8217;t help it. It just popped in there.&#8221;</a>  There was more information needed to answer the question correctly.  I spent the next few minutes awkwardly elaborating on the idea and eventually shifted into a completely different answer as I talked out the problem more.  </p>
<p>Part of being a sys admin sometimes means having to make important decisions during major disasters.  These issues will come up at anytime, and they don&#8217;t care if you are running on 2 hours of sleep.  The worst thing to do in these situations is to act on the first thing that pops into your mind.  Seemingly harmless commands can turn into disasters quickly.  Stop and think for a few moments, gather additional information and formulate a few possible actions to take. The few moments spent thinking before taking any action could be the difference between a smooth outage and an outage where a 100 foot tall marshmallow man comes marching out of the Temple of Gozer.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2011/04/my-stay-puft-marshmallow-man-moment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Determining my most used focal length in photos with python and dcraw</title>
		<link>http://blog.justinlintz.com/2010/12/determining-my-most-used-focal-length-in-photos-with-python-and-dcraw/</link>
		<comments>http://blog.justinlintz.com/2010/12/determining-my-most-used-focal-length-in-photos-with-python-and-dcraw/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 05:52:50 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=138</guid>
		<description><![CDATA[<p>For the holidays I got a new Canon 7D camera. I&#8217;ve been saving quite a few amazon gift cards over the last year that I was previously planning on using towards purchasing the camera but thankfully Santa delivered me one. My current lens collection consists of </p> 10-22mm f/3.5-4.5 70-200mm f/4 50mm f/1.8 18-55mm <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2010/12/determining-my-most-used-focal-length-in-photos-with-python-and-dcraw/">Determining my most used focal length in photos with python and dcraw</a></span>]]></description>
				<content:encoded><![CDATA[<p>For the holidays I got a new <a href="http://www.usa.canon.com/cusa/consumer/products/cameras/slr_cameras/eos_7d">Canon 7D</a> camera.  I&#8217;ve been saving quite a few amazon gift cards over the last year that I was previously planning on using towards purchasing the camera but thankfully Santa delivered me one.  My current lens collection consists of </p>
<ul>
<li><a href="http://www.usa.canon.com/cusa/consumer/products/cameras/ef_lens_lineup/ef_s_10_22mm_f_3_5_4_5_usm">10-22mm f/3.5-4.5</a></ul>
<ul>
<li><a href="http://www.usa.canon.com/cusa/consumer/products/cameras/ef_lens_lineup/ef_70_200mm_f_4l_usm">70-200mm f/4</a></ul>
<ul>
<li><a href="http://www.usa.canon.com/cusa/consumer/products/cameras/ef_lens_lineup/ef_50mm_f_1_8_ii">50mm f/1.8</a></ul>
<ul>
<li><a href="http://www.usa.canon.com/cusa/support/consumer/eos_slr_camera_systems/lenses/ef_s_18_55mm_f_3_5_5_6_usm">18-55mm f/3.5-5.6</a> (kit lens)</ul>
<p>The lens collection has been built over the last 4 years from when I first got my <a href="http://www.usa.canon.com/cusa/support/consumer/eos_slr_camera_systems/eos_digital_slr_cameras/digital_rebel_xt">Canon Rebel XT</a> and I&#8217;ve been fairly happy with them thus far.  As part of looking into what new lens to get I wanted to know what focal length I shot with the most over the previous years.  A quick look with</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.CR2'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-l</span></div></div>
<p>shows I have 4697 RAW images in my photos folder, so I&#8217;ll need some sort of automated solution to figure this out.</p>
<p>My first inclination was to poke around Python&#8217;s PIL and see if it supported reading of RAW images, it didn&#8217;t appear to do so that option was out.  I looked at the Canon RAW format at <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html">http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html</a> and contemplated doing some parsing of the files to extract the info I needed from the EXIF data.  I remembered in the past I had used <a href="http://ufraw.sourceforge.net/">UFRaw</a> to play around with RAW conversion in Linux a while back and saw they are using a nice simple tool to do their RAW parsing called <a href="http://www.cybercom.net/~dcoffin/dcraw/">dcraw</a>.  It&#8217;s a small C program that I was able to compile the source with the following commands&#8230;</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> libjpeg-dev liblcms-dev <br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-o</span> dcraw <span style="color: #660033;">-O4</span> dcraw.c <span style="color: #660033;">-lm</span> <span style="color: #660033;">-ljpeg</span> <span style="color: #660033;">-llcms</span></div></div>
<p>Using dcraw seemed like the path of least resistance and now I just needed to wrap some code around it to go through all of my RAW images and extract the EXIF info and keep a hash table of the focal length value.  I whipped up a small python script and posted a gist of it over on github.<br />
<script src="http://gist.github.com/756716.js"></script><br />
It&#8217;s fairly straight forward and could easily be modified to do more, like collect aperture sizes or any other EXIF data.  I may go back and build it out a bit more to make it more flexible in what data it collects, but for now this suited my needs at the time.  My top 10 focal lengths ended up being</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Total pics to process: <span style="color: #000000;">4697</span><br />
Length: <span style="color: #000000;">50.0</span> &nbsp;, Count: <span style="color: #000000;">1624</span><br />
Length: <span style="color: #000000;">22.0</span> &nbsp;, Count: <span style="color: #000000;">576</span><br />
Length: <span style="color: #000000;">18.0</span> &nbsp;, Count: <span style="color: #000000;">423</span><br />
Length: <span style="color: #000000;">200.0</span> &nbsp;, Count: <span style="color: #000000;">404</span><br />
Length: <span style="color: #000000;">55.0</span> &nbsp;, Count: <span style="color: #000000;">373</span><br />
Length: <span style="color: #000000;">10.0</span> &nbsp;, Count: <span style="color: #000000;">192</span><br />
Length: <span style="color: #000000;">70.0</span> &nbsp;, Count: <span style="color: #000000;">176</span><br />
Length: <span style="color: #000000;">37.0</span> &nbsp;, Count: <span style="color: #000000;">74</span><br />
Length: <span style="color: #000000;">16.0</span> &nbsp;, Count: <span style="color: #000000;">33</span></div></div>
<p>Takes close to 11 seconds on average to calculate that for 4697 images.  </p>
<p>I had been wanting to upgrade my 50mm f/1.8 lens for a bit as I&#8217;d really started to notice the short comings of it.  The lens has a hard time focusing and also had a bit of a back focusing issue.  Since my Uncle borrows my camera a lot when he goes on vacation I worked out a deal with him to purchase the 50mm f/1.4 for me and in exchange I&#8217;d give him my old Canon Rebel XT with the kit lens and the 50mm f/1.8 lens.  </p>
<p>The kit lens was a great walk about lens so I&#8217;m currently trying to decide on a good and reasonably priced lens to cover somewhere in the 18-100mm range. I&#8217;m reading through a bunch of comments on amazon reviews and dpreview forums to figure out what my best bang for my buck would be for a lens in that range.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2010/12/determining-my-most-used-focal-length-in-photos-with-python-and-dcraw/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Python pip on Ubuntu Lucid Lynx</title>
		<link>http://blog.justinlintz.com/2010/09/python-pip-on-ubuntu-lucid-lynx/</link>
		<comments>http://blog.justinlintz.com/2010/09/python-pip-on-ubuntu-lucid-lynx/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 04:48:24 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=135</guid>
		<description><![CDATA[<p>Lately I&#8217;ve been reading up on Django a bit in an effort to get back into programming.  It seems the preferred way of running Django is inside a virtualenv environment.  I try to stick to packages when possible for installing applications and saw that the python-virtualenv package wasn&#8217;t too far behind at version 1.4.5, <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2010/09/python-pip-on-ubuntu-lucid-lynx/">Python pip on Ubuntu Lucid Lynx</a></span>]]></description>
				<content:encoded><![CDATA[<p>Lately I&#8217;ve been reading up on Django a bit in an effort to get back into programming.  It seems the preferred way of running Django is inside a <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> environment.  I try to stick to packages when possible for installing applications and saw that the python-virtualenv package wasn&#8217;t too far behind at version 1.4.5, where the latest is at 1.5.1.  This appeared at first to suit me just fine until I discovered the version of pip that gets installed along with python-virtualenv is at 0.3.1, where the latest is at 0.8.1.  The version of pip installed is so old that it doesn&#8217;t have support for the &#8220;uninstall&#8221; command yet, blech.  Luckily you can do the following from within pip to upgrade itself</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> pip <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--upgrade</span> pip</div></div>
<p>Now back to reading about setting up a virtualenv environment</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2010/09/python-pip-on-ubuntu-lucid-lynx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring Varnish</title>
		<link>http://blog.justinlintz.com/2010/08/configuring-varnish/</link>
		<comments>http://blog.justinlintz.com/2010/08/configuring-varnish/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 03:22:19 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=103</guid>
		<description><![CDATA[<p>At $WORK I&#8217;m currently working on deploying a pool of Varnish servers to sit in front of some Apache servers running Pressflow. On our current infrastructure we&#8217;ve been running Squid for the past few years with very good success , minus a hiccup or two along the way, one involving memory fragmentation (thank you <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2010/08/configuring-varnish/">Configuring Varnish</a></span>]]></description>
				<content:encoded><![CDATA[<p>At $WORK I&#8217;m currently working on deploying a pool of <a href="http://varnish-cache.org/">Varnish</a> servers to sit in front of some Apache servers running <a href="http://pressflow.org/">Pressflow</a>.  On our current infrastructure we&#8217;ve been running Squid for the past few years with very good success , minus a hiccup or two along the way, one involving memory fragmentation (thank you <a href="http://goog-perftools.sourceforge.net/doc/tcmalloc.html">tcmalloc</a>).  Varnish has a few nice features that Squid lacks.</p>
<li>The ability to PURGE objects using wildcards</li>
<li>Better support for multiple processors (Squid can benefit from multi procs when using AUFS)</li>
<li>Grace period that can be configured to serve objects from the cache after they&#8217;ve expired while fetching the new content from the backend.  You can also use this to serve up stale content if your backend is down</li>
<li>Ships with a nice set of command line tools (varnishtop,varnishlog,varnishstat,varnishhist,etc&#8230;)</li>
<li>A very flexible scripting/configuration language (you can even do inline C if you&#8217;re feeling saucy) that allows you to manipulate the objects at any point in the request or response (<a href="http://varnish-cache.org/raw-attachment/wiki/VCLExampleDefault/varnish-2.0.4-flow.jpg">See flow chart</a>)</li>
<p>There are many others but these are just a few off the top of my head and I&#8217;m still discovering what other capabilities Varnish has.  The site has not gone live yet so I&#8217;m still testing on a dev version of the site and have not had an opportunity to perform any load testing yet. So far with my current working configuration I&#8217;ve made the following tweaks</p>
<li>Stripped cookies off static objects</li>
<li>Stripped Google analytics cookies</li>
<li>Removed empty cookies</li>
<li>Configured a graceful period to serve up stale objects from cache</li>
<li>Added a debugging header to show weather the object was a cache HIT or MISS</li>
<p>The use of mod_expires on the Apache backend controls cache times for static assets (css,js,images,etc..).  In my googling around when reading about Varnish I see a lot of people are setting cache times in their VCLs.  IMO you should be letting the backend or application itself control the TTLs on objects.  Within your application you can set more defined TTLs for certain  sections of your site or even certain types of dynamic content without having to rely on complex VCL rules or deal with the deployment of the rules into Varnish.  While Varnish does support a &#8220;graceful&#8221; style restart, its not quite as eloquant as doing <i>service apache graceful</i>.  Kristian Lyngstol (one of the Varnish devs) has a good <a href="http://kristian.blog.linpro.no/2009/02/18/easy-reloading-of-varnish-vcl/">post</a> on his blog on dealing with this.  Also with the use of mod_expires you can set TTLs based on MIME-type within Apache.</p>
<p>One other thing I see a lot of people blindly recommending in configurations to deal with Varnish&#8217;s behavior of not caching cookies is to take the cookie value and add it into Varnish&#8217;s hash of the object.  e.g.</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sub vcl_hash <span style="color: #009900;">&#123;</span><br />
set req.<span style="color: #202020;">hash</span> <span style="color: #339933;">+=</span> req.<span style="color: #202020;">http</span>.<span style="color: #202020;">cookie</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>If a light bulb just went off in your head as to why this is a bad idea, kudos to you.  What you&#8217;re basically doing is creating a cache per-user on your Varnish server.  Your hit ratio will plummet from this config.  There are scenarios where this <em>can</em> be used in a good way.  In talking with some folks in #varnish on irc.linpro.no, a scenario where you&#8217;d want this is if say you had a cookie that was a display filter on your site or some sort of site customization that didn&#8217;t have a large number of combinations.</p>
<p>One thing that bothers me about Varnish currently is that it&#8217;s admin interface is completely unsecured.  By default it listens on localhost but without any authentication, anyone with a shell on your Varnish box can bring down your Varnish instance or modify the config in anyway they feel fit.  For those that allow dev&#8217;s on production servers to debug logs, this is a bit of a security concern.  I&#8217;m not really sure of a workaround for this, so if anyone has any ideas, leave it in the comments below.</p>
<p>If you use Cacti for trending, there are some great templates available over at the <a href="http://forums.cacti.net/viewtopic.php?p=182152">cacti forums</a>.  They utilize a python script that needs access to the admin interface.</p>
<p>I&#8217;ll probably post some more in the future on Varnish as I do further reading and testing with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2010/08/configuring-varnish/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thinkpad Trackpoint sensitivity on Ubuntu</title>
		<link>http://blog.justinlintz.com/2010/06/thinkpad-trackpoint-sensitivity-on-ubuntu/</link>
		<comments>http://blog.justinlintz.com/2010/06/thinkpad-trackpoint-sensitivity-on-ubuntu/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 00:27:54 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=97</guid>
		<description><![CDATA[<p>A while back I found some notes on configuring the sensitivity of my trackpoint on my Thinkpad T43 and took the time to tweak the values to get it just right. The commands were</p> /bin/echo -n 171 &#62; /sys/devices/platform/i8042/serio1/serio2/sensitivity /bin/echo -n 119 &#62; /sys/devices/platform/i8042/serio1/serio2/speed <p>In order to keep those values the same on reboot, <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2010/06/thinkpad-trackpoint-sensitivity-on-ubuntu/">Thinkpad Trackpoint sensitivity on Ubuntu</a></span>]]></description>
				<content:encoded><![CDATA[<p>A while back I found some notes on configuring the sensitivity of my trackpoint on my Thinkpad T43 and took the time to tweak the values to get it just right.  The commands were</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">171</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>i8042<span style="color: #000000; font-weight: bold;">/</span>serio1<span style="color: #000000; font-weight: bold;">/</span>serio2<span style="color: #000000; font-weight: bold;">/</span>sensitivity<br />
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">119</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>i8042<span style="color: #000000; font-weight: bold;">/</span>serio1<span style="color: #000000; font-weight: bold;">/</span>serio2<span style="color: #000000; font-weight: bold;">/</span>speed</div></div>
<p>In order to keep those values the same on reboot, I placed those commands in /etc/rc.local.  I rebooted and&#8230; values got reset.  After struggling a bit and just giving up on the issue, I ended up just making a shell script that I would execute on boot each time (crappy solution).  Finally I got annoyed with the issue enough and researched it again some more and stumbled upon<a href="http://ubuntuforums.org/showpost.php?p=9365735&#038;postcount=13">this post on Ubuntu Forums</a>.  A couple of things I learned from that&#8230;</p>
<ol>
<li> The proper ways to set the values in the sysfs is to use udev rules, <a href="http://www.reactivated.net/writing_udev_rules.html">Writing udev rules</a></li>
<li> Even if I used a udev rule, there appears to be an issue where the device does not exist yet at the time the rule is processed to set the value for the device</li>
</ol>
<p><strong>Solution</strong> (per forum post) create a file <strong>/etc/udev/rules.d/trackpoint.rules</strong> and place the following in</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">SUBSYSTEM</span>==<span style="color: #ff0000;">&quot;serio&quot;</span>, <span style="color: #007800;">DRIVERS</span>==<span style="color: #ff0000;">&quot;psmouse&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span>description<span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;Synaptics pass-through&quot;</span>, <span style="color: #007800;">WAIT_FOR</span>=<span style="color: #ff0000;">&quot;/sys/devices/platform/i8042/serio1/serio2/sensitivity&quot;</span> ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span>sensitivity<span style="color: #7a0874; font-weight: bold;">&#125;</span>=<span style="color: #ff0000;">&quot;171&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span>speed<span style="color: #7a0874; font-weight: bold;">&#125;</span>=<span style="color: #ff0000;">&quot;119&quot;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2010/06/thinkpad-trackpoint-sensitivity-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Check for missing reverse DNS entries on network</title>
		<link>http://blog.justinlintz.com/2010/05/check-for-missing-reverse-dns-entries-on-network/</link>
		<comments>http://blog.justinlintz.com/2010/05/check-for-missing-reverse-dns-entries-on-network/#comments</comments>
		<pubDate>Wed, 26 May 2010 18:15:48 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=90</guid>
		<description><![CDATA[<p>A quick way to check your network for IPs missing reverse DNS entries&#8230;.</p> nmap -PE -sP 10.0.0.0/24 &#124; awk '{if ($2 ~ /^[[:digit:]]/ ) print $2}' ]]></description>
				<content:encoded><![CDATA[<p>A quick way to check your network for IPs missing reverse DNS entries&#8230;.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nmap -PE -sP 10.0.0.0/24 | awk '{if ($2 ~ /^[[:digit:]]/ ) print $2}'</div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2010/05/check-for-missing-reverse-dns-entries-on-network/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Support for authorized-keys.d/</title>
		<link>http://blog.justinlintz.com/2010/02/support-for-authorized-keys-d/</link>
		<comments>http://blog.justinlintz.com/2010/02/support-for-authorized-keys-d/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 05:02:41 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[thoughts linux]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/2010/02/support-for-authorized-keys-d/</guid>
		<description><![CDATA[<p>Why is there no subdir inside .ssh called authorized-keys.d where I can just throw my ssh keys and easily manage them by file name instead of having to edit the authorized-keys(2) file?</p> <p>I need to do some googling on this , a quick search yields this debian bug report on wishing for support for <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2010/02/support-for-authorized-keys-d/">Support for authorized-keys.d/</a></span>]]></description>
				<content:encoded><![CDATA[<p>Why is there no subdir inside .ssh called authorized-keys.d where I can just throw my ssh keys and easily manage them by file name instead of having to edit the authorized-keys(2) file?</p>
<p>I need to do some googling on this , a quick search yields this <a href="http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg518628.html">debian bug report</a> on wishing for support for one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2010/02/support-for-authorized-keys-d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Quote module</title>
		<link>http://blog.justinlintz.com/2010/01/python-quote-module/</link>
		<comments>http://blog.justinlintz.com/2010/01/python-quote-module/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 05:38:37 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.justinlintz.com/?p=81</guid>
		<description><![CDATA[<p>Over the past couple of years I&#8217;ve been wanting to learn Python more seriously but really haven&#8217;t sat down and just done it.   I&#8217;ve written a couple of various scripts for personal and work use but always felt they weren&#8217;t coded in a &#8220;pythonic&#8221; way.  I&#8217;m now reading Learning Python (4th edition) from the <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.justinlintz.com/2010/01/python-quote-module/">Python Quote module</a></span>]]></description>
				<content:encoded><![CDATA[<p>Over the past couple of years I&#8217;ve been wanting to learn Python more seriously but really haven&#8217;t sat down and just done it.   I&#8217;ve written a couple of various scripts for personal and work use but always felt they weren&#8217;t coded in a &#8220;pythonic&#8221; way.  I&#8217;m now reading <a href="oreilly.com/catalog/9780596158071">Learning Python (4th edition)</a> from the beginning and making sure I learn things properly from the ground up.  When I was writing my code in the past I wasn&#8217;t aware of what objects were immutable vs mutable or how generators worked.  I basically knew what I wanted to accomplish before writing my code and would reference the online documentation and just go at it.  Overtime I picked up on some &#8220;pythonic&#8221; methods from looking at code examples, for example, using optparse for handling arguments passed into your program.</p>
<p>My first project I decided to tackle as I go through my book is writing a module that will fetch stock quotes from Yahoo&#8217;s Finance page and store them in memcached.  I just pushed it out to github available @ <a href="http://github.com/jlintz/python_quote">http://github.com/jlintz/python_quote</a>.  I&#8217;m hoping to get some feedback from some people on where I can improve in my code and hopefully it will be useful to someone else out there.  As I go through the book I plan on going back and looking at the code and see what I can refactor and I&#8217;m sure along the way I&#8217;ll probably re-architect things.</p>
<p>One thing I know I need to do is write some unit tests for the module.   When I was in my Computer Science program in college, we really never had any exposure to unit tests.  The unit tests consisted of assert statements and really never had any real lessons on them.  I need to do more reading on <a href="http://docs.python.org/library/unittest.html">unittest</a>.  I know many developers write their unit tests first before writing a single line of code in a test driven development approach.  It&#8217;s something I want to look at more and see if I should consider picking that up.</p>
<p>Also as part of this coding project, it was a good excuse to get some exercise with <a href="http://git-scm.com/">Git</a>.  It&#8217;s pretty easy to work with and I haven&#8217;t even scratched the surface of its potential.  I just need to begin looking at some of its more advanced features and incorporating them into my work flow.</p>
<p>Vim is another program I&#8217;m getting some finger exercise in.  When I started my job 3 years ago I had never really opened Vim/Vi but one day forced myself to learn it because as a sysadmin, Vi will always be there for you, <a href="http://www.familyguyquotes.com/quotes/695.html">like your friend Stewie</a>.  In my day to day uses of Vi, I just used the basics, hjkl and :wq.  Slowly I picked up some commands from co-workers and got used to using them daily.  When writing code in Vim , there are a lot of tricks and commands to aide you in writing code , I&#8217;ve read about many but now it&#8217;s a matter of incorporating them so I don&#8217;t have to think much and breaking my old habits to use the new commands I&#8217;ve read about.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justinlintz.com/2010/01/python-quote-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
