<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Stuart&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/" />
<modified>2010-02-16T20:07:58Z</modified>
<tagline></tagline>
<id>tag:blogs.gurulabs.com,2010:/stuart/9</id>
<generator url="http://www.movabletype.org/" version="4.32-en">Movable Type</generator>
<copyright>Copyright (c) 2010, sjansen</copyright>

<entry>
<title>grep --color</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2010/02/grep---color.html" />
<modified>2010-02-16T20:07:58Z</modified>
<issued>2010-02-16T19:54:57Z</issued>
<id>tag:blogs.gurulabs.com,2010:/stuart/9.280</id>
<created>2010-02-16T19:54:57Z</created>
<summary type="text/plain">I use grep a lot. Today I realized that others might not know that GNU grep can highlight matches, or how to combine it with less. So here&apos;s part of my Bash config, and some examples uses: alias grep=&apos;grep --color=auto&apos;...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Tips &amp; Hacks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>I use <tt>grep</tt> <strong>a lot</strong>. Today I realized that others might not know that GNU grep can highlight matches, or how to combine it with less. So here's part of my Bash config, and some examples uses:</p>
<pre><tt>
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'

function legrep {
  egrep --color=yes "$@" | less -R
}
</tt></pre>

<pre><tt>
$ legrep '[Gg]nome' */*.xml
$ legrep -i foo /usr/share/dict/words
$ grep bar | egrep -v 'baz|qux' | legrep bar
</tt></pre>]]>

</content>
</entry>

<entry>
<title>Amazing Lenovo Support Experience</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2009/07/amazing-lenovo.html" />
<modified>2009-07-30T18:38:57Z</modified>
<issued>2009-07-30T17:43:29Z</issued>
<id>tag:blogs.gurulabs.com,2009:/stuart/9.271</id>
<created>2009-07-30T17:43:29Z</created>
<summary type="text/plain">My Lenovo Thinkpad T61p died today, but I&apos;m still in a good mood. I&apos;ve never had such a positive experience calling any company&apos;s support line before. Finding the phone number for Lenovo was a bit of a hassle, but everything...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>My Lenovo Thinkpad T61p died today, but I'm still in a good mood. I've never had such a positive experience calling any company's support line before.</p>

<p>Finding the phone number for Lenovo was a bit of a hassle, but everything else was painless. I spent less than two minutes in the call queue before talking to a human being. Lenovo was careful to mention several times that they were transferring me to their Georgia call center. The cynical might suspect they meant the eastern European nation, but I'm inclined to believe it really was the state. The person I spoke with had an American accent and understood everything I said. He wasn't blindly following a script, but actually listened to what I said and responded appropriately. Within a minute he had decided to replace the entire mainboard. No hassle!</p>

<p>I've recommended Lenovo before because of the quality of the Thinkpad. Now I can add the amazing support. IBM's hand off to Lenovo scared me a little, but they seem to be doing an excellent job. Let's hope it stays that way.</p>]]>

</content>
</entry>

<entry>
<title>Fast Times at Guru Labs</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2009/03/fast-times-at-g.html" />
<modified>2009-03-10T23:36:26Z</modified>
<issued>2009-03-10T23:12:36Z</issued>
<id>tag:blogs.gurulabs.com,2009:/stuart/9.253</id>
<created>2009-03-10T23:12:36Z</created>
<summary type="text/plain">Q: So what did you do today at work? A: Oh, you know, the usual. Threw stuffed penguins at one boss. Put forty pounds of putty on my other boss&apos;s head then watched it slowly melt around him. Buried a...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Laugh, It&apos;s Funny</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>Q: So what did you do today at work?</p>

<p>A: Oh, you know, the usual. Threw stuffed penguins at one boss. Put forty pounds of putty on my other boss's head then watched it slowly melt around him. Buried a co-worker in roughly one thousand <a href="http://blogs.gurulabs.com/cody/photos/#000252">stuffed</a> <a href="http://blogs.gurulabs.com/mike/2009/03/ever-see-a-penguin-fly.html">penguins</a>... And you?</p>

<p>It's going to take some time to process all the photos, but I promise we'll share. Stay tuned.</p>]]>

</content>
</entry>

<entry>
<title>tellme: A Simple Shell Script Helper for XOSD</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2009/02/tellme-a-simple.html" />
<modified>2009-02-24T17:41:45Z</modified>
<issued>2009-02-21T19:39:00Z</issued>
<id>tag:blogs.gurulabs.com,2009:/stuart/9.244</id>
<created>2009-02-21T19:39:00Z</created>
<summary type="text/plain">Derek Carter, a friend and former co-worker, was recently trying to use XOSD to display text on the screen while recording screencasts. As a result, I ended up creating a simple shell function to make osd_cat easier to use. function...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Tips &amp; Hacks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p><a href="http://blog.friocorte.com/">Derek Carter</a>, a friend and former co-worker, was recently trying to use <a href="http://sourceforge.net/projects/libxosd">XOSD</a> to display text on the screen while recording screencasts. As a result, I ended up creating a simple shell function to make <tt>osd_cat</tt> easier to use.</p>

<pre><tt>function tellme() {
  echo "$*" \
    | fmt -20 - \
    | osd_cat -c red -p middle -A center \
              -f "-*-*-bold-i-*-*-128-*-*-*-*-*-*-*"
}</tt></pre>

<p>I've already found this it quite helpful during my daily work flow. For example, I've used it to tell me when a large file is done moving or a compile is completed. The following screenshot shows an example.</p>

<span class="mt-enclosure mt-enclosure-image"><a href="http://blogs.gurulabs.com/stuart/archives/assets_c/2009/02/tellme-19.html"><img src="http://blogs.gurulabs.com/stuart/archives/assets_c/2009/02/tellme-thumb-400x300-19.png" alt="tellme.png" class="mt-image-center" height="300" width="400" /></a></span>
    <div class="post-meta">
</div>]]>

</content>
</entry>

<entry>
<title>Firefox 3: Two Steps Back</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2008/04/ff3-two-steps-back.html" />
<modified>2008-04-26T18:48:01Z</modified>
<issued>2008-04-26T18:27:15Z</issued>
<id>tag:blogs.gurulabs.com,2008:/stuart/9.222</id>
<created>2008-04-26T18:27:15Z</created>
<summary type="text/plain">I upgraded to Ubuntu 8.04 (Hardy) this weekend. So far my first experience with Firefox 3 hasn&apos;t been great. First the minor issue: When I launched FF3, my fonts were messed up. Some pages looked normal, others had ugly huge...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Tips &amp; Hacks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>I upgraded to Ubuntu 8.04 (Hardy) this weekend. So far my first experience with Firefox 3 hasn't been great.</p>

<p>First the minor issue: When I launched FF3, my fonts were messed up. Some pages looked normal, others had ugly huge fonts. Maybe the big fonts are a problem with Ubuntu's Freetype config. Maybe it's a problem with the nVidia drivers. I don't know. Thankfully, I found a workaround. In Firefox about:config set layout.css.dpi to 96. (<a href="http://ubuntuforums.org/showthread.php?t=706788&page=2">http://ubuntuforums.org/showthread.php?t=706788&page=2</a>)</p>

<p>Now my bigger gripe: I don't like the new rich urlbar. Back in FF2, I could open most of my favorite sites in 4 keystrokes or less. By increasing the amount of data the new urlbar searches, the Firefox devs have decreased the unique identifiers for each link. So far, I haven't found a fix. It isn't just the slow loading or the giant waste of space, the most important detail is the sorting algorithm. I know abou the oldbar plugin, unfortunately it's only a cosmetic fix because it doesn't include the old FF2 sorting.</p>

<p>Hopefully I'll find reasons to like FF3, but for now it feels like Firefox has taken two steps back.</p>]]>

</content>
</entry>

<entry>
<title>Pragmatic Version Control Using Git</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2008/04/pragmatic-versi.html" />
<modified>2008-04-17T22:27:23Z</modified>
<issued>2008-04-17T21:55:10Z</issued>
<id>tag:blogs.gurulabs.com,2008:/stuart/9.221</id>
<created>2008-04-17T21:55:10Z</created>
<summary type="text/plain">I&apos;ve used several revision control systems over time: CVS, Subversion, Arch &amp; Bazaar (both baz &amp; bzr). Each was a real improvement over the previous application, at least as far as functionality was concerned. Documentation was the opposite story. As...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>I've used several revision control systems over time: CVS, Subversion, Arch & Bazaar (both baz & bzr). Each was a real improvement over the previous application, at least as far as functionality was concerned. Documentation was the opposite story. As a direct result of their ages, each generation had less documentation.</p>

<p>Git is in a class of its own. Feature-wise, Git is a swiss army knife to everyone else's single blade. (CVS: A butter knife. Subversion: A steak knife. Arch: A switch blade. Bzr: An X-ACTO knife.) Whereas in the past I've had to shape my workflow around the tool, with Git I could decide on the work flow I wanted and pick the Git commands necessary to achieve it. I love that. It's the Unix way.</p>

<p>Unfortunately, Git was also a bear to learn. I've been using it for 5 months now and don't want to give it up, but the first couple weeks were pretty confusing. Which is why I was excited when I <a href="http://www.travisswicegood.com/index.php/2008/03/23/pragmatic-version-control-using-git"> found out</a> that Travis Swicegood is writing a <a href="http://www.travisswicegood.com/index.php/git+book;">git book</a> for <a href="http://www.pragprog.com/">Prag. Prog.</a></p>]]>

</content>
</entry>

<entry>
<title>Fixing Printer Margins in Linux</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2008/02/fixing-printer.html" />
<modified>2008-02-23T19:10:29Z</modified>
<issued>2008-02-23T18:25:57Z</issued>
<id>tag:blogs.gurulabs.com,2008:/stuart/9.220</id>
<created>2008-02-23T18:25:57Z</created>
<summary type="text/plain">I&apos;ve just spent a frustrating hour trying to find the right program and print options to print a PDF without extra margins or scaling. Thankfully, I&apos;ve found the solution: disable the printer&apos;s &quot;scale to fit&quot; option. Perhaps you&apos;ve seen this...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Tips &amp; Hacks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>I've just spent a frustrating hour trying to find the right program and print options to print a PDF without extra margins or scaling. Thankfully, I've found the solution: disable the printer's "scale to fit" option.</p>

<p>Perhaps you've seen this problem yourself. I created a PDF with landscape orientation and carefully measured layout, but when printed it would be scaled smaller with an extra margin (and sometimes even switched to portrait). I tried every print option and program available. I started with <tt>evince</tt>. Then I switched to <tt>acroread</tt> and tried configuring scaling, rotation, Postcript level 2, Postscript level 3, every option I could find. I even tried <tt>lp</tt> and <tt>lpr</tt>. No matter what I tried my margins were incorrect.</p>

<p>Finally I realized that if every program was wrong, it was probably the print driver's fault. Sure enough, CUPS, the most common Linux printing system, was performing the scaling.</p>

<h3>From the command line: <tt>/etc/printers.conf</tt></h3>

<p>One way to eliminate the extra margin is to edit your <tt>/etc/cups/printers.conf</tt> and disable the <a href="http://www.cups.org/documentation.php/options.html#FITPLOT">fitplot</a> option.</p>

<pre style="margin:1em; padding: 0.5em; border: 1px dotted #000">
Option fitplot false</code>
</pre>

<h3>Using a GUI: <tt>system-config-printer</tt></h3>

<p>On Fedora and Ubuntu, <tt>system-config-printer</tt> can be used to configure CUPS. If you're more comfortable using a GUI, I've included a screenshot showing the option I'm referring to.</p>

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://blogs.gurulabs.com/stuart/archives/2008/02/23/scale_to_fit.html" onclick="window.open('http://blogs.gurulabs.com/stuart/archives/2008/02/23/scale_to_fit.html','popup','width=810,height=549,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://blogs.gurulabs.com/stuart/archives/2008/02/23/scale_to_fit-thumb-400x271.png" width="400" height="271" alt="system-config-authentication: scale to fit" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></span>]]>

</content>
</entry>

<entry>
<title>Close Encounters of the Putty Kind</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/09/close-encounter.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-09-24T17:18:39Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.219</id>
<created>2007-09-24T17:18:39Z</created>
<summary type="text/plain">I&apos;m not really sure how to describe Scott Edwards&apos; creation. All memory of the experience has been erased. On an unrelated note, I&apos;ve recently discovered the joys of mashed potato sculpture....</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Putty</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>I'm not really sure how to describe Scott Edwards' creation. All memory of the experience has been erased. On an unrelated note, I've recently discovered the joys of mashed potato sculpture.</p>
<img alt="Photo_092107_001.jpg" src="http://blogs.gurulabs.com/stuart/Photo_092107_001.jpg" width="320" height="240" />]]>

</content>
</entry>

<entry>
<title>Putty Tux</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/09/putty-tux.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-09-20T16:11:19Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.218</id>
<created>2007-09-20T16:11:19Z</created>
<summary type="text/plain">Peter McNabb, brother of former guru Evan McNabb, won a free class during Utah Open Source Conference 2007. He decided to take the GL275 this week. It didn&apos;t take him long to find a good use for our famous Guru...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Putty</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>Peter McNabb, brother of former guru <a href="http://blogs.gurulabs.com/evan/">Evan McNabb</a>, won a free class during <a href="http://utosc.org/">Utah Open Source Conference 2007</a>. He decided to take the <a href="http://www.gurulabs.com/training/GL275-Enterprise_Linux_Network_Services.php">GL275</a> this week. It didn't take him long to find a good use for our famous Guru Putty:</p>
<img alt="putty-tux.jpg" src="http://blogs.gurulabs.com/stuart/putty-tux.jpg" width="240" height="320" />]]>

</content>
</entry>

<entry>
<title>Putty Reproduction</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/08/putty-reproduct.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-08-10T02:19:34Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.217</id>
<created>2007-08-10T02:19:34Z</created>
<summary type="text/plain">Today John Barkhurst contacted me to claim credit for his putty interpretation of The Scream. He&apos;s obviously enjoying his putty because he also included a photographic answer to that age old mystery: &quot;Where does putty come from?&quot;...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Putty</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>Today John Barkhurst contacted me to claim credit for his putty interpretation of <a href="http://blogs.gurulabs.com/stuart/archives/2007/07/putty_scream.html">The Scream</a>. He's obviously enjoying his putty because he also included a photographic answer to that age old mystery: "Where does putty come from?"</p>

<a href="http://blogs.gurulabs.com/stuart/Reproduction.jpg"><img alt="Reproduction.jpg" src="http://blogs.gurulabs.com/stuart/Reproduction-thumb.jpg" width="320" height="210" /></a>
]]>

</content>
</entry>

<entry>
<title>Putty Scream</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/07/putty-scream-1.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-07-04T01:16:09Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.216</id>
<created>2007-07-04T01:16:09Z</created>
<summary type="text/plain">A few weeks ago in Portland, one of my students created a putty version of The Scream. Unfortunately, the lighting and my camera leave a lot to be desired. I&apos;ve forgotten the creator&apos;s name, but it&apos;s still a neat idea....</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Putty</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>A few weeks ago in Portland, one of my students created a putty version of <a href="http://en.wikipedia.org/wiki/The_Scream">The Scream</a>. Unfortunately, the lighting and my camera leave a lot to be desired. I've forgotten the creator's name, but it's still a neat idea.</p>
<p><b>Updated 9 Aug 2007</b>: John Barkhurst wrote today to claim credit for this image and answer an age old question: "<a href="http://blogs.gurulabs.com/stuart/archives/2007/08/putty_reproduct.html">Where does putty come from?</a>"</p>

<img alt="A putty version of The Scream" src="http://blogs.gurulabs.com/stuart/scream.jpg" width="240" height="320" />]]>

</content>
</entry>

<entry>
<title>Stylin&apos; in Boston</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/07/stylin-in-bosto.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-07-03T22:42:06Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.215</id>
<created>2007-07-03T22:42:06Z</created>
<summary type="text/plain">One of the nice things about working for Guru Labs is the variety. I get to see new places, try new foods, and drive a variety of cars. Which brings me to my ride in Boston a couple of weeks...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Travel</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>One of the nice things about working for Guru Labs is the <a href="http://blogs.gurulabs.com/stuart/archives/2006/07/stylin_in_cali.html">variety</a>. I get to see new places, try new foods, and drive a variety of cars. Which brings me to my ride in Boston a couple of weeks ago:</p>
<img alt="mustang.jpg" src="http://blogs.gurulabs.com/stuart/mustang.jpg" width="320" height="240" alt="A red Ford Mustang."/>
<p>Need I say more?</p>]]>

</content>
</entry>

<entry>
<title>URL Monitoring With Bash</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/06/url-monitoring.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-06-24T20:07:00Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.214</id>
<created>2007-06-24T20:07:00Z</created>
<summary type="text/plain">Several years ago, I was a poor college student in need of a car. Everytime I saw an ad for a car in my price range and called about it, I would be told it had already been sold. So...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Tips &amp; Hacks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>Several years ago, I was a poor college student in need of a car. Everytime I saw an ad for a car in my price range and called about it, I would be told it had already been sold. So I hacked together a simple Perl script that scraped local newpaper listings daily and emailed me a list of cars in my price range.</p>

<p>Fast forward a few years and I'm in the market for a new laptop. Lenovo's T61 is almost perfect, but I've gotten used to my current laptop's 1920x1200 screen. I refuse to move backwards. Rumor has it the T61p will be available in 1920x1200, so for the last couple of months I've been eagerly awaiting its announcement, but Lenovo appears to be in no hurry.</p>

<p>I'm tired of manually checking for new announcements. Thankfully, IBM periodically provides a file named tabook.pdf with a list of Thinkpad models. So I wrote the following script to periodically check for new versions and email me the latest as soon as it's detected:</p>

<pre><tt>#!/bin/bash
URL='http://buscaluz.org/robots.txt'
EMAIL="spam.spam.eggs.and.spam@buscaluz.org"

# Detect and send new copies of $URL to $EMAIL.
# $LOG timestamp is used to detect new $FILE.

FILE=$(basename "$URL")
LOG="${FILE}.log"

function log {
  printf "%s: %s\n" $(date +%F) "$@" >> "$LOG"
}

if [ ! -f "$LOG" ]
then
  log "Created log file."
  touch -t 197001010000 "$LOG"
fi

wget -N "$URL"
if [ "$FILE" -nt "$LOG" ]
then
  printf "A new copy of '$FILE' was discovered.\n\nurl: $URL\n" | \
    mutt -s "New $FILE" -a "$FILE" "$EMAIL"
  log "Sent new copy of '$FILE'."
fi</tt></pre>

<p>You'll notice I designed the script to be easily adapted. If you want to use it yourself, you'll probably also want to see the crontab entry that runs it:</p>

<pre><tt>15 0  * * *  cd /home/sjansen/tabook && ./tabook.sh &>/dev/null</tt></pre>]]>

</content>
</entry>

<entry>
<title>Watching Old DNS Entries Expire</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/05/watching-old-dn.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-05-31T01:01:37Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.213</id>
<created>2007-05-31T01:01:37Z</created>
<summary type="text/plain">Slicehost, my current hosting company, is migrating clients to a new IP range. After updating DNS, I was curious to find out how long my old data would be cached. dig +ttlid buscaluz.org @ns8.zoneedit.com Next I wanted to monitor my...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Tips &amp; Hacks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p><a href="http://slicehost.com/">Slicehost</a>, my current hosting company, is <a href="http://blog.slicehost.com/articles/2007/05/22/ip-migrations">migrating</a> clients to a new IP range. After updating DNS, I was curious to find out how long my old data would be cached.</p>
<pre><tt>dig +ttlid buscaluz.org @ns8.zoneedit.com</tt></pre>
<p>Next I wanted to monitor my local DNS server as the old entry expired.</p>
<pre><tt>watch -n 30 'dig +ttlid buscaluz.org | egrep ^b.*IN.*A'</tt></pre>
<p>Man, I love Linux!</p>]]>

</content>
</entry>

<entry>
<title>BIOS Inspection Using dmidecode</title>
<link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/stuart/archives/2007/05/bios-inspection.html" />
<modified>2008-01-28T23:05:47Z</modified>
<issued>2007-05-21T22:39:38Z</issued>
<id>tag:blogs.gurulabs.com,2007:/stuart/9.212</id>
<created>2007-05-21T22:39:38Z</created>
<summary type="text/plain">Until recently, I thought dmidecode was an interesting curiosity but nothing more. That was until I needed to upgrade the BIOS on a classroom full of machines without disturbing the students. Instead of upgrading each system in a careful order,...</summary>
<author>
<name>sjansen</name>
<url>http://blogs.gurulabs.com/stuart</url>
<email>StuartJansen@GuruLabs.com</email>
</author>
<dc:subject>Tips &amp; Hacks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.gurulabs.com/stuart/">
<![CDATA[<p>Until recently, I thought <tt>dmidecode</tt> was an interesting curiosity but nothing more. That was until I needed to upgrade the BIOS on a classroom full of machines without disturbing the students. Instead of upgrading each system in a careful order, I jumped on systems as they became available. Eventually, I thought I was done but couldn't be sure. Then it hit me:</p>
<pre><code>
for I in {1..20}
do
  ssh root@station$I dmidecode | grep -A 3 'BIOS Info' | grep Version
done
</code></pre>
<p>And that is why I love Linux!</p>]]>

</content>
</entry>

</feed>