<?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>Patrick Mylund Nielsen &#187; Tools</title>
	<atom:link href="http://patrickmylund.com/blog/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://patrickmylund.com</link>
	<description>What happens in the event horizon stays in the event horizon</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:36:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What We Learned From Five Million Books</title>
		<link>http://patrickmylund.com/blog/what-we-learned-from-five-million-books/</link>
		<comments>http://patrickmylund.com/blog/what-we-learned-from-five-million-books/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 10:57:23 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Science & Nature]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Erez Lieberman Aiden]]></category>
		<category><![CDATA[Jean-Baptiste Michel]]></category>
		<category><![CDATA[Ngram viewer]]></category>
		<category><![CDATA[TED]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=2085</guid>
		<description><![CDATA[Here&#8217;s a really fascinating TED talk where Erez Lieberman Aiden and Jean-Baptiste Michel explain how they&#8217;ve used Google&#8217;s book digitization effort to identify cultural trends: What&#8217;s really interesting is that their work resulted in the Google Labs tool Books Ngram Viewer which is like Google Trends, only for books, and dating back to year 1500. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Here&#8217;s a really fascinating TED talk where Erez Lieberman Aiden and Jean-Baptiste Michel explain how they&#8217;ve used Google&#8217;s book digitization effort to identify cultural trends:</p>
<p><object width="700" height="394"><param name="movie" value="http://www.youtube.com/v/SdhJwLJcdsU?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/SdhJwLJcdsU?version=3" type="application/x-shockwave-flash" width="700" height="394" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>What&#8217;s really interesting is that their work resulted in the Google Labs tool <a href="http://ngrams.googlelabs.com/" title="Books Ngram viewer">Books Ngram Viewer</a> which is like Google Trends, only for books, and dating back to year 1500. For instance, it looks like things aren&#8217;t as wonderful and glorious as they once were:</p>
<p><a href="http://static.pmylund.com/blog/content/ngram_viewer-screenshot_01.png"><img src="http://static.pmylund.com/blog/content/ngram_viewer-screenshot_01-700x513.png" alt="" title="Screenshot of Books Ngram Viewer" width="700" height="513" class="aligncenter size-large wp-image-2086" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/what-we-learned-from-five-million-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Take One Of My Spotify Invitations</title>
		<link>http://patrickmylund.com/blog/im-giving-out-50-spotify-invitations/</link>
		<comments>http://patrickmylund.com/blog/im-giving-out-50-spotify-invitations/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 14:26:24 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Spotify]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1990</guid>
		<description><![CDATA[I&#8217;ll send a Spotify invitation to the first 50 impatient Americans who send an email to spotify-invite at this domain, or write a comment using an account with a valid email address :-) Update: No invitations left. Thanks for playing.]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ll send a <a href="https://www.spotify.com/us/" title="Spotify">Spotify</a> invitation to the first 50 impatient Americans who send an email to spotify-invite at this domain, or write a comment using an account with a valid email address :-)</p>
<p><object width="700" height="419"><param name="movie" value="http://www.youtube.com/v/CvYX_P_c__8?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CvYX_P_c__8?version=3" type="application/x-shockwave-flash" width="700" height="419" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>Update</strong>: No invitations left. Thanks for playing.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/im-giving-out-50-spotify-invitations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F.lux Helps Me Sleep</title>
		<link>http://patrickmylund.com/blog/flux-helps-me-sleep/</link>
		<comments>http://patrickmylund.com/blog/flux-helps-me-sleep/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 18:43:45 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[F.lux]]></category>
		<category><![CDATA[Michael Herf]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1437</guid>
		<description><![CDATA[I recently stumbled upon F.lux, an application for Windows, Mac OS X and Linux that changes the color temperature of your display depending on the time of day. Although changing your color temperature is nothing new, F.lux makes it completely seamless: Just set your location and your desired color temperatures (optional), then forget about it. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently stumbled upon <a href="http://stereopsis.com/flux/" title="F.lux">F.lux</a>, an application for Windows, Mac OS X and Linux that changes the color temperature of your display depending on the time of day. Although changing your color temperature is nothing new, F.lux makes it completely seamless: Just set your location and your desired color temperatures (optional), then forget about it.</p>
<p><img src="http://static.pmylund.com/blog/content/2010/04/flux-shot.png" alt="" title="F.lux screenshot" width="395" height="200" class="aligncenter size-full wp-image-1438" /></p>
<p>From the author:</p>
<blockquote><p>Ever notice how people texting at night have that eerie blue glow? Or wake up ready to write down the Next Great Idea, and get blinded by your computer screen? During the day, computer screens look good—they&#8217;re designed to look like the sun. But, at 9PM, 10PM, or 3AM, you probably shouldn&#8217;t be looking at the sun.</p>
<p>F.lux fixes this: it makes the color of your computer&#8217;s display adapt to the time of day, warm at night and like sunlight during the day. It&#8217;s even possible that you&#8217;re staying up too late because of your computer. You could use f.lux because it makes you sleep better, or you could just use it just because it makes your computer look better.</p></blockquote>
<p>Get it <a href="http://stereopsis.com/flux/" title="F.lux">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/flux-helps-me-sleep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Script: EmailsFromFile</title>
		<link>http://patrickmylund.com/blog/new-script-emails-from-file/</link>
		<comments>http://patrickmylund.com/blog/new-script-emails-from-file/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 01:33:18 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[EmailsFromFile]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1400</guid>
		<description><![CDATA[EmailsFromFile is a Python script that finds all email addresses in a file. It shows one email address per line by default, but you can pick your own separator (i.e. a comma or space) if you want. The script is very simple; the magic lies in the email regular expression (based on the RFC 2822 [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://patrickmylund.com/projects/emailsfromfile/" title="EmailsFromFile">EmailsFromFile</a> is a Python script that finds all email addresses in a file. It shows one email address per line by default, but you can pick your own separator (i.e. a comma or space) if you want.</p>
<p>The script is very simple; the magic lies in the email regular expression (based on the <a href="http://tools.ietf.org/html/rfc2822" title="RFC 2822" rel="nofollow">RFC 2822</a> standard) which is, quite frankly, one of the craziest I&#8217;ve seen:</p>
<pre>(?:[a-z0-9!#$%&#038;'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&#038;'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])</pre>
<p>You can find more information about email regex <a href="http://www.regular-expressions.info/email.html" title="How to Find or Validate an Email Address" rel="nofollow">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/new-script-emails-from-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ITA Matrix 2 is Great for Finding Flights</title>
		<link>http://patrickmylund.com/blog/ita-matrix-2-is-great-for-finding-flights/</link>
		<comments>http://patrickmylund.com/blog/ita-matrix-2-is-great-for-finding-flights/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 01:29:33 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[flight planning]]></category>
		<category><![CDATA[ITA Software]]></category>
		<category><![CDATA[Matrix 2]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1384</guid>
		<description><![CDATA[I just finished looking at some interesting slides about the Computational Complexity of Air Travel Planning by Carl de Marcken, when I happened upon the product portfolio of his company. What I found was Matrix 2, an advanced flight planner. It&#8217;s the best flight planner I&#8217;ve ever used. Here are some screenshots to better illustrate [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I just finished looking at some <a href="http://www.demarcken.org/carl/papers/ITA-software-travel-complexity/img0.html" title="Computational Complexity of Air Travel Planning" rel="nofollow">interesting slides</a> about the Computational Complexity of Air Travel Planning by Carl de Marcken, when I happened upon the product portfolio of his company. What I found was <a href="http://matrix2.itasoftware.com/" title="Matrix 2" rel="nofollow">Matrix 2</a>, an advanced flight planner. It&#8217;s the best flight planner I&#8217;ve ever used.</p>
<p>Here are some screenshots to better illustrate what I&#8217;m talking about:</p>
<h2>Step 1: Search</h2>
<p><img src="http://static.pmylund.com/blog/content/2010/02/ita_matrix2-screenshot_1.png" alt="" title="ITA Matrix 2 - Main Search Screen" width="460" height="477" class="alignnone size-full wp-image-1385" /></p>
<h2>Step 2: Price Calendar</h2>
<p><a href="http://static.pmylund.com/blog/content/2010/02/ita_matrix2-screenshot_2.png"><img src="http://static.pmylund.com/blog/content/2010/02/ita_matrix2-screenshot_2-700x407.png" alt="" title="ITA Matrix 2 - Price Calendar" width="700" height="407" class="alignnone size-large wp-image-1386" /></a></p>
<h2>Step 3: Search Results and Itineraries</h2>
<p><a href="http://static.pmylund.com/blog/content/2010/02/ita_matrix2-screenshot_3.png"><img src="http://static.pmylund.com/blog/content/2010/02/ita_matrix2-screenshot_3-700x573.png" alt="" title="ITA Matrix 2 - Search Results and Itineraries" width="700" height="573" class="alignnone size-large wp-image-1387" /></a></p>
<p>Voila!</p>
<p>You can&#8217;t book flights through Matrix 2, but it&#8217;s an extremely useful tool nonetheless. It&#8217;s rather advanced, too, if you need it to be:</p>
<h2>Extra Search Options</h2>
<p><a href="http://static.pmylund.com/blog/content/2010/02/ita_matrix2-screenshot_4.png"><img src="http://static.pmylund.com/blog/content/2010/02/ita_matrix2-screenshot_4-700x435.png" alt="" title="ITA Matrix 2 - Extra Search Options" width="700" height="435" class="alignnone size-large wp-image-1388" /></a></p>
<p>Check it out for yourself, <a href="http://matrix2.itasoftware.com/" title="Matrix 2" rel="nofollow">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/ita-matrix-2-is-great-for-finding-flights/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Readability Gives You Back Your Blog Reading Sanity</title>
		<link>http://patrickmylund.com/blog/readability-gives-you-back-your-blog-reading-sanity/</link>
		<comments>http://patrickmylund.com/blog/readability-gives-you-back-your-blog-reading-sanity/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 21:51:11 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[aesthetics]]></category>
		<category><![CDATA[Arc90 Lab]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[Readability]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1318</guid>
		<description><![CDATA[Readability is a bookmarklet that sanitizes web pages not designed with readability in mind, like the vast majority of blogs. I can&#8217;t remember how many times I&#8217;ve caught myself reading eye-fraggingly small text on a site with a left-oriented, 10% width content column, and wondered why I need such a deliciously large monitor. Go to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://lab.arc90.com/experiments/readability/" title="Readability website" rel="nofollow">Readability</a> is a bookmarklet that sanitizes web pages not designed with readability in mind, like the vast majority of blogs. I can&#8217;t remember how many times I&#8217;ve caught myself reading eye-fraggingly small text on a site with a left-oriented, 10% width content column, and wondered why I need such a deliciously large monitor.</p>
<p><img src="http://static.pmylund.com/blog/content/2009/11/readability_screenshot-700x668.png" alt="Readability screenshot" title="Readability screenshot" width="700" height="668" class="aligncenter size-large wp-image-1319" /></p>
<p>Go to <a href="http://lab.arc90.com/experiments/readability/" title="Readability website" rel="nofollow">the website</a>, customize your design, drag the bookmarklet to your bookmarks bar, then go to a non-aesthetic web page and click the bookmark &#8212; voilà! Hopefully, you should feel no need to use the bookmarklet on this site. If you do, though, <a href="http://patrickmylund.com/blog/readability-gives-you-back-your-blog-reading-sanity/#respond" title="Leave a comment" rel="nofollow">let me know why</a>.</p>
<p>Check out the <a href="http://lab.arc90.com/" title="Arc90 Lab" rel="nofollow">Arc90 Lab</a> for more stuff from the authors of Readability; they make some pretty cool stuff. I especially like <a href="http://lab.arc90.com/2009/07/09/hashmask-another-more-secure-experiment-in-password-masking/" title="HashMask" rel="nofollow">HashMask</a> and <a href="http://lab.arc90.com/2009/07/08/halfmask-an-experiment-in-password-masking/" title="HalfMask" rel="nofollow">HalfMask</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/readability-gives-you-back-your-blog-reading-sanity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ding Ding Ding There&#8217;s Wi-Fi</title>
		<link>http://patrickmylund.com/blog/ding-ding-ding-theres-wifi/</link>
		<comments>http://patrickmylund.com/blog/ding-ding-ding-theres-wifi/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 20:24:05 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[inSSIDer]]></category>
		<category><![CDATA[outSSIDer]]></category>
		<category><![CDATA[Wi-Fi]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1214</guid>
		<description><![CDATA[outSSIDer is the lonely little application that&#8217;s there for you when you drop your phone in the big city and you really need to twitter about it. Get the laptop, open outSSIDer, close the lid, then start walking around. When it makes a successful connection to a wireless network, it&#8217;ll make a ding sound. If [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://quicklz.com/outssider/" title="outSSIDer website">outSSIDer</a> is the lonely little application that&#8217;s there for you when you drop your phone in the big city and you <em>really</em> need to twitter about it. Get the laptop, open outSSIDer, close the lid, then start walking around. When it makes a successful connection to a wireless network, it&#8217;ll make a ding sound. If it is then successful in retrieving a file (in this case, Google&#8217;s favicon) from the great internet, it&#8217;ll start dinging frantically. If not, well, <a href="http://instantrimshot.com/" title="Instant Rimshot" rel="nofollow">it&#8217;s the hi-hat</a>, of course.</p>

<a href='http://patrickmylund.com/blog/ding-ding-ding-theres-wifi/outssider_screenshot1/' title='outSSIDer Screenshot - Walk'><img width="150" height="150" src="http://static.pmylund.com/blog/content/2009/08/outssider_screenshot1-150x150.png" class="attachment-thumbnail" alt="outSSIDer Screenshot - Walk" title="outSSIDer Screenshot - Walk" /></a>
<a href='http://patrickmylund.com/blog/ding-ding-ding-theres-wifi/outssider_screenshot2/' title='outSSIDer Screenshot - Stop and Wait'><img width="150" height="150" src="http://static.pmylund.com/blog/content/2009/08/outssider_screenshot2-150x150.png" class="attachment-thumbnail" alt="outSSIDer Screenshot - Stop and Wait" title="outSSIDer Screenshot - Stop and Wait" /></a>
<a href='http://patrickmylund.com/blog/ding-ding-ding-theres-wifi/outssider_screenshot3/' title='outSSIDer Screenshot - Success'><img width="150" height="150" src="http://static.pmylund.com/blog/content/2009/08/outssider_screenshot3-150x150.png" class="attachment-thumbnail" alt="outSSIDer Screenshot - Success" title="outSSIDer Screenshot - Success" /></a>

<p>Download it <a href="http://quicklz.com/outssider/outssider.exe" title="outSSIDer download">here</a>.</p>
<p>I wasn&#8217;t joking about closing the laptop lid, by the way &#8212; you stand out a little when you walk around looking at an open laptop making cymbal noises.</p>
<p>outSSIDer is based on <a href="http://www.metageek.net/products/inssider" title="inSSIDer website">inSSIDer</a>, a Wi-Fi diagnostics tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/ding-ding-ding-theres-wifi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Start Guide to Infrastructure Monitoring with Nagios</title>
		<link>http://patrickmylund.com/blog/quick-it-infrastructure-monitoring-with-nagios/</link>
		<comments>http://patrickmylund.com/blog/quick-it-infrastructure-monitoring-with-nagios/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 15:16:29 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[infrastructure monitoring]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1202</guid>
		<description><![CDATA[Staying ahead of IT service issues can be frustrating when you manage several servers, or even a single server with many services. Enterprise IT Infrastructure Monitoring Solutions (a fancy term for something that is really pretty simple) attempt to remedy the problem by repeatedly checking the status of machines and services on the network and [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Staying ahead of IT service issues can be frustrating when you manage several servers, or even a single server with many services. Enterprise IT Infrastructure Monitoring Solutions (a fancy term for something that is really pretty simple) attempt to remedy the problem by repeatedly checking the status of machines and services on the network and alerting the responsible administrators as soon as something goes wrong, or even before there&#8217;s a problem.</p>
<p>It&#8217;s hard to argue against implementing a monitoring solution within the network, as it is much a setup-and-forget matter that adds negligible load. The monitoring solution itself is &#8212; or at least, should be &#8212; very low maintenance, yet provides very valuable insight into the health of the network.</p>
<h2>Introducing Nagios</h2>
<p><a href="http://nagios.org/" title="Nagios website"><img src="http://static.pmylund.com/blog/content/2009/08/nagios_logo.jpg" alt="Nagios Logo" title="Nagios Logo" width="150" height="37" class="alignright size-full wp-image-1206" /></a><a href="http://nagios.org/" title="Nagios website">Nagios</a> is an infrastructure monitoring solution that is both popular and open source. Apart from its obvious monitoring capabilities, it includes the ability to associate an event handler to an event, allowing you to fix a problem automatically. If &#8212; for example &#8212; one of your Python applications crashes, you can have Nagios do <code>python /opt/myapp/myapp.py</code> automatically, before any human administrators have the time to do so. Other features include the ability to create many kinds of reports, and to send notifications and alerts via email and SMS.</p>
<div id="attachment_1203" class="wp-caption aligncenter" style="width: 685px">
	<img src="http://static.pmylund.com/blog/content/2009/08/nagios_screenshot.png" alt="Nagios' web interface screenshot" title="Nagios' web interface" width="685" height="330" class="size-full wp-image-1203" />
	<p class="wp-caption-text">Nagios' web interface</p>
</div>
<p>Nagios is based primarily on C and shell scripts, which makes it light on performance but adds a slightly &#8216;hackish&#8217; feel. It comes with a CGI-based web interface (which we&#8217;ll spice up a bit) that lets you view and manage Nagios, through what are known as External Commands.</p>
<p>I&#8217;d like to demonstrate how to set up rudimentary Nagios monitoring on a small farm of Linux servers, with an Ubuntu/Debian server running the primary Nagios process. In the end, we&#8217;ll be monitoring the states of various services on the servers, including the ones seen in the screenshot above (Apache processes, APT, Current Load, Current Users, Disk Space, Dovecot, FTP, HTTP, MySQL, SMTP, SSH, Swap, Total Processes, and Zombie Processes).  We will also receive notifications by email whenever something goes wrong:</p>
<p><img src="http://static.pmylund.com/blog/content/2009/08/nagios_email_notification.png" alt="Nagios Email Notification" title="Nagios Email Notification" width="609" height="448" class="aligncenter size-full wp-image-1204" /></p>
<p>Please note that this guide is meant to get you up and running quickly, and that it&#8217;s <em>not</em> a substitute for the official <a href="http://www.nagios.org/documentation" title="Nagios documentation">Nagios documentation</a>. If you want to know what all of the different configuration options do (or <em>can</em> do), please consult the (excellent) documentation.</p>
<h2>Setting Up The Nagios Server</h2>
<p>The steps in this section should just be done on the main Nagios server, <em>not</em> the clients it will be monitoring. We&#8217;ll get to those later!</p>
<p>This procedure should be quite similar on other distributions if you use their package managers (<code>yum</code>, <code>yast</code>, <code>urpmi</code>, etc.) or <a href="http://nagios.sourceforge.net/docs/2_0/installing.html" title="Installing Nagios"> install Nagios from source</a>, but <em>no guarantees</em>.</p>
<ol>
<li>Let&#8217;s become root so we don&#8217;t have to prepend <code>sudo</code> to everything:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-s</span></pre></div></div>

</li>
<li>If you want to make use of Nagios&#8217; web interface and Apache isn&#8217;t already installed:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2</pre></div></div>

<p><small>It&#8217;s entirely possible to use something like <a href="http://nginx.net/" title="Nginx">nginx</a> or <a href="http://www.lighttpd.net/" title="Lighty">lighttpd</a> to serve the interface, but that is not covered in this guide.</small></li>
<li>Install Nagios from the package repositories:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> nagios3 nagios-nrpe-plugin</pre></div></div>

</li>
<p>Nagios should be accessible at http://nameofnagiosserver/nagios3 already! We still have some configuration to do, though.</p>
<li>Stop Nagios:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nagios3 stop</pre></div></div>

</li>
<li>Add a new user for the web interface, e.g. <em>patrick</em>. The default configuration grants all security permissions to the user <em>nagiosadmin</em>, but we&#8217;ll change that to the name of the new user, too:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>htpasswd.users patrick
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/nagiosadmin/patrick/g&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>cgi.cfg</pre></div></div>

</li>
<p><small>The <code>perl</code> command above replaces all occurrences of <em>nagiosadmin</em> with <em>patrick</em> in the file <code>/etc/nagios3/cgi.cfg</code>.</p>
<p>The users listed in <code>/etc/nagios3/cgi.cfg</code> are effectively <em>global administrators</em>. For regular users, you can still add them as users with <code>htpasswd</code>, but assign privileges by making them <em>Contacts</em> for certain hosts or hostgroups, instead. We&#8217;ll get to this later!</small></p>
<li>If you want to add more user accounts for the web interface:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>htpasswd.users john</pre></div></div>

</li>
<li>And if you want to give them superuser privileges:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/patrick/patrick, john/g&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>cgi.cfg</pre></div></div>

<p><small>Go through <code>/etc/nagios3/cgi.cfg</code> manually to see what the different security options do, and to grant more fine-grained privileges to other administrators.</small></li>
<li>Edit <code>/etc/nagios3/nagios.cfg</code> and change <code>check_external_commands=0</code> to <code>1</code> to allow monitoring commands to be issued through the web interface</li>
<li>On Debian/Ubuntu, run the following commands after setting <code>check_external_commands=1</code>:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dpkg-statoverride <span style="color: #660033;">--update</span> <span style="color: #660033;">--add</span> nagios www-data <span style="color: #000000;">2710</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>rw
dpkg-statoverride <span style="color: #660033;">--update</span> <span style="color: #660033;">--add</span> nagios nagios <span style="color: #000000;">751</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nagios3</pre></div></div>

</li>
<li>Edit <code>/etc/nagios3/conf.d/contacts_nagios2.cfg</code> to match your preferences. Example:

<div class="wp_syntax"><div class="code"><pre class="nagios" style="font-family:monospace;">define contact{
        contact_name                    patrick
        alias                           Patrick Mylund
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           my@emailaddress.com
        }</pre></div></div>

<p>And further down:</p>

<div class="wp_syntax"><div class="code"><pre class="nagios" style="font-family:monospace;">define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 patrick
        }</pre></div></div>

</li>
<li>Make a host definition for a server you want to monitor by creating a matching config file, e.g for the server &#8216;tranquillity&#8217;, <code>nano -w /etc/nagios3/conf.d/tranquillity_nagios2.cfg</code>, then insert a declaration. Example:

<div class="wp_syntax"><div class="code"><pre class="nagios" style="font-family:monospace;">define host{
        use                     generic-host            ; Name of host template to use
        host_name               tranquillity
        alias                   PatrickMylund.com Web Server
        address                 209.20.82.6
        }</pre></div></div>

<p><small>You can put all of your host definitions in one file if you want, e.g. <code>datacenter1_nagios2.cfg</code> &#8212; just remember the <code>_nagios2.cfg</code> at the end of the file name, which is what tells Nagios to load that file (and in the proper format).</small></li>
<li>Repeat the step above to add a host definition for each server you want to monitor</li>
<li>Move some standard configs to make room for our configured ones:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>localhost_nagios2.cfg <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>localhost_nagios2.cfg.old
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>services_nagios2.cfg <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>services_nagios2.cfg.old
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>patrickmylund.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>misc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1202</span>-nagios_quickstart<span style="color: #000000; font-weight: bold;">/</span>services_nagios2.cfg <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>services_nagios2.cfg</pre></div></div>

</li>
<li>Edit <code>/etc/nagios3/conf.d/hostgroups_nagios2.cfg</code>. List which hosts (comma-separated) should belong to which groups (<code>debian-servers</code>, <code>http-servers</code>, <code>ssh-servers</code>, and <code>ping-servers</code>), and add some extra hostgroups: <code>db-server</code>, <code>ftp-servers</code>, and <code>mail-servers</code>:

<div class="wp_syntax"><div class="code"><pre class="nagios" style="font-family:monospace;">define hostgroup {
        hostgroup_name  db-servers
                alias           Database servers
                members         tranquillity, singularity
        }
&nbsp;
define hostgroup {
        hostgroup_name  ftp-servers
                alias           FTP servers
                members         tranquillity, singularity
        }
&nbsp;
define hostgroup {
        hostgroup_name  mail-servers
                alias           IMAPS/SMTP servers
                members         tranquillity
        }</pre></div></div>

<p><small>You can see which services are associated with which hostgroups by looking in <code>/etc/nagios3/conf.d/services_nagios2.cfg</code>.</small>
</li>
</ol>
<p>We&#8217;re done with the Nagios server for now. Let&#8217;s look at the settings for the Linux servers we want to monitor.</p>
<h2>Configuring Monitored Clients</h2>
<p>The steps in this section should be done on <em>each</em> Linux host that you want to monitor.</p>
<ol>
<li>Again, let&#8217;s become root:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-s</span></pre></div></div>

</li>
<li>Install Nagios&#8217; NRPE module:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> nagios-nrpe-server</pre></div></div>

<p><small>Installing the NRPE module is optional, but you won&#8217;t be able to run any of Nagios&#8217; scripts directly on the target client if you do not. This is necessary for monitoring system stats, and generally anything that cannot be probed from the outside over the network (by the main Nagios server).</p>
<p>See the <a href="http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf" title="NRPE Documentation">NRPE documentation</a> (PDF) for manual installation instructions, as well as how to get information via SSH (<code>get_by_ssh</code>) instead of NRPE.</small></li>
<li>Stop NRPE:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nagios-nrpe-server stop</pre></div></div>

</li>
<li>Install a custom <a href="http://patrickmylund.com/files/misc/1202-nagios_quickstart/nrpe_local.cfg" title="nrpe_local.cfg">nrpe_local.cfg</a> (this will save us some time later):

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>nrpe_local.cfg <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>nrpe_local.cfg.old
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>patrickmylund.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>misc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1202</span>-nagios_quickstart<span style="color: #000000; font-weight: bold;">/</span>nrpe_local.cfg <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>nrpe_local.cfg</pre></div></div>

<p><small>Go through <code>/etc/nagios/nrpe_local.cfg</code> to see the list of commands that Nagios will be able to execute on hosts running NRPE. By default, NRPE will only run the commands defined in this configuration file, and without any arbitrary arguments. I strongly recommend you stick to this for security purposes.</p>
<p>On the main Nagios server, all service commands prefixed with <code>check_nrpe_1arg</code> in <code>/etc/nagios3/services_nagios2.cfg</code> are commands defined in <code>/etc/nagios/nrpe_local.cfg</code> on the monitored clients.</small></li>
<li>Define what hosts are going to be allowed to probe the NRPE module for information (comma-separated). For instance, if the main Nagios server has IP 192.168.1.105:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/127.0.0.1/192.168.1.105/g&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>nrpe_local.cfg</pre></div></div>

</li>
<li>If you have a firewall (<code>iptables</code>, <code>ufw</code>, etc.), you need to open for connections on port 5666 on the clients (for NRPE). If the main Nagios server has IP 192.168.1.105, you could do <code>ufw allow proto tcp from 192.168.1.105 to any port 5666</code>, or <code>ufw allow 5666/tcp</code> with Ubuntu&#8217;s Uncomplicated Firewall.</li>
<li>Start the NRPE module:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nagios-nrpe-server start</pre></div></div>

</li>
</ol>
<p>We just about have a basic Nagios setup now!</p>
<h2>Testing Nagios</h2>
<p>Let&#8217;s see if what we&#8217;ve set up is working. On the main Nagios server, start the Nagios service:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nagios3 start</pre></div></div>

<p>If all goes well, navigate to e.g. http://192.168.1.105, login with the user credentials you set up earlier, then click on <em>Service Detail</em> in the menu on the left. All of our services will be PENDING, meaning they&#8217;ll be checked shortly. You can speed this up by clicking on a service and clicking <em>Re-schedule the next check of this service</em> (this is what is called an External Command).</p>
<p>If any of the service states turn out to be CRITICAL or UNKNOWN, don&#8217;t panic &#8212; take a look at the different configuration files in <code>/etc/nagios3/conf.d</code>. The settings and commands are pretty straight-forward. </p>
<p>You can find examples of the resulting configuration files in <a href="http://static.pmylund.com/blog/content/2009/08/nagios-conf-example.tar.gz" title="Nagios Configuration Example">nagios-conf-example.tar.gz</a>. The configs are for a single server (singularity) with the IP address 192.168.2.3.</p>
<h2>An Extra Touch</h2>
<p>Nagios&#8217; web interface doesn&#8217;t look very pretty. We can spice it up a little by changing the CSS. I&#8217;ve prepared a modified <code>status.css</code> for your convenience:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>stylesheets<span style="color: #000000; font-weight: bold;">/</span>status.css <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>stylesheets<span style="color: #000000; font-weight: bold;">/</span>status.css.old
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>patrickmylund.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>misc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1202</span>-nagios_quickstart<span style="color: #000000; font-weight: bold;">/</span>status.css <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>stylesheets<span style="color: #000000; font-weight: bold;">/</span>status.css</pre></div></div>

<p>Now hit F5 in the web interface!</p>
<h2>Bear In Mind</h2>
<ul>
<li>The easiest way to monitor the Nagios server itself is to pretend it&#8217;s yet another server. Install NRPE, set the connection settings, and add it in the host declarations with the other servers.</li>
<li>The exclamation mark (!) is meant to separate command arguments in Nagios configuration files. For instance, <code>check_nrpe_1arg!check_swap</code> would mean you&#8217;re running <code>check_nrpe_1arg</code> with the argument <code>check_swap</code>.</li>
<li>All of the scripts and commands you can issue through Nagios are stand-alone scripts. When configuring Nagios, you can run each command, for instance <code>check_smtp</code>, manually instead of doing tons of trial-and-error with the configuration files:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>check_smtp <span style="color: #660033;">-H</span> 192.168.1.105
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>check_smtp <span style="color: #660033;">-h</span></pre></div></div>

</li>
<li>All lists in Nagios configuration files are <em>comma-separated</em>.
<li>You can set the <code>contact_groups</code> value on any service, host, or hostgroup declaration. Contact groups are defined in <code>/etc/nagios3/conf.d/contacts_nagios2.cfg</code>. Any person in a contact group that has a user account for the web interface (<code>htpasswd.users</code>) can automatically view any hosts and services associated with it.
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="nagios" style="font-family:monospace;">define hostgroup {
        hostgroup_name  mail-servers
                alias           IMAPS/SMTP servers
                members         singularity
                contact_groups  mailadmins
        }</pre></div></div>

</li>
</ul>
<p>Again, the best part about what we&#8217;ve set up now is that you can go right ahead and forget about it. You&#8217;ll receive an e-mail at the contact address specified whenever something is amiss, as well as when it gets better. If I&#8217;m right, though, you&#8217;ll want to tune your configuration a lot further. We&#8217;ve barely touched the surface; Nagios can do much more, and everything is thoroughly documented in the <a href="http://nagios.sourceforge.net/docs/3_0/toc.html" title="Nagios Core 3.0 documentation">official documentation</a>.</p>
<p>Other useful links:</p>
<ul>
<li><a href="http://support.nagios.com/knowledge-base/faq" title="Nagios FAQ">Official Nagios FAQ</a>
<li><a href="http://wiki.nagios.org/" title="Nagios Wiki">Official Nagios Wiki</a></li>
<li><a href="http://www.monitoringexchange.org/" title="MonitoringExchange">MonitoringExchange Nagios Plugins, Guides, Artwork, and more</a></li>
<li><a href="https://www.nagiosforge.org/gf/" title="NagiosForge">NagiosForge</a></li>
<li><a href="http://www.nagioswiki.org/" title="Nagios Wiki">Another Nagios Wiki</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/quick-it-infrastructure-monitoring-with-nagios/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Blind Search Is Cool</title>
		<link>http://patrickmylund.com/blog/blind-search-is-cool/</link>
		<comments>http://patrickmylund.com/blog/blind-search-is-cool/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 02:19:13 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[Blind Search]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1207</guid>
		<description><![CDATA[Blind Search is one of my favorite new toys. It lets you search for something on Google, Bing and Yahoo simultaneously, and lines up the results in three columns. The catch? It doesn&#8217;t tell you which search engine each column of search results comes from &#8212; rather, it asks you which results you think are [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://blindsearch.fejus.com/" title="Blind Search">Blind Search</a> is one of my favorite new toys. It lets you search for something on Google, Bing and Yahoo simultaneously, and lines up the results in three columns. The catch? It doesn&#8217;t tell you which search engine each column of search results comes from &#8212; rather, it asks you which results you think are the best. I&#8217;m pretty sure the results are going to surprise you.</p>

<a href='http://patrickmylund.com/blog/blind-search-is-cool/blindsearch_before/' title='Blind Search before voting'><img width="150" height="150" src="http://static.pmylund.com/blog/content/2009/08/blindsearch_before-150x150.png" class="attachment-thumbnail" alt="Before voting" title="Blind Search before voting" /></a>
<a href='http://patrickmylund.com/blog/blind-search-is-cool/blindsearch_after/' title='Blind Search after voting'><img width="150" height="150" src="http://static.pmylund.com/blog/content/2009/08/blindsearch_after-150x150.png" class="attachment-thumbnail" alt="After -- Oh!" title="Blind Search after voting" /></a>

<p>One thing is for sure; whenever I turn out voting for Bing, they&#8217;ll gain significantly more of my respect than when they tried to turn me over with a <a href="http://patrickmylund.com/blog/the-internet-explorer-8-marketing-campaign-gives-me-pimples/" title="The Internet Explorer 8 Ad Campaign Gives Me Pimples">$1.15 meal and a ten grand hidden treasure</a>, especially since the guy behind Blind Search works for Microsoft. It&#8217;s too bad that the site isn&#8217;t officially endorsed by the company &#8212; what better way to win over users and market your product than to empirically demonstrate its prowess?</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/blind-search-is-cool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux Script: FilesByWeek</title>
		<link>http://patrickmylund.com/blog/new-linux-script-filesbyweek/</link>
		<comments>http://patrickmylund.com/blog/new-linux-script-filesbyweek/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 21:35:13 +0000</pubDate>
		<dc:creator>Patrick Mylund Nielsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[FilesByWeek]]></category>
		<category><![CDATA[find]]></category>

		<guid isPermaLink="false">http://patrickmylund.com/?p=1168</guid>
		<description><![CDATA[FilesByWeek is a small script that counts the number of files in a folder that were created (or last modified) in X week of the year. It&#8217;s designed for use with Linux/Postfix Maildirs (and thus excludes the standard .Sent folder and any Dovecot/Courier IMAP files from the find query), but should work just fine on [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>FilesByWeek is a small script that counts the number of files in a folder that were created (or last modified) in X week of the year. It&#8217;s designed for use with Linux/Postfix Maildirs (and thus excludes the standard .Sent folder and any Dovecot/Courier IMAP files from the <code>find</code> query), but should work just fine on any kind of directory.</p>
<p>Get the latest version <a href="http://patrickmylund.com/projects/filesbyweek/" title="FilesByWeek">here</a>. Or, if you just want to see what the fuzz is about:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">typeset</span> <span style="color: #660033;">-i</span> YEAR WEEK COUNT
&nbsp;
<span style="color: #007800;">WEEK</span>=<span style="color: #007800;">$1</span>
<span style="color: #666666; font-style: italic;"># Comment out the following line if the year starts on a Monday</span>
<span style="color: #007800;">WEEK</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>WEEK-<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;"># Use current system year by default. This can be changed to e.g.: YEAR=2008</span>
<span style="color: #007800;">YEAR</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">TGTDIR</span>=<span style="color: #007800;">$2</span>
<span style="color: #007800;">COUNT</span>=<span style="color: #000000;">0</span>
&nbsp;
\<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #800000;">${TGTDIR}</span> \
<span style="color: #660033;">-type</span> d \<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.sent&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.Sent&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;courierimapkeywords&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;courierimaphieracl&quot;</span> \<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-prune</span> <span style="color: #660033;">-o</span> \
<span style="color: #660033;">-type</span> f \<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;subscriptions&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;courierimapsubscribed&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;dovecot.index.log*&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;dovecot.index&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;maildirfolder&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;dovecot-keywords&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;dovecot.index.cache&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;courierimapacl&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;courierimapuiddb&quot;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;dovecot-uidlist&quot;</span> \<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
<span style="color: #660033;">-print</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> FILENAME; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span>\<span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y-<span style="color: #000000; font-weight: bold;">%</span>W <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${FILENAME}</span>&quot;</span><span style="color: #000000; font-weight: bold;">`</span> == <span style="color: #800000;">${YEAR}</span>-<span style="color: #800000;">${WEEK}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #666666; font-style: italic;"># Uncomment to show the names of matching files</span>
            <span style="color: #666666; font-style: italic;"># echo ${FILENAME}</span>
            <span style="color: #7a0874; font-weight: bold;">let</span> COUNT++
        <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span> Week <span style="color: #007800;">$1</span> <span style="color: #660033;">--</span> <span style="color: #800000;">${TGTDIR}</span>: <span style="color: #800000;">${COUNT}</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://patrickmylund.com/blog/new-linux-script-filesbyweek/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

