<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>n8foo's blog</title><link href="http://n8foo.com/blog/" rel="alternate"/><link href="http://n8foo.com/blog/feed.xml" rel="self"/><id>urn:uuid:89d4296c-ccc3-3814-b9ab-06bb79d0ed4d</id><updated>2024-02-16T00:00:00Z</updated><author><name/></author><entry><title>Butter Beans &amp; Kale</title><link href="http://n8foo.com/blog/butter-beans-and-kale/" rel="alternate"/><updated>2024-02-16T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:0f343921-aebe-3f09-b2e4-716d95caa224</id><content type="html">&lt;p&gt;Transcribing a recipe for posterity. I keep telling people this tastes like bacon, and it does!&lt;/p&gt;
&lt;h2&gt;Butter Beans &amp;amp; Kale&lt;/h2&gt;
&lt;h3&gt;Need&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;3 tbsp olive oil&lt;/li&gt;
&lt;li&gt;¼ tsp ccrushed red pepper flakes&lt;/li&gt;
&lt;li&gt;15oz can butter beans, rinsed &amp;amp; drained &amp;amp; patted dry&lt;/li&gt;
&lt;li&gt;2 garlic cloves, roughly chopped&lt;/li&gt;
&lt;li&gt;1 ½ cups kale, tough stems removed, torn into bite sized pieces&lt;/li&gt;
&lt;li&gt;sea salt &amp;amp; ground pepper&lt;/li&gt;
&lt;li&gt;1 tsbp fresh lemon juice&lt;/li&gt;
&lt;li&gt;fresh parm for serving&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Make&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Heat oil in a large saucepan over medium heat.&lt;/li&gt;
&lt;li&gt;Add red pepper and cook for 30 seconds, stirring often. Add beans, cook 4-5 minutes then flip and cook additional 4-5 minutes. &lt;/li&gt;
&lt;li&gt;Stir in garlic, kale, salt &amp;amp; pepper to taste.&lt;/li&gt;
&lt;li&gt;Cook until kale wilts ~2 minutes. &lt;/li&gt;
&lt;li&gt;Mix in lemon juicce, cook 1 minute longer &amp;amp; all is evenly coated.&lt;/li&gt;
&lt;/ol&gt;
</content></entry><entry><title>Setting up the Vortex Race 3 for Mac</title><link href="http://n8foo.com/blog/vortex-race3/" rel="alternate"/><updated>2024-01-08T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:5f6a52ca-a3e5-3111-b080-ec915d875fc3</id><content type="html">&lt;p&gt;&lt;img src="keyboard.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Every year or so, my Vortex Race 3 keyboard seems to reset itsself. Not sure if it's me, or a combo of how my various docks interact w/it, but I find myself stuck on the default layout and having to research how to set it up for a Mac again. For posterity and anyone else having this issue, here's my steps to a Mac user's minimal maintenance setup on the Race 3:&lt;/p&gt;
&lt;p&gt;Keys look like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[ L1 ][ L2 ][ L3 ][ Space ][ R1 ][ R2 ][ R3 ]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;We're going to reset it, swap to a programmable layer, switch to windows mode (it's the least problematic) and then swap the alt and command keys (L2/L3). That's it.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reset everything by pressing &lt;code&gt;L3+R1&lt;/code&gt; for 5 seconds. Left LED will blink white color while you're holding the keys. Release them after it stopeed blinking.&lt;/li&gt;
&lt;li&gt;Get into one of the programmable layers (&lt;code&gt;R2+RShift&lt;/code&gt;) – red is fine.&lt;/li&gt;
&lt;li&gt;Put the keyboard in Windows Mode (&lt;code&gt;R2+W&lt;/code&gt;), it's the least problematic one.&lt;/li&gt;
&lt;li&gt;Go into programming mode: &lt;code&gt;Fn+R3&lt;/code&gt; right LED should light up white.&lt;/li&gt;
&lt;li&gt;Then hit the &lt;code&gt;L2&lt;/code&gt; then &lt;code&gt;L3&lt;/code&gt;, then &lt;code&gt;Pn&lt;/code&gt; (LED shines white) to finish first move. &lt;/li&gt;
&lt;li&gt;Then hit the &lt;code&gt;L3&lt;/code&gt; then &lt;code&gt;L2&lt;/code&gt;, then &lt;code&gt;Pn&lt;/code&gt; (LED shines white) to finish 2nd move. &lt;/li&gt;
&lt;li&gt;&lt;code&gt;R2+R3&lt;/code&gt; to get out of programming mode (LED goes off).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/arogulin/b67899013c546f900df0a2e917dad44f"&gt;arogulin&lt;/a&gt; for the cheatsheet, modified for my use case. &lt;a href="./"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="vortex_race_3.pdf"&gt;Race3 Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="vortex_pok3r.pdf"&gt;POK3R Manual&lt;/a&gt; (for programming)&lt;/li&gt;
&lt;/ul&gt;
</content></entry><entry><title>Date/Time SublimeText Plugin</title><link href="http://n8foo.com/blog/sublime_text_date_time/" rel="alternate"/><updated>2023-12-07T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:c78878e8-4872-389a-8a3a-5a139fa5c1a5</id><content type="html">&lt;p&gt;I keep a daily log in a markdown doc and have been manually typing the day and time in for a few months now. My editor is SublimeText, which supports python plugins so I figured this could be done pretty easily. Here's what I came up with after a few minutes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In Sublime Text, go to "Tools" &amp;gt; "Developer" &amp;gt; "New Plugin...".&lt;/li&gt;
&lt;li&gt;Replace the default code with the following Python script:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sublime&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sublime_plugin&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timezone&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;InsertDateTimeCommand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sublime_plugin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TextCommand&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;date_or_time&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;date_or_time&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;date&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;generate_date_string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;date_or_time&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;time&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;generate_time_string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;

        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_date_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;formatted_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%A %Y-%m-&lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;formatted_date&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;=&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;formatted_date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_time_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;local_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;astimezone&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;utc_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%H:%M:%S UTC&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;local_time_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;local_time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%I:%M:%S %p %Z&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;local_time_str&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; (&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;utc_time&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;)&amp;quot;&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;insert_content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sel&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;region&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Save the file with somethign like &lt;code&gt;insert_date_time.py&lt;/code&gt; in your Sublime Text "Packages" directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, you can create a key binding to trigger this command. Go to "Preferences" &amp;gt; "Key Bindings" and add a binding similar to the following:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;keys&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;ctrl+shift+d&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;command&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;insert_date_time&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;args&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;date_or_time&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;date&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;keys&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;ctrl+shift+t&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;command&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;insert_date_time&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;args&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;date_or_time&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;time&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now, when you press &lt;code&gt;ctrl+shift+d&lt;/code&gt;, it will insert the current date, and pressing &lt;code&gt;ctrl+shift+t&lt;/code&gt; will insert the current time along with UTC time.&lt;/p&gt;
&lt;p&gt;Looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Thursday 2023-12-07
===================
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;12:38:05 PM CST (18:38:05 UTC)
&lt;/code&gt;&lt;/pre&gt;
</content></entry><entry><title>Awk Associative Arrays Rule!</title><link href="http://n8foo.com/blog/awk_associative_arrays/" rel="alternate"/><updated>2021-11-10T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:349377c8-34c7-3044-a8a5-d2a125b1e431</id><content type="html">&lt;p&gt;Awk &lt;a href="https://www.gnu.org/software/gawk/manual/html_node/Array-Intro.html"&gt;associative arrays&lt;/a&gt; rule!&lt;/p&gt;
&lt;p&gt;file.dat:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;foo 234
bar 43
baz 109
bar 823
foo 283
baz 23
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;awk '{a[$1] += $2} END {for (i in a) print i,a[i]}' file.dat&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;baz 132
foo 517
bar 866
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, do this on a file with 100,000 lines.&lt;/p&gt;
</content></entry><entry><title>2019 Total Lunar Eclipse</title><link href="http://n8foo.com/blog/lunar-eclipse/" rel="alternate"/><updated>2019-01-23T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:aaad1fec-c0c2-349e-8d79-c11be4f2c8f8</id><content type="html">&lt;p&gt;The &lt;a href="https://www.timeanddate.com/eclipse/lunar/2019-january-21"&gt;Total Lunar Eclipse&lt;/a&gt; this past weekend was amazing! I had set up some new photography gear to take pictures and was really looking forward to some great shots. I set up my camera gear, which was a Fuji X-T2 mated to an older Canon FD300mmF4L mounted on an &lt;a href="https://amzn.to/2YhD1mf"&gt;Omegon Mini Track LX2&lt;/a&gt;. The Mini Track is a mechanical wind-up motorized equatorial mount for astrophotography.&lt;/p&gt;
&lt;p&gt;&lt;img src="camera_setup.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately, the cloud cover was huge. I got a few early shots just after the partial started and then the clouds took over. It wasn't until 2 hours later I noticed a break in the clouds headed our way.&lt;/p&gt;
&lt;p&gt;&lt;img src="cloud_break.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;YES!&lt;/p&gt;
&lt;p&gt;And there it was! So pretty! Really incredible, and am I seeing purple? Definitely my favorite shot of the 100 or so I took.&lt;/p&gt;
&lt;p&gt;&lt;img src="total_eclipse.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The clouds were clear for a few moments, so I dragged both my sleeping kids out of their warm bed into the 20 degree night to show them the sky. Neither of them cared and only wanted to go back inside. Youth!&lt;/p&gt;
&lt;p&gt;Clouds started to come back in so I got a few wide angle shots to capture the beauty of the night sky during the total.&lt;/p&gt;
&lt;p&gt;&lt;img src="wide_angle.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I also shot some bracketed exposures and spent a few hours aligning and processing to produce this detailed image.&lt;/p&gt;
&lt;p&gt;&lt;img src="hdr_partial.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I took a ton of shots. I think the mini track really helped as I didn't have to worry about lengthy exposure times with the longer lens. And I didn't have to move the camera every couple minutes. It's going to be a great addition to my astrophotography setup.&lt;/p&gt;
&lt;p&gt;&lt;img src="gallery.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;My gallery of shots &lt;a href="http://mybrainhurts.com/pictures/photosets/1167"&gt;here&lt;/a&gt;.&lt;/p&gt;
</content></entry><entry><title>3D Printed Xmas Tree Ornaments...of your house!</title><link href="http://n8foo.com/blog/house-ornaments/" rel="alternate"/><updated>2018-12-23T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:a8686592-092c-31bd-859b-52748eecfad7</id><content type="html">&lt;p&gt;A few weeks ago, I made a model of our house in 3D. We've been discussing a home remodel project and I've been trying to get better at CAD...so it seemed like a useful way to learn a bit more.  I fired up my software of choice (&lt;a href="http://openscad.org"&gt;OpenSCAD&lt;/a&gt;), did a bunch of measuring, and modeled out an accurate scale representation of our humble abode. I made functions for everything: a building with a gable roof, gabled dormers, shed porch, chimney, etc. After I was satisfied with the accuracy, I sat down to show the rendering to my wife so we could discuss the remodel. And, just for fun, I had printed up the result (in PLA at 150 microns). It was 1mm for each foot which made it 304:1 scale.&lt;/p&gt;
&lt;p&gt;&lt;img src="render.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Her first comment:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;"This would be a great Christmas tree ornament! Hey, you should make these for our family this year! Maybe paint them and put snow on the roof too?"&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Now, that's a fantastic idea! Never done anything like this before! That week I picked up some modeling paint, some fake snow for the roof, and some tiny hooks.&lt;/p&gt;
&lt;h4&gt;Modeling&lt;/h4&gt;
&lt;p&gt;At home, I was able to quickly go outside with a measuring tape and get all the dimensions I'd need. But some of my family lives 2000+ miles away, and I didn't want to give it away by asking questions. However, most property tax records are public and many of them include building dimensions. I was able to look up all my relatives but one. Looked like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="joseph_0.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;One of my brothers didn't have a sophisticated county website with dimensions, but I was able to find basic dimensions from his deed and used pictures and views from Google maps to approximate the rest.&lt;/p&gt;
&lt;p&gt;I had to write some more modules for bay windows, decks, porches with decks, porches with columns, etc - and after that was done it only took me about 30-45 min per house to do the modeling. I'd say I spent an hour per night on it, for about a week.&lt;/p&gt;
&lt;p&gt;&lt;img src="render_all.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Once I had the CAD done, I got to printing. Printed in PLA at 150 microns on my &lt;a href="http://prusa3d.com"&gt;Prusa MK2S&lt;/a&gt;. Some of the models needed tweaking, the columns didn't work, or I got updated info on dimensions..."Hey, did your tree touch the ceiling this year? Nice one, Griswold. So....how tall was that?" etc.&lt;/p&gt;
&lt;p&gt;&lt;img src="making_3.jpg" alt=""&gt;&lt;/p&gt;
&lt;h4&gt;Finishing&lt;/h4&gt;
&lt;p&gt;After the models were printed, I sat down one Saturday afternoon, and got to work. The most uncertain part of this project was determining where the center of gravity would be for the hook, so they would hang straight on the tree. Houses are not especially symmetrical, one was even shaped like a U! I used some sharp tools and grabbed the little houses by the edges to get a rough idea and then just kinda winged it. Tested my method out on one of the early non-usable prints I made - drilled a tiny hole with the drill and tested it out - nailed it! I was able to get them all close enough that balance could be adjusted with a little bit of angle on the screw-in hook.&lt;/p&gt;
&lt;p&gt;&lt;img src="making_4.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Painting is't something I'm good at or have done much of, but gotta start somewhere. Unscrewed the hooks and got out the paints. I chose gold, with white accents and a red front door. It seemed Christmas-y to me. 2 coats of paint were needed, the print layers seemed to absorb the paint. It was painstaking work and I felt like I was going to go blind, but they looked pretty great in the end. Painting the red front door was hard and took forever, but worth it! As I finished up, I made a mistake with white paint near a roofline...but realized it looked like an icicle. So, I added little icicles to them all, super cute looking.&lt;/p&gt;
&lt;p&gt;&lt;img src="making_5.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The snow I had ordered was made from crushed glass - and I tested it out on a test house - I coated the roof of the house with glue and poured it on. Wow! It was really beautiful and sparkly...but the bits were too big. Didn't look like snow. So, I just used some white glitter instead and it looked much more realistic.&lt;/p&gt;
&lt;p&gt;&lt;img src="making_11.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Boy they look good! The gold paint is shiny!&lt;/p&gt;
&lt;p&gt;&lt;img src="making_12.jpg" alt=""&gt;&lt;/p&gt;
&lt;h4&gt;Packaging&lt;/h4&gt;
&lt;p&gt;I was struggling to figure out what to put these neat little ornaments in...cardboard boxes were all way too big and weren't nice enough - so at the last minute I decided to design and print a clear box, so they'd have something to store them in each year. And made it oddly shaped while I was at it, because why not!&lt;/p&gt;
&lt;p&gt;&lt;img src="box_0.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I mailed 2 of them off and gave the rest out at family xmas a few days later. They were a hit! Check out the pics of them on the tree!&lt;/p&gt;
&lt;p&gt;&lt;img src="houses_collage.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Merry Christmas!&lt;/p&gt;
</content></entry><entry><title>3D Printing Plumbing Tools</title><link href="http://n8foo.com/blog/3d-printing-plumbing-tools/" rel="alternate"/><updated>2018-02-17T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:f92c7e9d-e73d-3416-9a20-c5aecd0410c3</id><content type="html">&lt;p&gt;This weekend, I was doing a little kitchen faucet replacement and ran into some trouble removing the old Moen hardware. Moen faucets come with this install tool that's similar to a thin-wall deep socket but longer, thinner, and completely hollow. And, &lt;a href="http://www.plumbingzone.com/f7/moen-kitchen-sink-faucets-13399/index3/"&gt;I’ve learned&lt;/a&gt; if you don’t have the tool, it’s neary impossible to remove the faucet without damaging the sink. Especially when it's 20 years old and corroded like the one I'm removing. Earlier this week, I had tried in vain to remove it without the tool...and ended up at Home Depot advicing with the plumbing dude, who sold me a tool that would definitely do the trick. Fast forward to today, I have the sink tore apart, discovered the HD basin wrench is hopeless for the Moen faucet, and realized the only way to remove this thing is to &lt;strong&gt;buy a $17 plastic tool&lt;/strong&gt; from Moen (part # 118305)...that I’ll &lt;em&gt;never&lt;/em&gt; use again. It looks like one of these, my faucet probably came with top right:&lt;/p&gt;
&lt;p&gt;&lt;img src="moen_tools.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;This tool is not available anywhere locally. The fastest I could get it here is next week, which means I have to reassemble everything so the family can use the kitchen in the mean time. I confessed to my wife the situation I'd created, and was considering drastic measures aka. brute force, without the tool (miserable). She asked what the Moen tool looked like - when I told her it was a plastic tool, she said "Plastic? Why don't you just print one?" Damn, I wish I'd thought of that earlier! 😍&lt;/p&gt;
&lt;p&gt;So, set to work immediatly to make my own. I did some measuring &amp;amp; designed one in &lt;a href="http://openscad.org"&gt;OpenSCAD&lt;/a&gt;. Mine has a 1/2 socket in the bottom for a wrench and knobs to turn it by hand. It should slip right over the nut and twist it off...if it's strong enough. Here's what &lt;em&gt;my&lt;/em&gt; Moen tool looks like:&lt;/p&gt;
&lt;p&gt;&lt;img src="cad.png" alt=""&gt; &lt;img src="cad_behind.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Here it is ready for printing:&lt;/p&gt;
&lt;p&gt;&lt;img src="platter.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I printed it in black PLA, at 100% infill with a 0.35mm layer height...it took about an hour and cost me 65 cents in material. &lt;a href="https://youtu.be/lu1pqwVPsss"&gt;Here&lt;/a&gt; is a video of it printing, if you're so inclined. And here it is going to work:&lt;/p&gt;
&lt;p&gt;&lt;img src="on_wrench.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;At this point, I just assumed that the first twist would snap something. But instead...&lt;/p&gt;
&lt;p&gt;&lt;img src="success.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;SUCCESS!&lt;/p&gt;
&lt;p&gt;&lt;img src="on_counter.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="faucet_removed.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I can't believe it worked...I had read about other folks actually breaking the plastic Moen tool so I was skeptical it would hold up to the stress of a corroded &amp;amp; rusted nut. How I was wrong...I squeezed the hell out of it with vice grips and torqued on it hard with a socket wrench. Right out of the gate I turned it the wrong direction a whole turn before I realized it - if it was ever gonna break, it would have broken then. It's got serious battle scars but performed flawlessly!&lt;/p&gt;
&lt;p&gt;&lt;img src="battle_wounds.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;If you find this useful, I've uploaded the files &lt;a href="moen_faucet_wrench.zip"&gt;here&lt;/a&gt; and also to &lt;a href="https://www.thingiverse.com/thing:2797966"&gt;Thingiverse&lt;/a&gt;. If you're searching the web for this exact problem and don't have a 3D printer, let me know and I'll mail you my used 3D-printed tool. It's still good! 😎&lt;/p&gt;
&lt;p&gt;P.S. New Hotness:
&lt;img src="new_hotness.jpg" alt=""&gt;&lt;/p&gt;
</content></entry><entry><title>Automating GMail</title><link href="http://n8foo.com/blog/automating-gmail/" rel="alternate"/><updated>2018-02-11T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:47305385-6eb6-3f92-9173-102527d2fb69</id><content type="html">&lt;p&gt;Automating GMail cleanup tasks turned out to be a great time saver for me. I get a lot of mail from automated processes I need to see, but don't need to keep for long. One example is monitoring alerts, another is admin/root type emails. Yet another is email notifications from services like NextDoor, YouTube, Google Calendar, etc. I get a ton of these and I just don't need to reference them beyond a few days. Part of my weekly (sometimes daily) routine included cleaning these up. At best, a 30 second interruption. At worst, kill my email for half an hour with the dreaded "&lt;a href="https://support.google.com/mail/answer/7036382?hl=en"&gt;Temporary Error&lt;/a&gt;". So, I wrote a little script to do this for me automatically, based on labels. Now I just read &amp;amp; archive them (or whatever) and the script does the rest. No more cleanups and my mailbox is far more tolerable for searching.&lt;/p&gt;
&lt;p&gt;My script is below. Follow the instructions on the GMail page &lt;a href="https://developers.google.com/gmail/api/quickstart/apps-script"&gt;here&lt;/a&gt; and paste the content of my script instead. Name it 'Email Cleanup' or something like that. You'll need to update the labels to match the labels you want to use to clean up.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var days31 = ["label1",
              "label2",
              "label3"];
var days7 =  ["label4",
              "label5",
              "label6",
              "label7"];


function auto_delete_mail(userLabel,days) {
  var label = GmailApp.getUserLabelByName(userLabel);
  if(label == null){
    GmailApp.createLabel(userLabel);
  }
  else{
    var delayDays = days // Enter # of days before messages are moved to trash
    var maxDate = new Date();
    maxDate.setDate(maxDate.getDate()-delayDays);
    var threads = label.getThreads();
    for (var i = 0; i &amp;lt; threads.length; i++) {
      if (threads[i].getLastMessageDate()&amp;lt;maxDate){
        threads[i].moveToTrash();
      }
    }
  }
}

days31.forEach( function(s) {
     auto_delete_mail(s,"31")
} );

days7.forEach( function(s) {
     auto_delete_mail(s,"7")
} );
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I've also &lt;a href="https://gist.github.com/n8foo/9947533ca1084d3c3c216e21c2ef3bdf"&gt;posted it on Github&lt;/a&gt;, if you see changes I should make, send me a pull request!&lt;/p&gt;
</content></entry><entry><title>Set Vim as the default editor</title><link href="http://n8foo.com/blog/vim-default-editor/" rel="alternate"/><updated>2017-01-28T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:2f29d4a1-6891-3f5c-a947-cf866d12ee7d</id><content type="html">&lt;p&gt;It just kills me when I type git commit or some other such command on a newly configured machine and up comes nano or (worse!) pico. And, I so infrequently have to do this that I can never remember it - so, for posterity:&lt;/p&gt;
&lt;p&gt;To set your default editor (to &lt;a href="http://vim.org"&gt;Vim&lt;/a&gt;) on Ubuntu:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;update-alternatives --config editor&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Ex:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
-----------------------------------------------------------
  0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
* 3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    10        manual mode

Press &amp;lt;enter&amp;gt; to keep the current choice[*], or type selection number: 3
&lt;/code&gt;&lt;/pre&gt;
</content></entry><entry><title>Uncomplicated FireWall (UFW) on Ubuntu</title><link href="http://n8foo.com/blog/ufw-ubuntu/" rel="alternate"/><updated>2017-01-16T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:4d38207b-7453-3341-a4b3-b135395bcbde</id><content type="html">&lt;p&gt;&lt;a href="https://help.ubuntu.com/community/UFW"&gt;UFW&lt;/a&gt; is a pretty simple to use firewall wrapper for Ubuntu. Recently, I have been using it to block spammers on a &lt;a href="http://cal.nashvl.org"&gt;little service&lt;/a&gt; I run for the Nashville Tech community. I used to do this with &lt;a href="https://en.wikipedia.org/wiki/Iptables"&gt;iptables&lt;/a&gt; directly, but this is far simpler.&lt;/p&gt;
&lt;p&gt;Here's a quick primer on firing it up and blocking a particular IP address. It's disabled by default so you need to allow your services and then turn it on:&lt;/p&gt;
&lt;pre&gt;
ufw allow ssh/tcp
ufw allow 80/tcp
ufw logging on
ufw enable
ufw status
&lt;/pre&gt;&lt;p&gt;Order matters - once a rule is matched the others will not be evaluated. So, to block that IP, you need to insert it early:&lt;/p&gt;
&lt;pre&gt;
ufw insert 1 deny from 16.16.9.0/24
&lt;/pre&gt;&lt;p&gt;Here's what these rules look like:&lt;/p&gt;
&lt;pre&gt;
# ufw status
Status: active

To                         Action      From
--                         ------      ----
Anywhere                   DENY        16.16.9.0/24             
22/tcp                     ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
22/tcp (v6)                ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6)             
&lt;/pre&gt;&lt;p&gt;And you can number the output to make it easy to clean up or delete your rules:&lt;/p&gt;
&lt;pre&gt;
# ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] Anywhere                   DENY IN     16.16.9.0/24             
[ 2] 22/tcp                     ALLOW IN    Anywhere                  
[ 3] 80/tcp                     ALLOW IN    Anywhere                  
[ 4] 22/tcp (v6)                ALLOW IN    Anywhere (v6)             
[ 5] 80/tcp (v6)                ALLOW IN    Anywhere (v6)             
&lt;/pre&gt;&lt;p&gt;To delete one it'd be ex: &lt;code&gt;ufw delete 1&lt;/code&gt;&lt;/p&gt;
</content></entry><entry><title>2017 Resolutions</title><link href="http://n8foo.com/blog/2017-resolutions/" rel="alternate"/><updated>2017-01-04T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:495210e4-abb4-31a8-a4a9-5dc92b565653</id><content type="html">&lt;p&gt;&lt;img src="a_new_year_a_fresh_clean_start.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I came up with a few new years resolutions. In no particular order:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;write more (this website)&lt;/li&gt;
&lt;li&gt;use a journal&lt;/li&gt;
&lt;li&gt;organize my personal websites and their data. this is tricky, I have a few decades of web cruft.&lt;/li&gt;
&lt;li&gt;organize photos as they are taken&lt;/li&gt;
&lt;li&gt;spend a little time each day organizing my old photos. I also have a few decades of photos to organize.&lt;/li&gt;
&lt;li&gt;find creative ways to spend time with my kids that expand their minds and keep me youthful. &lt;/li&gt;
&lt;li&gt;go to bed earlier ; get up earlier. I'm a natural night-owl so this may be more of a short-lived experiment.&lt;/li&gt;
&lt;/ul&gt;
</content></entry><entry><title>Happy Solstice!</title><link href="http://n8foo.com/blog/solstice-2016/" rel="alternate"/><updated>2016-12-21T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:41b49cb1-3aa7-36e6-9af4-203a1cb33c07</id><content type="html">&lt;p&gt;The image below is an example of solargraphy. A pinhole camera is used to take a picture over 6 months. This photography technique perfectly illustrates the position of the sun between the summer and winter solstice.&lt;/p&gt;
&lt;p&gt;&lt;img src="solargraphy-Ian-Hennes-Medicine-Hat-Alberta-Canada-e1481894244839.jpg" alt=""&gt;&lt;/p&gt;
</content></entry><entry><title>Skylight Simulation</title><link href="http://n8foo.com/blog/skylight-simulation/" rel="alternate"/><updated>2016-05-07T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:6537cd90-8f8b-3278-8ef9-26951f6a7fce</id><content type="html">&lt;p&gt;Trying to decide where to place some skylights in my garage renovation project, I needed to simluate the look. I took pictures of the one installed skylight from the perspective of the camera if it was installed in 2 places, and splicing them into a 'blank' image. Result:&lt;/p&gt;
&lt;p&gt;&lt;img src="simulation1.jpg" alt=""&gt;
and
&lt;img src="simulation2.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I decided to go with #2. Aside from the exposure and the skylight being open, very accurate!&lt;/p&gt;
&lt;p&gt;&lt;img src="reality.jpg" alt=""&gt;&lt;/p&gt;
</content></entry><entry><title>Code &amp; Pinot: UNIX!</title><link href="http://n8foo.com/blog/geek-girls-code-pinot-unix/" rel="alternate"/><updated>2015-04-23T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:7bee14fa-82e8-3bec-899a-6cb6559a32e7</id><content type="html">&lt;p&gt;I gave a presentation tonight at &lt;a href="http://ggdnashville.com/"&gt;Nashville Girl Geek Dinner's&lt;/a&gt; Code &amp;amp; Pinot event. We went over some UNIX history and did a bit of command line intro. Action shot:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/ggdnashville/status/591385694846771201"&gt;&lt;img src="screenshot.jpg" alt="@n8foo teaching us about #Unix at #geekgirldinner #codeandpinot!"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It was a great event! I had a lot of fun teaching something I'm passionate about (while de-rusting a bit on relating the basics!) and had some great conversation afterwards. I've given the history talk a number of times over the years, but the GGD Nashville crew got to experience my first test of this talk with slides! \o/ You can download my history presentation &lt;a href="http://mybrainhurts.s3.amazonaws.com/files/UNIX-GGCodeAndPinot.pdf"&gt;here&lt;/a&gt;.  And &lt;a href="http://mybrainhurts.s3.amazonaws.com/files/UNIX-GGCodeAndPinot_history.txt"&gt;here&lt;/a&gt; is the history of what I typed during the UNIX lesson.&lt;/p&gt;
&lt;p&gt;Side note: We discussed the historically famous "&lt;a href="http://www.uvlist.net/game-164857-Space+Travel"&gt;Space Travel&lt;/a&gt;" game (look it up). But, all I knew was that it was a game...and I'm not a gamer. So, I had to look it up a bit more when I got home. Apparently it let you simulate travel between planets in our solar system and cost about $50-$75 in 1969 money to play a round on the GE 645 running MULTICS!  Which is $320-$482 in 2015 money. No wonder re-writing the whole OS on cheaper hardware was worth it. :-P&lt;/p&gt;
&lt;p&gt;If any of you were there and would like to know more, here are some good links that I used when re-acquainting myself with UNIX's colorful history and some beginner material:&lt;/p&gt;
&lt;p&gt;More History of UNIX 
&lt;a href="http://www.albion.com/security/intro-2.html"&gt;http://www.albion.com/security/intro-2.html&lt;/a&gt; 
&lt;a href="http://web.mit.edu/saltzer/www/multics.html"&gt;http://web.mit.edu/saltzer/www/multics.html&lt;/a&gt; 
&lt;a href="http://en.wikipedia.org/wiki/History_of_Unix"&gt;http://en.wikipedia.org/wiki/History_of_Unix&lt;/a&gt; 
&lt;a href="http://en.wikipedia.org/wiki/Unix"&gt;http://en.wikipedia.org/wiki/Unix&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Other Good Intros 
&lt;a href="http://freeengineer.org/learnUNIXin10minutes.html"&gt;http://freeengineer.org/learnUNIXin10minutes.html&lt;/a&gt; 
&lt;a href="http://cli.learncodethehardway.org/book/"&gt;http://cli.learncodethehardway.org/book/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Don’t have UNIX to play with? Get it in the browser with JS/UIX! 
&lt;a href="http://www.masswerk.at/jsuix/"&gt;http://www.masswerk.at/jsuix/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheat Sheets 
&lt;a href="http://files.fosswire.com/2007/08/fwunixref.pdf"&gt;http://files.fosswire.com/2007/08/fwunixref.pdf&lt;/a&gt; 
&lt;a href="http://sites.tufts.edu/cbi/files/2013/01/linux_cheat_sheet.pdf"&gt;http://sites.tufts.edu/cbi/files/2013/01/linux_cheat_sheet.pdf&lt;/a&gt;&lt;/p&gt;
</content></entry><entry><title>Beers w/Trey</title><link href="http://n8foo.com/blog/beers-wtrey/" rel="alternate"/><updated>2013-05-08T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:5c4ab59f-f292-37ed-892e-0366aeb34fbb</id><content type="html">&lt;iframe src="http://www.youtube.com/embed/7naU-fgNP-U?rel=0" height="315" width="560" allowfullscreen frameborder="0"&gt;&lt;/iframe&gt;&lt;p&gt;Trey came to town. So, we had beer. And I made picturefilms. Used a &lt;a href="http://rcm.amazon.com/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=n8foo-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=as4&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;ref=ss_til&amp;amp;asins=B009TCD8V8"&gt;GoPro&lt;/a&gt; and the &lt;a href="http://radian.alpinelaboratories.com/"&gt;Radian&lt;/a&gt;, which had arrived a few days before. Still not great with it, but the results here were fun. Filmed at both Craft Brewed and M.L. Rose. Approximately 250X normal speed.&lt;/p&gt;
</content></entry><entry><title>Thoughts on "negative-Kelvin"</title><link href="http://n8foo.com/blog/thoughts-on-negative-kelvin/" rel="alternate"/><updated>2013-01-05T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:ef711a92-619e-3482-86a3-329e486cf9cb</id><content type="html">&lt;p&gt;&lt;a href="http://www.nature.com/news/quantum-gas-goes-below-absolute-zero-1.12146"&gt;Nature: Quantum gas goes below absolute
zero&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I thought I had a decent understanding of physics. But after reading
this, someone should revoke my 'amateur scientist' card. This (from
Wikipedia) helped me understand it:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Since we started with over half the atoms in the spin-down state,
initially this drives the system towards a 50/50 mixture, so the
entropy is increasing, corresponding to a positive temperature.
However, at some point more than half of the spins are in the spin-up
position. In this case, adding additional energy reduces the entropy,
since it moves the system further from a 50/50 mixture. This reduction
in entropy with the addition of energy corresponds to a negative
temperature.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is not about the common notions of hot and cold, this is
thermodynamic temperature, which is about entropy and energy. OK, so to
me, this amounts to a neat physics trick. The universe will not collapse
and our understanding of physics hasn't changed. Hopefully, it'll
inspire a few folks (like me) to understand it better. Doing more
reading, it reads like this only works in a 'system' of atoms, not with
a singular atom. If you can't make a single atom colder than 0.0 kelvin,
then the fundamental physics models don't change. Somewhat
frustratingly, I see no mentions of anti-gravity, which was the most
radical thing said on the nature.com article. So, please erase that and
any anti-gravity belt predictions from your memory banks.&lt;/p&gt;
&lt;p&gt;Speaking of theoretical maximums, another fascinating one is the concept
of "&lt;a href="http://en.wikipedia.org/wiki/Absolute_hot"&gt;absolute hot&lt;/a&gt;", which is
currently defined as the &lt;a href="http://en.wikipedia.org/wiki/Planck_temperature" title="Planck temperature"&gt;Planck
temperature&lt;/a&gt;,
(1.416785×10^32^ kelvin). All physics models break down, even things
like gravity. And, theory says that the &lt;strong&gt;entire universe has already
experienced this temperature&lt;/strong&gt;, a fraction of a second after the big
bang. Enjoy that thought.&lt;/p&gt;
&lt;p&gt;Further reading:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://math.ucr.edu/home/baez/physics/ParticleAndNuclear/neg_temperature.html"&gt;http://math.ucr.edu/home/baez/physics/ParticleAndNuclear/neg_temperature.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="%20http:/en.wikipedia.org/wiki/Negative_temperature"&gt;http://en.wikipedia.org/wiki/Negative_temperature&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Thermodynamic_temperature"&gt;http://en.wikipedia.org/wiki/Thermodynamic_temperature&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Absolute_zero"&gt;http://en.wikipedia.org/wiki/Absolute_zero&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Absolute_hot"&gt;http://en.wikipedia.org/wiki/Absolute_hot&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content></entry><entry><title>High-Speed Datacenter Work</title><link href="http://n8foo.com/blog/high-speed-datacenter-work/" rel="alternate"/><updated>2012-11-08T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:b0b85cd1-2e7e-3cb7-a29a-e79e859d59bb</id><content type="html">&lt;p&gt;Went to the datacenter last night to build out a few DB servers with 64GB of RAM. And set up a timelapse to record parts of the work. Marc, Brian and I did 2 servers each. You can see some up-close shots of the Dell R710 hardware, though it's quite blurry. Playback is 74 x normal speed.&lt;/p&gt;
&lt;iframe src="http://www.youtube.com/embed/QgS5H5jcb_8?rel=0" frameborder="0" width="640" height="360"&gt;&lt;/iframe&gt;</content></entry><entry><title>Wasp Nest</title><link href="http://n8foo.com/blog/wasp-nest/" rel="alternate"/><updated>2012-11-01T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:1f0108d5-df46-30f5-9a28-3af484d32059</id><content type="html">&lt;p&gt;Found a paper wasp nest today while we were having work done on the
house. It was cold out and I thought they were dead...when I set it down
in the sun to take a picture, I saw some movement. So, I filmed the
little guy trying to get out. National Geographic here I come.&lt;/p&gt;
&lt;iframe width="640" height="360" src="http://www.youtube.com/embed/eIkDQom0bJc?rel=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;</content></entry><entry><title>Rain Math</title><link href="http://n8foo.com/blog/rain-math/" rel="alternate"/><updated>2012-09-30T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:b796751d-389a-3a22-8202-e88bdc64eceb</id><content type="html">&lt;p&gt;The storm headed our way tonight is predicted to drop 2" of rain over
Nashville. If it covers the entire 527 square miles with that amount (on
average), &lt;strong&gt;that storm would drop 152.8 billion pounds of water&lt;/strong&gt;. Yay
science.&lt;/p&gt;
&lt;p&gt;&lt;img src="Nashville-2-Inches-Looming.png" alt="Nashville-2-Inches-Looming.png"&gt;&lt;/p&gt;
&lt;p&gt;Here's my math:&lt;/p&gt;
&lt;p&gt;1 inch of rain x 1 square mile = 65,785 cubic meters = 17,378,742
gallons&lt;/p&gt;
&lt;p&gt;Nashville is 527 square miles according to
&lt;a href="http://en.wikipedia.org/wiki/Nashville,_Tennessee"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A gallon of water weighs 8.35 lb.&lt;/p&gt;
&lt;p&gt;So, 2 inches of rain over every inch of Nashville is 2 x 527 x
17,378,742 ....&lt;/p&gt;
&lt;p&gt;Which is 18,317,194,068 gallons. Which weighs = 152,948,570,467 lb.&lt;/p&gt;
&lt;p&gt;Yikes. I better go start mowing the yard like right now. I don't want to
get killed when the rain falls on me&lt;/p&gt;
</content></entry><entry><title>git + sudo + local ssh keys</title><link href="http://n8foo.com/blog/git-sudo-local-ssh-keys/" rel="alternate"/><updated>2012-05-08T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:50c1c468-6941-3765-87fe-b6265b7a6214</id><content type="html">&lt;p&gt;Some colleagues and I wanted to be able to check out code onto a remote server using our local &lt;a href="http://github.com"&gt;github&lt;/a&gt; ssh keys. And we should be able to do that as any user we please (for example, the deploy user). After a bit of research, I found that it's possible! In short, you use &lt;a href="http://en.wikipedia.org/wiki/Ssh-agent"&gt;ssh-agent&lt;/a&gt; to pass your key credentials on to the remote server and set up sudo to pass those credentials along thru the environments. Let's do this!&lt;/p&gt;
&lt;p&gt;I'm on a Mac, which has ssh-agent running by default. Yay! But, you still want to verify that your key is added to the agent:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;laptop:~ n8foo$ ssh-add -l
2048 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
/Users/n8foo/.ssh/id_rsa (RSA)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, ssh into your remote server using the -A flag to ssh to pass auth along.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ssh -A remoteuser@remote.server.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Test that ssh's agent auth worked:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[remoteuser@remote ~]$ ssh-add -l
2048 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
/Users/n8foo/.ssh/id_rsa (RSA)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Your keys should show up. Now, confirm that you can access github with your key from that remote server:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[remoteuser@remote ~]$ ssh -T git@github.com

Hi n8foo! You've successfully authenticated, but GitHub does not provide shell access.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;OK, now let's enable this so we can switch users with sudo. Sudo needs to pass the SSH_AUTH_SOCK environment variable on through. To do that, add (or modify) the defaults line in /etc/sudoers to look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Defaults env_keep+=SSH_AUTH_SOCK
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can do this, if you have a default ubuntu sudo config:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# sed -i "s/^Defaults.*/Defaults env_keep+=SSH_AUTH_SOCK/g"
/etc/sudoers
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Everything should be working now. Let's test...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[remoteuser@remote ~]$ sudo su - someotheruser
[someotheruser@remote ~]$ ssh -T git@github.com

Hi n8foo! You've successfully authenticated, but GitHub does not provide shell access.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can now &lt;strong&gt;get your git on&lt;/strong&gt;, directly on your remote machine, as another user. Done!&lt;/p&gt;
</content></entry><entry><title>BCN11 Wrap-Up</title><link href="http://n8foo.com/blog/bcn11-wrap-up/" rel="alternate"/><updated>2011-10-16T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:72cc4137-1076-373d-901e-35b198964706</id><content type="html">&lt;p&gt;&lt;a href="./"&gt;&lt;img src="me_at_bcn.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My &lt;a href="http://n8foo.com/blog/space-balloon-post-launch-wrapup/"&gt;Space Balloon&lt;/a&gt; presentation at &lt;a href="http://barcampnashville.org"&gt;BarCamp Nashville&lt;/a&gt; went well. I normally would 'wing' a BarCamp talk, showing only the pics/video or show-n-tell. But I realized earlier in the week that I had a &lt;strong&gt;lot&lt;/strong&gt; to cover and only 35 minutes to complete it. I figured some organization of my material might be in order. So, those of you that were there got to witness my first ever keynote presentation. Woo hoo!&lt;/p&gt;
&lt;p&gt;I had a number of people tell me that they missed it, due to collision with blocked-off roads from a footrace that morning or the 9AM timeslot. So, here is the presentation in PDF format, with movies removed:  &lt;a href="http://n8foo.s3.amazonaws.com/blog/Space-Balloon-BCN11.pdf"&gt;Space Balloon BCN11 Presentation&lt;/a&gt;. If you want to see the movies, they are linked on my blog &lt;a href="http://n8foo.com/blog/space-balloon-post-launch-wrapup/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="./"&gt;&lt;img src="nick_draws.jpg" alt="IMAG0192"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One other really cool thing that happened yesterday during the talk was &lt;a href="http://twitter.com/nicknavatta"&gt;Nick Navatta&lt;/a&gt; drawing a graphic of the presentation. Seriously cool. He even let me keep the end result, which I shot and put up on flickr.&lt;/p&gt;
&lt;p&gt;Here is the full pic:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/n8foo/6250827405/" title="Space Balloon Presentation Graphic by Nick Navatta by n8foo, on Flickr"&gt;&lt;img src="nick_full.jpg" alt="Space Balloon Presentation Graphic by Nick Navatta"&gt;&lt;/a&gt;&lt;/p&gt;
</content></entry><entry><title>Nashville Amazon Web Services User Group</title><link href="http://n8foo.com/blog/nashville-amazon-web-services-user-group/" rel="alternate"/><updated>2011-09-15T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:4ccd59ac-7267-3ea3-9c57-748386136204</id><content type="html">&lt;p&gt;A few of us are putting together a local &lt;a href="http://aws.amazon.com/usergroups/"&gt;Amazon Web Services User
Group&lt;/a&gt; here in Nashville. The initial
idea is to follow a format similar to &lt;a href="http://pawsug.janrain.com/home/agenda"&gt;Portland's
AWSUG&lt;/a&gt;. Invite local experts,
give talks, get together and share stories, etc. Maybe host a yearly
event in Nashville, not sure. These are all just ideas at the moment.
AWS's most game-changing (and also complex) product is
&lt;a href="http://aws.amazon.com/ec2/"&gt;EC2&lt;/a&gt; and I'm guessing that will garner a
lot of interest. That's also my area of expertise and interest.&lt;/p&gt;
&lt;p&gt;Scheduled for Wednesday, Sept 28th (2 weeks from yesterday), the first
meet up would be an informal get together to come up with a simple
charter, brainstorm on activities, come up with a list of potential
venues and sketch out a general calendar for the next quarter. I figure
this can be accomplished after work, across a table of drinks. Yeah?&lt;/p&gt;
&lt;p&gt;If you'd like to join....we'll be at the &lt;a href="http://corsairtaproom.com/"&gt;Corsair
Taproom&lt;/a&gt; from 6pm till about 8pm.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Nashville Amazon Web Services User Group (NAWSUG)
Initial Planning Meeting - Informal w/beer
Sept 28th 2011, 6pm-8pm at the Corsair Taproom
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Corsair Taproom Location:&lt;/strong&gt;&lt;br&gt;
1200 Clinton Street #110&lt;br&gt;
Nashville, TN 37203&lt;br&gt;
615-321-9109&lt;br&gt;
&lt;a href="http://maps.google.com/maps?q=corsair%20taproom&amp;amp;oe=utf-8&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&amp;amp;um=1&amp;amp;ie=UTF-8&amp;amp;sa=N&amp;amp;hl=en&amp;amp;tab=wl"&gt;Map
Link&lt;/a&gt;&lt;/p&gt;
</content></entry><entry><title>BarCamp 0b10</title><link href="http://n8foo.com/blog/barcamp-0b10/" rel="alternate"/><updated>2011-09-13T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:270eb2d1-c0ff-328f-a356-413c4ac85ad7</id><content type="html">&lt;p&gt;There's been a flurry of activity in Nashville about Bar Camp over the last 48 hours...and 5 years. I won't summarize because it removes the passion. If you care, go read them (referenced at the bottom).&lt;/p&gt;
&lt;p&gt;So what do we (the Nashville community) do about it. Well, &lt;strong&gt;we act&lt;/strong&gt;.  Earlier today &lt;a href="http://twitter.com/timmoses"&gt;Tim Moses&lt;/a&gt; &lt;a href="http://www.nashvillescene.com/pitw/archives/2011/09/13/barcampnashville-descends-into-online-barfightnashville"&gt;posted this&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I think there is room for an alternate BarCamp that answers your
concerns without conflicting with the current BarCamp. BCN may not be
true BarCamp format, but it is successful. It may not be tech-heavy,
but that seems to be improving in large part by the BCN organizers.
Making dramatic changes to BCN would most likely hurt it more than
help.&lt;/p&gt;
&lt;p&gt;The problem isn't with the existence of BCN or how it operates, but
the nonexistence of a tech-focused BarCamp. Many BCN supporters have
repeatedly suggested an alternate, but no one has stepped up to do it.&lt;/p&gt;
&lt;p&gt;On that note, Nathan Hubbard (ex-Telalinker with true BarCamp
experience), and I are organizing BarCamp 0b10, a tech-focused, 2 day,
traditional BarCamp to complement BCN. The current plan is to space it
far enough from BCN (maybe Spring) to not force a choice between the
two. If you like both, go to both, present at both. If not, pick your
BarCamp of choice.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We're shooting for a date sometime this spring and looking to things like &lt;a href="http://barcamp.org/w/page/405173/TheRulesOfBarCamp"&gt;this&lt;/a&gt; and people like &lt;a href="https://twitter.com/#!/viss"&gt;this&lt;/a&gt; for inspiration and guidance. Initial thoughts are: traditional BarCamp, 2 days (camping!), complimentary to BCN, 'tech focused' but not tech only, simpler and less complex, less organized, etc. Tim and I will announce more via this blog and our twitter accounts (&lt;a href="http://twitter.com/timmoses"&gt;@timmoses&lt;/a&gt;, &lt;a href="http://twitter.com/n8foo"&gt;@n8foo&lt;/a&gt;) in the next few months. Keep your eyes peeled. &lt;strong&gt;Update&lt;/strong&gt;: we have a new twitter account: &lt;a href="http://twitter.com/BarCamp0b10"&gt;@BarCamp0b10&lt;/a&gt; and hashtag &lt;a href="http://twitter.com/#!/search/%230b10"&gt;#0b10&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Right now, the Nashville community needs to focus on making &lt;a href="http://www.barcampnashville.org/bcn11/"&gt;BarCamp Nashville 2011&lt;/a&gt; awesome. &lt;a href="http://www.barcampnashville.org/bcn11/user/register"&gt;Go sign up&lt;/a&gt;. Go to &lt;a href="http://www.barcampnashville.org/bcn11/sessions/all"&gt;make a difference&lt;/a&gt;.  Go to &lt;a href="http://www.barcampnashville.org/bcn11/what-barcamp"&gt;see what it's like&lt;/a&gt; if you've never been. Don't wait on our event, &lt;strong&gt;go act&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/n8foo/6144287385/" title="Inspirational Lunch by n8foo, on Flickr"&gt;&lt;img src="inspired.jpg" alt="Inspirational Lunch"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;References:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.nashvillescene.com/pitw/archives/2011/09/13/barcampnashville-descends-into-online-barfightnashville"&gt;Nashville Scene: BarCampNashville Descends Into Online
BarFightNashville&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.centresource.com/2011/09/12/the-not-so-great-barcamp-schism/" title="Permanent Link to The Not-So-Great Barcamp Schism"&gt;Chris Wage: The Not-So-Great Barcamp
Schism&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://itybits.com/blog/2011/09/11/a-failure-to-communicate/"&gt;Matt George: Clarification on BCN
comments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/#!/BCN_Critic"&gt;Twitter: BCN_Critic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Countless &lt;a href="https://twitter.com/#!/search/%23bcn11"&gt;posts on twitter&lt;/a&gt;
by the Nashville BCN crew and other tech heavyweights.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.barcampnashville.org/bcn11/"&gt;Bar Camp Nashville&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://barcamp.org/w/page/405173/TheRulesOfBarCamp"&gt;The Rules of
BarCamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.barcampsd.org/wiki/index.php/Main_Page"&gt;BarCampSD&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</content></entry><entry><title>Space Balloon Post Launch Wrapup</title><link href="http://n8foo.com/blog/space-balloon-post-launch-wrapup/" rel="alternate"/><updated>2011-09-12T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:7bd6984c-f32b-31d8-ab36-9783298a1ab2</id><content type="html">&lt;h1&gt;SPACE&lt;/h1&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/n8foo/5629269423/" title="the blackness of space at 100,000 feet by n8foo, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5228/5629269423_18b375507b_z.jpg" alt="the blackness of space at 100,000
feet"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The image above is a picture taken at 102,000 feet over Nashville back
in April, from our Space Balloon.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Yep, the balloon launch back in April was a success. As was the
presentation that Marc, Jared and I did at
&lt;a href="http://myemma.com" title="Emma Email Inc."&gt;Emma&lt;/a&gt; Talent Night. It was
actually far better than I could have imagined. We kept the whole
project a secret right up until the night of the show. For weeks, people
were watching us tossing parachutes out windows and messing with
flashing lights and cameras. It really built up some great suspense. By
the time the night finally arrived for the big reveal of our 'talent',
the audience was actually chanting "SPACE! SPACE! SPACE! SPACE!". It was
&lt;strong&gt;epic&lt;/strong&gt;, really, for a bunch of nerds to get up and talk about sending
a balloon to space in the middle of 2 dozen other awesome music,
singing, magic and other acts. And get cheered at during the process.
While drinking. Truly one of the most awesome things I've ever done.&lt;/p&gt;
&lt;p&gt;Enough gushing, down to the data.&lt;/p&gt;
&lt;p&gt;This data was recorded by our &lt;a href="http://www.flickr.com/photos/n8foo/5588556419/in/set-72157625894886863"&gt;flight
computer&lt;/a&gt;,
an on board micro Arduino with 2 different sets of 1-Wire temp and
barometric sensors and a 3-way gyro.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Avg ascent rate: 4.89 m/s (10.9 mph)
Avg ascent rate first hour: 2.32 m/s (5.19 mph)
min temperature : -59.116 F
max altitude : 102,496 ft (19.4 mi)
min air pressure : 930pa (0.93% surface)
max descent rate : 245 mph
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-59 F! Wooo wee that's cold! The 245 mph speed was with the chute open! See, the air is so thin up there that even with the chute open it was
screaming towards earth. At more reasonable altitudes, it slowed down to
a more lazy pace of 15 mph. The height we achieved was 102.5K feet.
That's almost 20 miles! One of our other calculations shows 106k feet so
it was in that range somewhere.&lt;/p&gt;
&lt;p&gt;On to the videos and pictures:&lt;/p&gt;
&lt;p&gt;This is what we showed at the talent show after we got up and gave our talk about the balloon, more of a quick documentary of the process. It always makes me laugh watching our first two parachute drop tests. Especially on the second one when &lt;a href="http://girlgonewestblog.com/"&gt;Pamela&lt;/a&gt; laughs at us. Music courtesy of &lt;a href="http://84001.tumblr.com/"&gt;84001&lt;/a&gt; (my co-worker Jimmy's band).&lt;/p&gt;
&lt;iframe width="640" height="390" src="http://www.youtube.com/embed/lU5ir_rF3ic" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;p&gt;This is the music video I put together for
&lt;a href="http://84001.tumblr.com/"&gt;84001&lt;/a&gt;, to be shown while they played live music on stage. It's various trippy time lapse and spacey stuff and about 10 minutes of balloon footage that starts around the 2:20 mark and the burst occurs at around 7:10...the music in this video is basically the same set they played live. The 3 cameras in the balloon filmed a total of 8GB of data across 3.5 hours, of which you are seeing less than 2% here:&lt;/p&gt;
&lt;iframe width="640" height="390" src="http://www.youtube.com/embed/cwti9sIOluE" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;p&gt;More pictures, on Flickr with some video as
well:&lt;a href="http://www.flickr.com/photos/n8foo/sets/72157625894886863/"&gt;http://www.flickr.com/photos/n8foo/sets/72157625894886863/&lt;/a&gt;&lt;br&gt;
The actual slideshow, complete with graphs and stuff, from the
Presenation: &lt;a href="http://www.youtube.com/watch?v=R_aiON0-2J8"&gt;http://www.youtube.com/watch?v=R_aiON0-2J8&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks to Marc and Jared for making this a super kick ass fun science
project. I can't wait for the next one. :-)&lt;/p&gt;
</content></entry><entry><title>tcpdump web traffic</title><link href="http://n8foo.com/blog/tcpdump-web-traffic/" rel="alternate"/><updated>2011-07-12T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:1fa97c8e-1b46-3aa3-a99a-9bd8fe9665eb</id><content type="html">&lt;p&gt;Want to tcpdump your web traffic for debugging? Here's the formula I've
been using lately:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;tcpdump -s 1514 -Ai en0 'tcp port 80 and tcp[((tcp[12:1] &amp;amp; 0xf0) &amp;gt;&amp;gt; 2):4] = 0x47455420'&lt;/code&gt;&lt;/p&gt;
</content></entry><entry><title>Reddit Traffic</title><link href="http://n8foo.com/blog/reddit-traffic/" rel="alternate"/><updated>2011-02-23T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:670e3b8e-09ec-3290-b1b1-5ff965846262</id><content type="html">&lt;p&gt;This is what it looks like when &lt;a href="http://www.reddit.com/r/linux/comments/fqema/encrypted_password_vaults_with_vim_and_openssl/"&gt;someone posts a
link&lt;/a&gt;
to your blog on reddit (linux subreddit). I went from 48 visits the
previous day to 581 visits the day of the reddit post. More than an
order of magnitude more visitors. I don't give a s**t about visitor
count but as a graph and chart nerd, it's neat to see in the google
analytics.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.mybrainhurts.com/blog/wp-content/uploads/2011/02/Screen-shot-2011-02-23-at-12.41.39-PM.png"&gt;&lt;img src="http://www.mybrainhurts.com/blog/wp-content/uploads/2011/02/Screen-shot-2011-02-23-at-12.41.39-PM.png" alt="" title="Google Analytics - Reddit"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Side note: great discussion on reddit. I will be making a followup
article about pgp + vim, since that seems pretty slick. The jury is
still out on which is a better solution for me.&lt;/p&gt;
</content></entry><entry><title>encrypted password vault with Vim + openssl</title><link href="http://n8foo.com/blog/encrypted-password-vault-with-vim-openssl/" rel="alternate"/><updated>2011-02-21T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:72b51b66-f0c2-3fcd-9287-7efb8c4e0ea2</id><content type="html">&lt;p&gt;In a post last year, &lt;a href="http://www.mybrainhurts.com/blog/2009/03/diy-encrypted-password-vault.html"&gt;DIY Encrypted Password Vault&lt;/a&gt;, I showed a simple way to use OpenSSL to create encrypted text files.  Since I'd need to de-crypt those files to edit them (usually with Vim) there would be an unencrypted temp file sitting around while I was editing. And using a filesystem with history meant they were around for a long time. BAD. Surely there is a better way...&lt;/p&gt;
&lt;p&gt;Can we encrypt directly with Vim? Actually, yes...&lt;a href="http://vim.wikia.com/wiki/Encryption"&gt;Vim has encryption built in&lt;/a&gt; (via the -x flag)...it works and it's simple. Problem is that it uses 'crypt', which is &lt;a href="http://axion.physics.ubc.ca/cbw.html"&gt;not terribly hard to break&lt;/a&gt;. Also, it leaves a cleartext .tmp file around while you're editing it. Which means it's worthless to me for a password safe.&lt;/p&gt;
&lt;p&gt;Enter the &lt;a href="http://www.vim.org/scripts/script.php?script_id=2012"&gt;VIM openssl plugin&lt;/a&gt;. This plugin will allow you to write files with particular extensions corresponding to the type of encryption you desire (ex: ..des3 .aes .bf .bfa .idea .cast .rc2 .rc4 .rc5) and it turns off the swap file and .viminfo log, leaving no tmp files around. Excellent!  Here's typical usage:&lt;/p&gt;
&lt;p&gt;Edit a new file with the .bfa extension:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ vi test.bfa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add your secrets and save it out. It will prompt you for a password (twice) to encrypt against.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;blah blah blah : secrets of the world  
~  
~  
~  
~  
:wq  
enter bf-cbc encryption password:  
Verifying - enter bf-cbc encryption password:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can look at the data in the file to see the encrypted content:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ cat test.bfa  
U2FsdGVkX1+TPJBn3hsJ6nzsXzDvTXOxdDk1PkWkTDFG45HIvMnZbBNIrnJubPCY  
EexmfIJpZqo=
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To re-open a previously encrypted file, just open it with vi. The plugin automatically recognizes the extension and prompts for your password:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;"test.bfa" 2L, 78C

enter bf-cbc decryption password:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Pretty slick! You'll need the openssl binary in your path for this to work, which is pretty standard these days. Here is a little script that I run to set this up on my various home directories:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#! /bin/sh

test -d ~/.vim || mkdir ~/.vim/  
test -d ~/.vim/plugin || mkdir ~/.vim/plugin  
curl "http://www.vim.org/scripts/download_script.php?src_id=8564"
&amp;gt; ~/.vim/plugin/openssl.vim
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Edit: 2010+ versions of Vim have blowfish support. Excellent, forward progress! I'm probably not going to upgrade Vim on my Mac and all my servers just for this when a plugin can work. Good to see progress but for now, this makes the most sense for me.&lt;/p&gt;
</content></entry><entry><title>Space Balloon One</title><link href="http://n8foo.com/blog/space-balloon-one/" rel="alternate"/><updated>2011-02-12T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:eac597a6-bf95-3ff7-bab5-22d9f5b28c95</id><content type="html">&lt;p&gt;My friend Marc and I started doing research on what it would take to
send a balloon to 'near space'.  We've been inspired by a few others,
most recently the father-son team from the UK that &lt;a href="http://mashable.com/2010/10/17/iphone-space-launch-video/"&gt;sent an iPhone up to
100,000
feet&lt;/a&gt;. We
think we can build this for under $200, probably less.&lt;/p&gt;
&lt;p&gt;Things we know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;4 lb or larger payload requires FAA approval&lt;/li&gt;
&lt;li&gt;GPS ceiling limit is 11 miles&lt;/li&gt;
&lt;li&gt;Temps are -70F&lt;/li&gt;
&lt;li&gt;Winds are 150MPH&lt;/li&gt;
&lt;li&gt;good chance of a water/wet landing&lt;/li&gt;
&lt;li&gt;single balloon&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first launch will be to test the concepts and recovery mechanism. We
have planned to use the &lt;a href="http://www.instamapper.com/"&gt;instamapper&lt;/a&gt;
service in combination with a t-mobile phone for ground tracking. We
have a camera that would do the trick for the image capturing, using
&lt;a href="http://chdk.wikia.com/wiki/CHDK"&gt;CHDK&lt;/a&gt;. Our friend has donated a
cryogenic styrofoam box that should help with insulation and we can use
hot-packs to keep it warm in there. Need some sort of LED light to help
us in recovery after dusk.&lt;/p&gt;
&lt;p&gt;We're also considering building a small data tracking device, for
recording temperature, light and pressure. Maybe some other
environmentals, not sure. Probably arduino powered, since that seems
pretty easy and cheap.&lt;/p&gt;
&lt;p&gt;Questions we have right now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;how do we track it over 11 miles?&lt;/li&gt;
&lt;li&gt;what kind of balloon do I use?&lt;/li&gt;
&lt;li&gt;how do we deploy the parachute?&lt;/li&gt;
&lt;li&gt;what are we missing?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Would love to see some comments by fellow space nerds.&lt;/p&gt;
</content></entry><entry><title>2010 Camera Advice</title><link href="http://n8foo.com/blog/2010-camera-advice/" rel="alternate"/><updated>2010-12-10T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:3989ebf0-d4bf-3212-9cc9-17ea0e08bb5c</id><content type="html">&lt;p&gt;From some advice for a friend, looking to travel around the world, asking about cameras for travel.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I always say 'you should by a DSLR', as it's a quantum leap in abilities. The huge resulting change in your photos is worth it. Just know you that it's bulk may mean you don't have it out all the time, even unconsciously. Most likely, if you get one now, you'll carry it everywhere for at least some time and the pictures you'll have the rest of your life will be worth it.&lt;/p&gt;
&lt;p&gt;From my own travel experiences: When you're walking around with a big camera and glass around your neck, the weight and size get to be a burden. So does the "I have an expensive camera" factor. I took my DSLR and a powershot with me on my moto trip...ended up using the powershot for 95% of the shots for those reasons. It was a cheaper cam too, so I would take equipment-risky shots...I dropped it a handful of times where my DSLR would have shattered and would hand it to anyone willing to take a shot. (&lt;a href="http://www.flickr.com/photos/n8foo/3597617054/"&gt;http://www.flickr.com/photos/n8foo/3597617054/&lt;/a&gt;) There is also something to be said for having a camera that's easy to 'wear' all day and have ready to fire. With my DSLR setup, I find myself asking 'is this shot worth getting this thing back out?' all the time...and I miss opportunities due to it. Which means, instead of in my sling bag, I carry it around my neck/in my hands constantly, and we're back to the top of this paragraph. I have long considered picking up a G11 (G12 out now w/better low light) as my travel camera for these reasons.&lt;/p&gt;
&lt;p&gt;Back to the DSLR - Assuming Canon 550D, I'd look at 3 lenses. The EF-S 18-200 IS, kick ass walkabout lens, I used it on my 7D when I don't know what kind of photos to expect (travel). 11x equivalent zoom so you can get wide shots and then zoom in on that wildlife off in the distance. The EF-S 17-55 2.8 IS is amazing. Nearly all my best shots have been taken with it. It's got L glass but isn't designated L due to the EF-S lineup. Downside is that it's kinda big. If you want that awesome DOF, pick up a Canon 50mm f/1.8 for $99...it's cheap plastic but will take good low light portraits. I personally opted for the Sigma 30mm 1.4 for my fast prime lens, but it was 4x the price.&lt;/p&gt;
&lt;p&gt;Micro 4/3 has no viewfinder, suck. It's avail as a sep. accessory on most but then you're about as bulky as a DSLR. The E-P2 is the best of the breed of 4/3 so you can't really go wrong if you do go down that road. I'd be jealous of it. :-) I played with a Sony NEX-5 tonight at Target and I hated it's ergos and electronic focus ring. Shots looked pretty tho. If you're looking seriously at the 4/3 stuff, check the Canon G11/G12, those are amazing cams and have good ergos. The f/2.8 is plenty for low light, coupled with the IS and kick butt sensor (12800 ISO!).&lt;/p&gt;
&lt;p&gt;Re: DOF - if you want more DOF, get further away from your subject and use the zoom. It tends to flatten the image but the DOF will be more dramatic than at closer ranges. You probably already know this.&lt;/p&gt;
&lt;p&gt;One last comment: one of the best things you can get to make your photography better is a tripod or even a monopod. It'll make you compose your shots, makes them sharper and lets you leave the shutter open longer then 1/30th.&lt;/p&gt;
&lt;p&gt;No matter what gear you buy, 'getting better at photography' is the right path.&lt;/p&gt;
&lt;/blockquote&gt;
</content></entry><entry><title>network gear config management with tftpd and subversion</title><link href="http://n8foo.com/blog/network-gear-config-management-with/" rel="alternate"/><updated>2010-03-18T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:f00eecc1-d615-38ea-bce6-8d6b798282cb</id><content type="html">&lt;p&gt;Keeping revisions and history on device configs is an essential part of a good change control process. I've found this to be an extremely useful and ass-saving part of system/network administration.&lt;/p&gt;
&lt;p&gt;WARNING: Consider the security ramifications before you start a project like this. Access to network configs saved on a filesystem or code repository can reveal network topology and login information (some network gear passwords are easily decrypted). Be careful how and where you store this data. For my environment, the tftp server and SVN
repository have restricted access to only the systems team.&lt;/p&gt;
&lt;p&gt;Here's how I do it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;tftpd server reachable from switch management network&lt;/li&gt;
&lt;li&gt;subversion repository for switch configs&lt;/li&gt;
&lt;li&gt;manually saving switch configs to the tftpd server&lt;/li&gt;
&lt;li&gt;cron'd script to automatically check in switch configs (if I don't
do it myself)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Setting up TFTPd is pretty easy. On Ubuntu/Debian, it's simple:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;xinetd&lt;span class="w"&gt; &lt;/span&gt;tftpd&lt;span class="w"&gt; &lt;/span&gt;tftp
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Set up something like this in /etc/xinetd.d:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;service&lt;span class="w"&gt; &lt;/span&gt;tftp&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;protocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;udp&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;69&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;socket_type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;dgram&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;wait&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;yes&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;user&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nobody&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/usr/sbin/in.tftpd&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;server_args&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/tftpboot&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;disable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;no&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Set up the various directories and start the daemon. Be sure of your permissions, as your switch configs will be written to these directories.&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;/tftpboot/netconfigs/&lt;span class="w"&gt;  &lt;/span&gt;
chmod&lt;span class="w"&gt; &lt;/span&gt;-R&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;700&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/tftpboot&lt;span class="w"&gt;  &lt;/span&gt;
chown&lt;span class="w"&gt; &lt;/span&gt;-R&lt;span class="w"&gt; &lt;/span&gt;nobody&lt;span class="w"&gt; &lt;/span&gt;/tftpboot&lt;span class="w"&gt;  &lt;/span&gt;
/etc/init.d/xinetd&lt;span class="w"&gt; &lt;/span&gt;start
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Double check that you can write switch configs out using your network gear. This is what it looks like on a Cisco 3560:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;copy&lt;span class="w"&gt; &lt;/span&gt;system:/running-config&lt;span class="w"&gt; &lt;/span&gt;tftp://TFTPHOST:/netconfigs/SWITCH.config
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And on a Cisco PIX firewall:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;wr&lt;span class="w"&gt; &lt;/span&gt;net&lt;span class="w"&gt; &lt;/span&gt;TFTPHOST:netconfigs/SWITCH.config
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you need to automate this. I created a utility user on each switch and a utility user in my subversion repository. This is what my &lt;code&gt;tftp_switch.sh&lt;/code&gt; script looks like for my Cisco 3560's:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="nv"&gt;DATE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="se"&gt;\`&lt;/span&gt;date&lt;span class="w"&gt; &lt;/span&gt;+%F&lt;span class="se"&gt;\`&lt;/span&gt;&lt;span class="nv"&gt;SWITCHES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sw-1 sw-2 sw-3 sw-4 sw-5&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;username&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;PASS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;password&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;TFTPHOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;TFTPHOST&amp;quot;&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SWITCH&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$SWITCHES&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
sleep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PASS&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
sleep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;copy system:/running-config&lt;/span&gt;
&lt;span class="s2"&gt;tftp://&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TFTPHOST&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;://netconfigs/&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;SWITCH&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.config&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
sleep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;15&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;exit&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
sleep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;exit&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;read&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cmd&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$cmd&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;telnet&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$SWITCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;~/cronlogs/&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;SWITCH&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;.&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;DATE&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;.log&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The 'sleep 15' is there in case it takes a moment to write to the tftp server.&lt;/p&gt;
&lt;p&gt;I set up another script that runs the actions above, moves the files into the correct subversion tree, scrubs the files for strings that change too much (like timestamps or what-not) and then checks them into SVN. Here's my example:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#! /bin/sh&lt;/span&gt;

&lt;span class="c1"&gt;# write out network configs to TFTP server  &lt;/span&gt;
/root/bin/tftp_switch.sh&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;/dev/null&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;

&lt;span class="c1"&gt;# copy them into the SVN tree  &lt;/span&gt;
cp&lt;span class="w"&gt; &lt;/span&gt;-fv&lt;span class="w"&gt; &lt;/span&gt;/tftpboot/netconfigs/*.config&lt;span class="w"&gt; &lt;/span&gt;/root/svn/network/

&lt;span class="c1"&gt;# remove things that change all the time  &lt;/span&gt;
sed&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;s/ntp clock-period.*/ntp clock-period/g&amp;quot;&lt;/span&gt;
/root/svn/network/sw-*.config&lt;span class="w"&gt;  &lt;/span&gt;
sed&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;s/Written by.*/Written by/g&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/root/svn/network/sw-*.config

&lt;span class="c1"&gt;# check them in with subversion  &lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/root/svn/network&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
svn&lt;span class="w"&gt; &lt;/span&gt;add&lt;span class="w"&gt; &lt;/span&gt;-q&lt;span class="w"&gt; &lt;/span&gt;*.config&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
svn&lt;span class="w"&gt; &lt;/span&gt;commit&lt;span class="w"&gt; &lt;/span&gt;-q&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;automatic checkin&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I set these files owned by root, mode 500 and set it to run nightly in
cron.&lt;/p&gt;
&lt;p&gt;Since everything is now stored within SVN, I can checkout and in configs, see who and when they were saved (depending on if your gear writes that in the output) and compare to previous versions. I run &lt;a href="http://websvn.tigris.org/"&gt;WebSVN&lt;/a&gt; on my repo so it's very easy to see what has changed. Super useful.&lt;/p&gt;
&lt;p&gt;If anyone implements this and has suggestions for change, please let me
know!&lt;/p&gt;
</content></entry><entry><title>Ruby on Rails dev environment on a remote server</title><link href="http://n8foo.com/blog/ruby-on-rails-dev-environment-on-remote/" rel="alternate"/><updated>2009-12-25T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:32eb7ac4-0031-3b0f-b3e4-ea5f1bcd3a5f</id><content type="html">&lt;p&gt;A friend asks:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-style: italic;"&gt;...so I'm trying to install RoR on a
remote server of mine, but it seems that RoR development methodology
wants you to test your webpages on localhost:3000. But, obviously,
since the computer is in the cloud, I can't just well pull up a
webpage on the console. Is there an easy way to get development pages
to show up on a web browser that's not local?&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So there are a couple of options.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;use mod_passenger w/Apache for all your environments. This requires
quite a bit more work but it's the way you'd want to do it for any
larger environment. Google will teach you all you want about this, but I
recommend it only when your environments are mature and you are needing
to scale out production.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tell Apache to pass &lt;a href="http://dev.yourdomain.com/"&gt;http://dev.yourdomain.com/&lt;/a&gt;
to localhost port 3000. You'd need to set up a dev hostname in DNS and
point it at the server as well. It would look like this in the apache
config:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;  
ServerAdmin webmaster@domain.com  
ServerName dev.domain.com  
ProxyPreserveHost On  
ProxyPass / http://127.0.0.1:3000/  
ProxyPassReverse / http://127.0.0.1:3000/  
&amp;lt;/VirtualHost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Similar as above, but if you don't want to mess with DNS, you can&lt;br&gt;
proxy based on the URL:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;ProxyPass /foo http://127.0.0.1:3000  
ProxyPassReverse /foo http://127.0.0.1:3000
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;more on mod_proxy here: &lt;a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html"&gt;http://httpd.apache.org/docs/2.0/mod/mod_proxy.html&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use ssh to tunnel requests from your local machine out to the server
(ssh tunnel). ssh will forward the tcp packets across the pipe towards a
host you specify on the other end. In this case, you'd tell it to send
localhost port 3000 (on your laptop) across the pipe and out to
localhost port 3000 on the server. This will only provide access for you
(since it's a private tunnel).&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;-L&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;3000&lt;/span&gt;:127.0.0.1:3000&lt;span class="w"&gt; &lt;/span&gt;host.server.com
&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then in your browser surf to &lt;a href="http://127.0.0.1:3000"&gt;http://127.0.0.1:3000&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For speed, I'd probably do the last option to test that things are working and go up
towards #1 as you get your environment more set up. #1 is the most
amount of work (mod_passenger can be a PITA).&lt;/p&gt;
</content></entry><entry><title>wildcard subdomain SSL certs</title><link href="http://n8foo.com/blog/wildcard-subdomain-ssl-certs/" rel="alternate"/><updated>2009-12-22T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:4eec96c3-0106-39f2-8fec-c0bb9490e39e</id><content type="html">&lt;p&gt;A friend asked:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;If I bought a wildcard certificate for &lt;em&gt;.domain.com, wouldn't that cover &lt;/em&gt;.sub.domain.com?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hrm...I had to look that one up. The answer is: no, not accorindg to the
RFC. RFC 2818 states:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Matching is performed using the matching rules specified by [RFC2459]. If more than one identity of a given type is present in the certificate (e.g., more than one dNSName name, a match in any one of the set is considered acceptable.) Names may contain the wildcard character &lt;em&gt; which is considered to match any single domain name component or component fragment. E.g., \&lt;/em&gt;.a.com matches foo.a.com but not bar.foo.a.com. f*.com matches foo.com but not bar.com.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;more here: &lt;a href="http://www.ietf.org/rfc/rfc2818.txt"&gt;http://www.ietf.org/rfc/rfc2818.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There are
&lt;a href="http://www.hanselman.com/blog/SomeTroubleWithWildcardSSLCertificatesFireFoxAndRFC2818.aspx"&gt;reports&lt;/a&gt;
that older versions of Firefox don't complain when encountering an out
of spec sub-domain SSL wild-card but IE would. I would recommending
sticking with the RFC spec.&lt;/p&gt;
</content></entry><entry><title>System Administration with Capistrano</title><link href="http://n8foo.com/blog/system-administration-with-capistrano/" rel="alternate"/><updated>2009-11-25T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:d8edb863-31ca-3be8-b1fb-e3ba1d7bc76c</id><content type="html">&lt;p&gt;In previous years, when I had to run commands on hundreds or thousands
of servers, I'd hack together a combo of
&lt;a href="http://expect.nist.gov/"&gt;expect&lt;/a&gt; and perl. It would almost always
evolve into a system of complicated config and command files that was
rickety and didn't handle errors well. I didn't dare mess with
multi-threaded perl, which meant it was serial execution and slow for
large clusters. It got the job done but left me wishing for a better
system. I have always had &lt;a href="http://www.cfengine.org/"&gt;cfengine&lt;/a&gt; in my
sysadmin toolbox, but it's more about entropy reduction and not set up
for one-off or occasional situations. I tried a few parallel shell
implementations (such as dsh, pdsh) and found them all &lt;strong&gt;lacking&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Enter &lt;a href="http://www.capify.org/"&gt;Capistrano&lt;/a&gt;. It bills its self as an
'easy deployment' system, with Ruby on Rails application deployment as
the main use case. And since I'd never worked in a RoR environment
before, I had no real reason to look into it much. But in the last 3
months, I have worked at 2 different companies that use RoR + Capistrano
for deployment and have learned enough to see it's true power. How I'd
describe it to a fellow sysadmin is: "&lt;strong&gt;parallel execution of scripts and commands on
multiple hosts...easily&lt;/strong&gt;". Want to quickly execute a command on
every host in your cluster? This is the way to do it.&lt;/p&gt;
&lt;p&gt;Installing it is pretty easy...you need a modern version of Ruby, a
modern version of RubyGems and then a &lt;code&gt;gem install capistrano&lt;/code&gt; later,
and you're good to go. You only need to install all of this on the
controlling/deployment server....not on all your clusters/nodes. If you
get errors with the version of ruby/gems that comes with your distro,
install from source (recommended). I followed &lt;a href="http://www.capify.org/index.php/Getting_Started"&gt;this
tutorial&lt;/a&gt; to get it set
up, and to get the basics. You sould read it as well. They skip a few
necessary things (such as sudo and useful ENV variables) which I have
below.&lt;/p&gt;
&lt;p&gt;An example Capfile of how to restart apache on a whole cluster:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;:apache_cluster&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;www1&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;www2&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;www3&amp;quot;&lt;/span&gt;
&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;restart apache on www hosts&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;restart_apache_www&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;:roles&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;:apache_cluster&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/etc/init.d/apache2 restart&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; is a built in method of modern versions of Capistrano. Instead
of the 'run' method, you use 'sudo' and it understand and responds to
the prompt (if prompted). Very slick. One thing to keep in mind is that
is is running everything as YOU, unless otherwise specified. It will
look like you logged into 50 servers all at once and ran sudo commands
all at once. I bet that'd look cool on a
&lt;a href="http://www.splunk.com/"&gt;Splunk&lt;/a&gt; log graph.&lt;/p&gt;
&lt;p&gt;Now, from the command line, type '&lt;span
style="font-family: courier new;"&gt;cap -T'&lt;/span&gt; to get a list of your
documented commands. As long as you describe your commands, you will
always get a list of what you can run. '&lt;span
style="font-family: courier new;"&gt;cap -e command&lt;/span&gt;' will explain
commands.&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;invoke&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# Invoke a single command on the remote servers.  &lt;/span&gt;
&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;restart_apache_www&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# restart apache on www hosts  &lt;/span&gt;
&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# Begin an interactive Capistrano session.&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Run the command we set up: '&lt;span style="font-family: courier new;"&gt;cap
restart_apache_www&lt;/span&gt;'. It will prompt for your password.&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;restart_apache_util&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;executing&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="sb"&gt;`restart_apache_www&amp;#39;  &lt;/span&gt;
&lt;span class="sb"&gt;* executing &amp;quot;sudo -p &amp;#39;sudo password: &amp;#39; /etc/init.d/apache2 restart&amp;quot;  &lt;/span&gt;
&lt;span class="sb"&gt;servers: [&amp;quot;www01.domain.com&amp;quot;, &amp;quot;www02.domain.com&amp;quot;,&lt;/span&gt;
&lt;span class="sb"&gt;&amp;quot;www03.domain.com&amp;quot;]  &lt;/span&gt;
&lt;span class="sb"&gt;Password:  &lt;/span&gt;
&lt;span class="sb"&gt;[www01.domain.com] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;[www03.domain.com] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;[www02.domain.com] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www01.domain.com] * Restarting web server apache2  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www01.domain.com] ...done.  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www03.domain.com] * Restarting web server apache2  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www03.domain.com] ...done.  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www02.domain.com] * Restarting web server apache2  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www02.domain.com] ...done.command finished&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And that was completed in parallel, in about 1 second. What if you have
a one-off thing you want to run on all hosts? Try &lt;code&gt;cap invoke&lt;/code&gt;, &lt;strong&gt;no Capfile required&lt;/strong&gt;. If you have a
Capfile with hosts defined, it will run against all of them by default,
or it can take a role by passing ROLE as an env variable.&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;COMMAND&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;uptime&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;www1,www2&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;invoke&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;executing&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="sb"&gt;`invoke&amp;#39;  &lt;/span&gt;
&lt;span class="sb"&gt;* executing &amp;quot;uptime&amp;quot; servers: [&amp;quot;www1&amp;quot;, &amp;quot;www2&amp;quot;]  &lt;/span&gt;
&lt;span class="sb"&gt;Password:  &lt;/span&gt;
&lt;span class="sb"&gt;[www1.prod] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;[www2.prod] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www1] 16:57:04 up 190 days, 4:30, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.30, 0.33, 0.33  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www2] 16:57:04 up 190 days, 4:42, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.42, 0.32, 0.32  &lt;/span&gt;
&lt;span class="sb"&gt;command finished&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;ROLES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;COMMAND&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;uptime&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;invoke&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;executing&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="sb"&gt;`invoke&amp;#39;  &lt;/span&gt;
&lt;span class="sb"&gt;* executing &amp;quot;uptime&amp;quot; servers: [&amp;quot;www1&amp;quot;, &amp;quot;www2&amp;quot;, &amp;quot;www3&amp;quot;]  &lt;/span&gt;
&lt;span class="sb"&gt;Password:  &lt;/span&gt;
&lt;span class="sb"&gt;[www1] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;[www2] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;[www3] executing command  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www1] 17:00:17 up 190 days, 4:33, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.54, 0.37, 0.34  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www2] 17:00:17 up 190 days, 4:46, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.18, 0.27, 0.29  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www3] 17:00:17 up 190 days, 5:02, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.17, 0.22, 0.25  &lt;/span&gt;
&lt;span class="sb"&gt;command finished&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But every time you 'invoke', you must re-type your password. Want to
stay connected? Try the shell:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;www1,www2&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;executing&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="sb"&gt;`shell&amp;#39;  &lt;/span&gt;
&lt;span class="sb"&gt;====================================================================  &lt;/span&gt;
&lt;span class="sb"&gt;Welcome to the interactive Capistrano shell! This is an experimental  &lt;/span&gt;
&lt;span class="sb"&gt;feature, and is liable to change in future releases. Type &amp;#39;help&amp;#39; for  &lt;/span&gt;
&lt;span class="sb"&gt;a summary of how to use the shell.  &lt;/span&gt;
&lt;span class="sb"&gt;-------------------------------------------------------------------  &lt;/span&gt;
&lt;span class="sb"&gt;cap&amp;gt; uptime  &lt;/span&gt;
&lt;span class="sb"&gt;[establishing connection(s) to www1, www2]  &lt;/span&gt;
&lt;span class="sb"&gt;Password:  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www1] 17:03:24 up 190 days, 4:36, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.29, 0.32, 0.32  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www2] 17:03:24 up 190 days, 4:49, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.35, 0.30, 0.29  &lt;/span&gt;
&lt;span class="sb"&gt;cap&amp;gt; w  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www1] 17:03:37 up 190 days, 4:36, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.24, 0.31, 0.31  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www1] USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www2] 17:03:37 up 190 days, 4:49, 0 users, load average:&lt;/span&gt;
&lt;span class="sb"&gt;0.30, 0.29, 0.28  &lt;/span&gt;
&lt;span class="sb"&gt;** [out :: www2] USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT  &lt;/span&gt;
&lt;span class="sb"&gt;cap&amp;gt; ls /tmp/blah  &lt;/span&gt;
&lt;span class="sb"&gt;*** [err :: www1] ls: cannot access /tmp/blah  &lt;/span&gt;
&lt;span class="sb"&gt;*** [err :: www2] ls: cannot access /tmp/blah  &lt;/span&gt;
&lt;span class="sb"&gt;*** [err :: www1] : No such file or directory  &lt;/span&gt;
&lt;span class="sb"&gt;*** [err :: www2] : No such file or directory  &lt;/span&gt;
&lt;span class="sb"&gt;error: failed: &amp;quot;sh -c &amp;#39;ls /tmp/blah&amp;#39;&amp;quot; on www1,www2&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Notice that errors show up with a 'err' line.&lt;/p&gt;
&lt;p&gt;While useful and timesaving, this barely scratches the surface of the
power of Capistrano. I suggest you read the "&lt;a href="http://www.capify.org/index.php/From_The_Beginning"&gt;From the
Beginning&lt;/a&gt;" doc on
the Capistrano site. If you discover any cool recipes, share them in the
comments on this blog and I'll publish them as a followup later (as I
learn more recipes myself).&lt;/p&gt;
&lt;p&gt;P.S. I think I'm going to add a feature to
&lt;a href="http://www.machdb.org/"&gt;MachDB&lt;/a&gt; to export host lists in a format
compatible with the Capfiles.&lt;/p&gt;
</content></entry><entry><title>DIY Encrypted Password Vault</title><link href="http://n8foo.com/blog/diy-encrypted-password-vault/" rel="alternate"/><updated>2009-03-30T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:a52908ba-b1d8-3bb1-9637-b073a659b581</id><content type="html">&lt;p&gt;This is something I've needed at various jobs/situations for years...a place to store the root/router/database/web passwords that only I can see. There are a lot of desktop/handheld apps for this but I always feel like I could lose the computer/handheld that it's on and I'd be boned.  I'd rather have something I can stick on a server somewhere and access via a remote shell....or carry it around on a thumb drive. Here are the scripts:&lt;/p&gt;
&lt;p&gt;encrypt.sh&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#! /bin/sh &lt;/span&gt;

openssl&lt;span class="w"&gt; &lt;/span&gt;bf&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt; &lt;/span&gt;-salt&lt;span class="w"&gt; &lt;/span&gt;-in&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;.txt&lt;span class="w"&gt; &lt;/span&gt;-out&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;.bf&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rm&lt;span class="w"&gt; &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;.txt
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;decrypt.sh&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#! /bin/sh &lt;/span&gt;

openssl&lt;span class="w"&gt; &lt;/span&gt;bf&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;-salt&lt;span class="w"&gt; &lt;/span&gt;-in&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;.bf
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To use it, create a file named blah.txt that has your secret info in it.  Run the encrypt script first:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$&lt;span class="w"&gt; &lt;/span&gt;./encrypt.sh&lt;span class="w"&gt; &lt;/span&gt;blah
enter&lt;span class="w"&gt; &lt;/span&gt;bf-cbc&lt;span class="w"&gt; &lt;/span&gt;encryption&lt;span class="w"&gt; &lt;/span&gt;password:
Verifying&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;enter&lt;span class="w"&gt; &lt;/span&gt;bf-cbc&lt;span class="w"&gt; &lt;/span&gt;encryption&lt;span class="w"&gt; &lt;/span&gt;password:
removed&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;blah.txt&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will encrypt the file and remove it. Check the contents of the file:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$&lt;span class="w"&gt; &lt;/span&gt;cat&lt;span class="w"&gt; &lt;/span&gt;blah.bf
U2FsdGVkX1/+ZGiXPSZX8MED9aXrm1NfIEjpv5vvFKo&lt;span class="o"&gt;=&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It's actually base 64 encoded so you can email it to yourself for safe keeping if you so choose.&lt;/p&gt;
&lt;p&gt;To decrypt for reading:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$&lt;span class="w"&gt; &lt;/span&gt;./decrypt.sh&lt;span class="w"&gt; &lt;/span&gt;blah
enter&lt;span class="w"&gt; &lt;/span&gt;bf-cbc&lt;span class="w"&gt; &lt;/span&gt;decryption&lt;span class="w"&gt; &lt;/span&gt;password:
secret&lt;span class="w"&gt; &lt;/span&gt;host:&lt;span class="w"&gt; &lt;/span&gt;secret&lt;span class="w"&gt; &lt;/span&gt;password
secret&lt;span class="w"&gt; &lt;/span&gt;host2:&lt;span class="w"&gt; &lt;/span&gt;secret&lt;span class="w"&gt; &lt;/span&gt;password2
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now take the encrypted output file and the 2 scripts, email it to yourself and store a copy on a thumb drive. :)&lt;/p&gt;
</content></entry><entry><title>Why all phones need a silent ring</title><link href="http://n8foo.com/blog/or-why-all-phones-need-silent-ring/" rel="alternate"/><updated>2009-03-23T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:93cbc64d-30d7-397a-acdb-afba5ddbe36e</id><content type="html">&lt;p&gt;Telemarketers, vendors and people I'd rather not communicate with
frequently intrude on my early morning slumber (esp East Coast vendors),
meetings, lunches, free time and life in general. And since they usually
call from unrecognized numbers, I feel compelled to answer (could be
something important, right?) A co-worker and I have been using a neat
technique to remove these individuals ability to communicate with
us...create a new contact called "Do Not Answer" with a custom silent
ring tone. Each time they call from a new number, add them as an
additional number to that contact. And with that silent ring, now they
can't interrupt you in meetings, at home, early in the morning, etc.&lt;/p&gt;
&lt;p&gt;I used iTunes to make a silent ringtone...you can download it here:
&lt;a href="http://www.mybrainhurts.com/blog/images/2009/3/silent_ring.m4r"&gt;iPhone Silent
Ringone&lt;/a&gt;&lt;/p&gt;
</content></entry><entry><title>automated nmap scans</title><link href="http://n8foo.com/blog/automated-nmap-scans/" rel="alternate"/><updated>2009-03-13T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:530054ae-935f-355f-bedd-b5b94b605099</id><content type="html">&lt;p&gt;Whipped this up for work, figured I'd share with the world, since it's decently useful. Stick it in cron nightly, needs to run as root. It will run a diff on what it sees and email you if there are new ports/hosts that pop up on your networks. If you find errors or mods, use this: &lt;a href="http://pastebin.com/f635a7517"&gt;http://pastebin.com/f635a7517&lt;/a&gt; to modify it and post in the comments.&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#! /bin/sh&lt;/span&gt;

&lt;span class="nv"&gt;DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/opt/nmap/scans&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;NETWORKS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;192.168.1.0-255&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;TODAY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;date&lt;span class="w"&gt; &lt;/span&gt;+%Y%m%d&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;YESTERDAY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;date&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;yesterday&lt;span class="w"&gt; &lt;/span&gt;+%Y%m%d&lt;span class="sb"&gt;`&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;network&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$NETWORKS&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;-n&lt;span class="w"&gt; &lt;/span&gt;-sS&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$network&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-oG&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$DIR&lt;/span&gt;/&lt;span class="nv"&gt;$network&lt;/span&gt;.&lt;span class="nv"&gt;$TODAY&lt;/span&gt;.nmap&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;network&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$NETWORKS&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
diff&lt;span class="w"&gt; &lt;/span&gt;-I&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;^#&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$DIR&lt;/span&gt;/&lt;span class="nv"&gt;$network&lt;/span&gt;.&lt;span class="nv"&gt;$TODAY&lt;/span&gt;.nmap
&lt;span class="nv"&gt;$DIR&lt;/span&gt;/&lt;span class="nv"&gt;$network&lt;/span&gt;.&lt;span class="nv"&gt;$YESTERDAY&lt;/span&gt;.nmap&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$DIR&lt;/span&gt;/&lt;span class="nv"&gt;$network&lt;/span&gt;.&lt;span class="nv"&gt;$TODAY&lt;/span&gt;.diff&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;network&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$NETWORKS&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;SIZE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;find&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$DIR&lt;/span&gt;/&lt;span class="nv"&gt;$network&lt;/span&gt;.&lt;span class="nv"&gt;$TODAY&lt;/span&gt;.diff&lt;span class="w"&gt; &lt;/span&gt;-size&lt;span class="w"&gt; &lt;/span&gt;+0b&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$SIZE&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$DIR&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;$network&lt;/span&gt;&lt;span class="s2"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;$TODAY&lt;/span&gt;&lt;span class="s2"&gt;.diff&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;then&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$DIR&lt;/span&gt;/&lt;span class="nv"&gt;$network&lt;/span&gt;.&lt;span class="nv"&gt;$TODAY&lt;/span&gt;.diff&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;mail&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Change Detected for&lt;/span&gt;
&lt;span class="nv"&gt;$network&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;user@host.com&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
</content></entry><entry><title>automated disk partitioning with sfdisk</title><link href="http://n8foo.com/blog/sfdisk-is-bomb/" rel="alternate"/><updated>2009-01-04T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:6de4471d-1b3f-39bb-8a08-231b881c61f1</id><content type="html">&lt;p&gt;I discovered sfdisk a few years ago (part of
&lt;a href="http://freshmeat.net/projects/util-linux/"&gt;util-linux&lt;/a&gt;) and have been
using it in automation scripts ever since.  sfdisk is like fdisk, but is
scriptable.  So for example, to list the partitions on a disk:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;root@host&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# sfdisk -l /dev/sdc&lt;/span&gt;

Disk&lt;span class="w"&gt; &lt;/span&gt;/dev/sdc:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;121601&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cylinders,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;255&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;heads,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;63&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sectors/track&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;Units&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cylinders&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;8225280&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;bytes,&lt;span class="w"&gt; &lt;/span&gt;blocks&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1024&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;bytes,&lt;span class="w"&gt; &lt;/span&gt;counting&lt;span class="w"&gt; &lt;/span&gt;from
&lt;span class="m"&gt;0&lt;/span&gt;

Device&lt;span class="w"&gt; &lt;/span&gt;Boot&lt;span class="w"&gt; &lt;/span&gt;Start&lt;span class="w"&gt; &lt;/span&gt;End&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#cyls #blocks Id System  &lt;/span&gt;
/dev/sdc1&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;+&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;121600&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;121601&lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;976760001&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;83&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Linux&lt;span class="w"&gt;  &lt;/span&gt;
/dev/sdc2&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Empty&lt;span class="w"&gt;  &lt;/span&gt;
/dev/sdc3&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Empty&lt;span class="w"&gt;  &lt;/span&gt;
/dev/sdc4&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Empty
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To list them in a dump format, suitable as input to sfdisk (for cloning,
saving or for some wacky awesome script):&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;root@host&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# sfdisk -d /dev/sdc# partition table of /dev/sdc  &lt;/span&gt;
unit:&lt;span class="w"&gt; &lt;/span&gt;sectors

/dev/sdc1&lt;span class="w"&gt; &lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;63&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1953520002&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;83&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
/dev/sdc2&lt;span class="w"&gt; &lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
/dev/sdc3&lt;span class="w"&gt; &lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
/dev/sdc4&lt;span class="w"&gt; &lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can use that dump in a fashion like this to clone a disks's
partition map:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;sfdisk&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;/dev/sdc&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sfdisk&lt;span class="w"&gt; &lt;/span&gt;/dev/sdd
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or for saving it and using it later:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;sfdisk&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;/dev/sdc&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;partition.sfdisk&lt;span class="w"&gt;  &lt;/span&gt;
...&lt;span class="w"&gt;  &lt;/span&gt;
sfdisk&lt;span class="w"&gt; &lt;/span&gt;/dev/sdc&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;&lt;span class="w"&gt; &lt;/span&gt;partition.sfdisk
&lt;/pre&gt;&lt;/div&gt;
</content></entry><entry><title>End of 2008</title><link href="http://n8foo.com/blog/end-of-2008/" rel="alternate"/><updated>2009-01-01T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:867941cf-2fe6-3860-9ccc-068ee86ecf24</id><content type="html">&lt;p&gt;I have done a few things in the last few months that are worthy of mention. I haven't had much of a chance to blog about them or write them down, what with them all being back to back and then holidays, being sick, vacation, more holidays, more being sick. But here are some links to the media I've produced. Enjoy.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/n8foo/sets/72157610357703505" title="2 Moto Baja 2008 by n8foo, on Flickr"&gt;&lt;img src="motobaja.jpg" alt="2 Adventurers"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/n8foo/sets/72157610357703505/"&gt;San Diego CA USA to Cabo San Lucas, Baja California Sur, MX&lt;/a&gt; (in 6 days, 2200+ miles, on my new BMW adventure motorcycle)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.vimeo.com/2492763"&gt;One month of beard growth in 5 seconds&lt;/a&gt; (an experiment in time lapse)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.vimeo.com/2668014"&gt;Deleting that same beard at high speed&lt;/a&gt; (an experiment with tracy's camera)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=978FHU6MlCA"&gt;The mechanical wonderment behind a bowling alley machine&lt;/a&gt;&lt;/p&gt;
</content></entry><entry><title>ssh tab completion on known_hosts</title><link href="http://n8foo.com/blog/ssh-tab-completion-on-knownhosts/" rel="alternate"/><updated>2008-11-05T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:a76b0104-59f8-3817-bbbd-4d58a8dd93da</id><content type="html">&lt;p&gt;It's silly I've waited this may years to go figure this out. Many of you
may already know that modern installs of OpenSSH will tab complete
hostnames based on what's in the /etc/hosts file. But there is a neat
little addition to your .bashrc that will tack on the ability to tab
complete hostnames based on what's in &lt;code&gt;~/.ssh/known_hosts&lt;/code&gt;. Add this to
your .bashrc:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;SSH_COMPLETE&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;cat&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/known_hosts&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
cut&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;sed&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;s/,.*//g&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
uniq&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;complete&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;default&lt;span class="w"&gt; &lt;/span&gt;-W&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;SSH_COMPLETE&lt;/span&gt;&lt;span class="p"&gt;[*]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ssh
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;All your new shells will auto complete based on what hosts you've
connected to once (and therefore have entries in the known_hosts file).
Any host you've never visited, well it won't be there. If you want to
filter it based on certain hosts (for example, hosts in a certain domain
name), just add a &lt;code&gt;| grep domain.com&lt;/code&gt; after the &lt;code&gt;uniq&lt;/code&gt;. If you're like
me, this will save a lot of keystrokes over the next few years.&lt;/p&gt;
&lt;p&gt;Tip: If you cut and paste my text above and it gives errors, make sure
your cut-n-paste didn't change the quotes. If you want to see what it's
going to use (or troubleshoot/modify), you can run this on the command
line:&lt;/p&gt;
&lt;div class="hll"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;cat&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/known_hosts&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
cut&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
sed&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;s/,.*//g&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
uniq
&lt;/pre&gt;&lt;/div&gt;
</content></entry><entry><title>New Midpipe</title><link href="http://n8foo.com/blog/new-midpipe/" rel="alternate"/><updated>2008-09-28T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:4c81fafc-f097-3dfe-a60a-0189fc031271</id><content type="html">&lt;p&gt;&lt;a href="http://www.flickr.com/photos/n8foo/2893359759/" title="photo sharing"&gt;&lt;img src="http://farm4.static.flickr.com/3285/2893359759_c99d774276_m.jpg" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;span style="margin-top: 0px;font-size:0;"&gt;&lt;a href="http://www.flickr.com/photos/n8foo/2893359759/"&gt;Out for a
hyperspin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Installed a new &lt;a href="http://www.leovinceusa.com/"&gt;LeoVince&lt;/a&gt; midpipe on the
Hypermotard earlier in the week (2am in the garage with a rubber hammer
the night before an early meeting). Finally got a moment away from the
keyboard to take it out for a spin tonight. Total awesomeness. It starts
better, sounds better and runs better. I think it's a bit faster too.
How awesome is that for the effort and price? I should have done this a
long time ago.&lt;/p&gt;
&lt;p&gt;Pics: &lt;a href="http://flickr.com/photos/n8foo/2889081603"&gt;Old and Busted&lt;/a&gt;. &lt;a href="http://flickr.com/photos/n8foo/2889915452"&gt;New
Hotness&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I had also adjusted the bars a bit to be a tad higher, but I didn't like
it. The turn signals are pointed at the ground 5 feet in front of me,
which means my effective road use brightness went from 'are those
lasers?' to 'dead lightning bug'. I may pick a position half way between
this position and neutral. Will have to test it again later in the week
when I've got some more time.&lt;/p&gt;
</content></entry><entry><title>HD Video Test</title><link href="http://n8foo.com/blog/hd-video-test/" rel="alternate"/><updated>2008-08-13T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:829caeed-2ee8-3cc5-9c2c-0a6fc1401063</id><content type="html">&lt;p&gt;Finally got myself a video camera. Been looking at them critically for about 8 years now...ever since my Hi8 cam broke in 2000. I loved making movies back then, and even lately have been doing various time-lapse type videos...not really 'movies' since they were shot with a SLR. A few years ago I got interested in video again with the advent of consumer level HD cameras. Canon came out with the HF10 and HF100, soda-can sized cameras that record 1080p HD to SDHC flash cards...no moving parts, great for strapping to cars/motorcycles, etc. When the price finally fell to a range I could deal with, I pulled the trigger. It's so cool...and little! This is my first test. Video quality is great! I hope to be posting more mischief and fun events in the coming months.&lt;/p&gt;
&lt;p&gt;Is Vimeo the best place to host HD video? Anyone? Bueller? Anyway, enjoy some test shots from the backyard...&lt;/p&gt;
&lt;object height="360" width="640"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1514388&amp;amp;server=www.vimeo.com&amp;amp;show_title=0&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=ffffff&amp;amp;fullscreen=1"&gt;&lt;embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1514388&amp;amp;server=www.vimeo.com&amp;amp;show_title=0&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=ffffff&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="360" width="640"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;p&gt;&lt;a href="http://www.vimeo.com/1514388?pg=embed&amp;amp;sec=1514388"&gt;HD Test - Backyard Oddities&lt;/a&gt;&lt;/p&gt;
</content></entry><entry><title>changing your server over to GMT</title><link href="http://n8foo.com/blog/changing-your-server-over-to-gmt/" rel="alternate"/><updated>2008-08-05T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:cf1c9c65-cb44-348e-930f-5d2d29f4c778</id><content type="html">&lt;p&gt;Funny how it's kind of hard to find documentation on this fairly simple task. The host I'm working with is CentOS 5, a variant of Redhat Enterprise 5. I use the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cat /usr/share/zoneinfo/GMT &amp;gt; /etc/localtime
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That is actually what sets the time. It's a binary file and is what our system tools and libraries look at.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;vi /etc/sysconfig/clock
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Edit the ZONE to be GMT. Mine looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ZONE="GMT"
UTC=true
ARC=false
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Verify it looks right with these commands.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;date ; date -u ; /sbin/hwclock --show
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Reboot, done!&lt;/p&gt;
</content></entry><entry><title>Statistics, Charts and R</title><link href="http://n8foo.com/blog/statstics-charts-and-r/" rel="alternate"/><updated>2008-06-02T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:4a58b792-66cd-3027-acb9-cfb867a1cd2c</id><content type="html">&lt;p&gt;&lt;a href="http://www.r-project.org/"&gt;R&lt;/a&gt; is an open source environment for statistical computing. It can do some pretty neat breakdowns of your data and has a lot of built in functions for doing so. One of it's great strengths is generating production quality graphics and charts. This is what I needed it for and what I'll be explaining here in a moment. I learned R by watching a &lt;a href="http://www.decisionsciencenews.com/?p=261"&gt;video introduction to R&lt;/a&gt; created by Decision Science News. There were 2 actually. But not very long and it got me to a base level. I then installed R on my Mac, it was cake. Go to the &lt;a href="http://www.r-project.org/"&gt;R site&lt;/a&gt;, download the DMG, run the R executable and you're ready to go. That got me up and running so I could start playing around on my own and using other examples from the web. YMMV on other platforms.&lt;/p&gt;
&lt;p&gt;Now for the example. Let's set the stage. Say you have some data in a table, for example, a race my girlfriend competed in, the &lt;a href="http://kathyloperevents.com/results/2006_Super10.HTML"&gt;2006 San Diego 10K race&lt;/a&gt;. I copied, pasted that data into a file, scrubbed it down, did some math with perl to get me the # of seconds, and ended up with a &lt;a href="race.csv"&gt;CSV file&lt;/a&gt;. Download the file, save it locally, read that file in with R:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;race&amp;lt;-read.csv("race.csv")
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You are reading that CSV file in as a table into a variable called 'race'. Because that CSV has a header as the first line, it automatically assigns variables based on those column names. To reference those columns, use &lt;code&gt;race$CITY&lt;/code&gt;, to check out the 'CITY' column. So to check out what you've just done, type "&lt;span style="font-size: 85%;"&gt;&lt;span style="font-family: courier new;"&gt;race&lt;/span&gt;&amp;lt;/span&amp;gt;" on the console. Typing the variable name will spit it all back out. To see a breakdown of what that variable contains, type:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;summary(race)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To see stats on the racers ages, type in:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;summary(race$AGE)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which spits out:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Min. 1st Qu. Median Mean 3rd Qu. Max.  
10.00 28.00 35.00 37.06 44.00 81.00
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Minimum age of a runner was 10, oldest was 81. Average age was 37.06 years old. Doing this for &lt;code&gt;race$SEX&lt;/code&gt; shows us there were 411 women and 474 men. Neat! Now for the visuals:&lt;br&gt;
&lt;a href="http://www.flickr.com/photos/n8foo/2550921166/" title="Age vs Time by n8foo, on Flickr"&gt;&lt;img src="chart.jpg" alt="Age vs
Time"&gt;&lt;/a&gt;&lt;br&gt;
Below is a script I used to generate the graph above. You can see how I am plotting the dots, and drawing both lines:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;race&amp;lt;-read.csv("race.csv")
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Main Plot.&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;plot(race$SECONDS/60,race$AGE,  
col="#5fae27",  
main="",  
xlab="Minutes",  
ylab="Age",  
cex=0.5,  
type="p")
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Set the Title&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;title(main="Age vs Time")
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Draw the Red Line&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;lines(stats::lowess(race$SECONDS/60,race$AGE,f=0.1),  
col="red",  
lwd=2)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Draw the Blue Line&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;lines(stats::lowess(race$SECONDS/60,race$AGE,f=0.3),  
col="blue",  
lwd=3)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Not too hard, not too much code...pretty easy in fact! One of the great things about R is the built in help. Any of those functions, just type: &lt;code&gt;?function&lt;/code&gt; ..and you'll have immediate help. I encourage you to do that for the example above, to better understand it. It will describe far better than I can how each one of those functions works.&lt;/p&gt;
&lt;p&gt;Let's generate another one, a histogram. That's easy:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hist(race$AGE,col="RED",xlab="Age",breaks=100,main="Histogram of
Racers Age"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To generate this:&lt;br&gt;
&lt;a href="http://www.flickr.com/photos/n8foo/2546957291/" title="2006 San Diego Super Run 10K by n8foo, on Flickr"&gt;&lt;img src="hist.jpg" alt="2006 San Diego Super Run
10K"&gt;&lt;/a&gt;&lt;br&gt;
So, what did I learn from the creation of this plot? My initial suspicion was that younger people would do better in the race...the data shows that is's almost average across the board. The average age is in the late 30's, but the histogram shows the biggest group was mid-late 20's. Hardly anyone in their early 20's even entered the race...too busy drinking? Also, there is a neat little cluster at the bottom left of the plot that shows a group of young kids in their teens that did well.&lt;/p&gt;
&lt;p&gt;I have been making more of these, mostly around sysadmin type stuff. I'll post those as I get more time.&lt;/p&gt;
</content></entry><entry><title>I got Joe Jobbed!</title><link href="http://n8foo.com/blog/i-got-joe-jobbed/" rel="alternate"/><updated>2008-04-16T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:f0c05847-16fd-3b18-bf3d-881aa94e0425</id><content type="html">&lt;p&gt;In case you've never heard of this, getting '&lt;a href="http://en.wikipedia.org/wiki/Joe_job"&gt;Joe Jobbed&lt;/a&gt;' is when a spammer uses your e-mail address as the 'From:' in their spam and you get all the billion bounces. It rendered my Blackberry useless all afternoon, and I thought I'd finally be screwed on this one. Alas, SpamAssassin 3.2.0 and above (I'm running 3.2.4) comes with rules to block this. Unknown to me, most of the bounces were already going to my spam folder, but any that didn't have the spam body were getting to me. I followed the instructions on this page: &lt;a href="http://wiki.apache.org/spamassassin/VBounceRuleset"&gt;http://wiki.apache.org/spamassassin/VBounceRuleset&lt;/a&gt; to make sure it was all set up and wouldn't classify bounces from my own server as bad. Then I set up the following procmail rule to put bounces in their own folder that I can review and run stats on:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:0:
* ^X-Spam-Status:.*ANY_BOUNCE_MESSAGE.*
bounces
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Done!&lt;/p&gt;
&lt;p&gt;More good reading on this: &lt;a href="http://www.sitepoint.com/print/sabotage-coping-joe-job"&gt;http://www.sitepoint.com/print/sabotage-coping-joe-job&lt;/a&gt;&lt;/p&gt;
</content></entry><entry><title>UNIX paste, sed and nl commands</title><link href="http://n8foo.com/blog/unix-paste-sed-and-nl-commands/" rel="alternate"/><updated>2008-02-27T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:69896456-abcc-35c4-bc49-e21525824f46</id><content type="html">&lt;p&gt;3 highly useful commands you will find as part of your standard UNIX
toolbox. I'll give an example situation for relevance:&lt;/p&gt;
&lt;p&gt;I quite often find myself needing to merge 2 files together for some
reason or another. My latest awesomeness consists of ripping/encoding
favorite seasons of DVD's I own so my MediaCenter can have an easily
accessed library (that I can also stream to my iPod Touch). When the
encoding is done, I get files based on the name of the DVD Media and the
track number. Like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Blah Season 1 Disc 1-1.mp4  
Blah Season 1 Disc 1-2.mp4  
Blah Season 1 Disc 1-3.mp4  
Blah Season 1 Disc 1-4.mp4  
Blah Season 1 Disc 2-1.mp4  
Blah Season 1 Disc 2-2.mp4  
Blah Season 1 Disc 2-3.mp4  
Blah Season 1 Disc 2-4.mp4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I can go to a place like Wikipedia or Amazon and find a list of the
track names, that should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Pilot  
The Fat Man  
Little John  
Howard  
The Reconing  
Half Way  
Blah  
Blah Pt 2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What I want to end up with is files named something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Blah - S01E01 - Pilot.mp4  
Blah - S01E02 - The Fat Man.mp4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It'd be so much easier to rename these on the command line if I could at
least partly automate it. Re-typing is a PITA. So, here is how I do it
to save a lot of time...&lt;/p&gt;
&lt;p&gt;If I assume that they were ripped in order, I can get a listing of the
order of the episode files based on the time stamps (ls) and add a " to
the front and end of the line (sed commands):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# ls -tr *.mp4 \\  
| sed 's/^/"/g' \\  
| sed 's/$/"/g' &amp;gt; tracklist.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next I go to Amazon, Wikipedia, whatever. Find a list of episodes that
is represented with tables (which cut-n-pastes as individual lines with
tabs as the delimiter) and paste it into a vi edit session:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# vi episodes.txt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In general, edit this file down to a point that the only thing that
exists are the track names, one per line. Let's pretend the first column
contained the name of the track, 2nd column the Writer, etc. We only
care about the first column, so you can execute this command in vi:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:%s/\\t.*//g
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can do other various cleanup like removing the " character:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:%s/"//g
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Clean up other stuff like invalid shell characters, extra spaces, etc.
This is the least automated part, but a hell of a lot faster/easier than
re-typing. Especially if you are a vi whiz. If you use some other text
editor, I'm sure this can be accomplished in a similar fashion.&lt;/p&gt;
&lt;p&gt;Now we have 1 file that is the list of mp4 files, in order, and another
that is the episode names, in order. What we now need is to make a file
with what we actually want the files to be named. I accomplish this with
the following command-line awesomeness:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nl -n rz -w 2 -s " - " episodes.txt \\  
| sed "s/^/\\"Blah - S01E/g" \\  
| sed "s/$/.mp4\\"/g" \\  
&amp;gt; newnames.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To break that down, this is what is happening:&lt;/p&gt;
&lt;p&gt;The nl command adds numbered lines...the -n means "right justified,
padded zeros" and the -w means "padded with 2 characters" and the -s
means "separate the columns with what's in the quotes".&lt;br&gt;
The 2 sed commands add a " to the beginning and end of the lines.&lt;br&gt;
The &amp;gt; sends the output to a file.&lt;/p&gt;
&lt;p&gt;Output looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;"Blah - S01E01 - Pilot.mp4"  
"Blah - S01E02 - The Fat Man.mp4"  
"Blah - S01E03 - Little John.mp4"  
"Blah - S01E04 - Howard.mp4"  
"Blah - S01E05 - The Reconing.mp4"  
"Blah - S01E06 - Half Way.mp4"  
"Blah - S01E07 - Blah.mp4"  
"Blah - S01E08 - Blah Pt 2.mp4"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we merge the 2 files and prepend the 'mv' command to get a script we
can run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;paste tracklist.txt newname.txt \\  
| sed 's/^/mv /g' \\  
&amp;gt; script.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mv "Blah Season 1 Disc 1-1.mp4" "Blah - S01E01 - Pilot.mp4"  
mv "Blah Season 1 Disc 1-2.mp4" "Blah - S01E02 - The Fat Man.mp4"  
mv "Blah Season 1 Disc 1-3.mp4" "Blah - S01E03 - Little John.mp4"  
mv "Blah Season 1 Disc 1-4.mp4" "Blah - S01E04 - Howard.mp4"  
mv "Blah Season 1 Disc 2-1.mp4" "Blah - S01E05 - The Reconing.mp4"  
mv "Blah Season 1 Disc 2-2.mp4" "Blah - S01E06 - Half Way.mp4"  
mv "Blah Season 1 Disc 2-3.mp4" "Blah - S01E07 - Blah.mp4"  
mv "Blah Season 1 Disc 2-4.mp4" "Blah - S01E08 - Blah Pt 2.mp4"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check the script for sanity, then run it!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bash -x script.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;w00t!&lt;/p&gt;
&lt;p&gt;If you want the shell script I use to automate this somewhat:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#! /bin/sh

ls -tr *.mp4 \\  
| sed 's/^/"/g' \\  
| sed 's/$/"/g' \\  
&amp;gt; tracklist.txt  
nl -n rz -w 2 -s " - " episodes.txt \\  
| sed "s/^/\\"$1 - $2E/g" \\  
| sed "s/$/.mp4\\"/g" \\  
&amp;gt; newnames.txt  
paste tracklist.txt newnames.txt \\  
| sed 's/^/mv /g' \\  
&amp;gt; script.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The arguments are the name of the series and the season, like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bash ./rename.sh Blah S01
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;P.S. If you're trying to guess the show by the track names, I made them
up. :)&lt;/p&gt;
</content></entry><entry><title>My Synergy Setup</title><link href="http://n8foo.com/blog/my-synergy-setup/" rel="alternate"/><updated>2008-02-26T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:4e0deb73-0ef6-3169-a374-88055bbc35b1</id><content type="html">&lt;p&gt;&lt;a href="http://synergy2.sourceforge.net/"&gt;Synergy&lt;/a&gt; rules. I've been talking
about it for a few weeks now, expounding on it's virtues over other
options like x2vnc. A friend asked that I document my setup...here ya go
Eddy: :)&lt;/p&gt;
&lt;p&gt;My current install of synergy runs on on my Mac Pro, my linux box
(centos5) and my MacBook Pro laptop. The Mac Pro is the controlling
keyboard and reaches across both of the other computers. The monitor
layout is the Mac Pro in front (2 monitors), the Linux box directly to
the left and the laptop below the linux box.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/n8foo/2293128638/" title="My Home Workstation by n8foo, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2222/2293128638_a550c41b8a_m.jpg" alt="My Home
Workstation"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After I downloaded synergy, I placed the 2 binaries (synergys,synergyc)
in /usr/local/bin on my Mac. If the dir doesen't exist, create it. I
also created /usr/local/etc for the config files.&lt;/p&gt;
&lt;p&gt;Config on the Mac Pro:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;n8pro:bin nathan$ cd /usr/local/bin
n8pro:bin nathan$ ls
jhead  jpegtran synergyc synergys xv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The config file on the Mac Pro:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;n8pro:~ nathan$ cd /usr/local/etc/
n8pro:etc nathan$ cat synergy.conf
  section: screens
     n8pro.local:
     n8bookpro.local:
     homelinux:
  end
  section: links
     n8pro.local:
         left = homelinux
     homelinux:
         right = n8pro.local
         down = n8bookpro.local
n8bookpro.local:
   up = homelinux
  end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Commands I run on the Mac Pro (server):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# synergys -f -c /usr/local/etc/synergy.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Commands I run on the Linux Box (client):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# synergyc -f n8pro
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Commands I run on the MacBook Pro (client):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# synergyc -f n8pro
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Extra credit:&lt;/p&gt;
&lt;p&gt;I also use this at work. A Linux box is the control. Synergyc will
re-try connections every 30 sec or so, which means I can launch synergyc
clients and let them fail when I'm not on the network. This means I can
run it once and connect/disconnect from work/home networks and have
seamless mouse sharing with very little work required. To set this up on
the Linux box, i had a config similar to the one above for the Mac Pro.
On the laptop I have one script that I run that fires off both synergyc
clients at the same time. They stay running until a reboot. After
reboot, I run it again and I'm set. This is the script:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cat /usr/local/bin/setup_synergy.sh
#! /bin/bash
killall synergyc
sleep 2
synergyc -f n8pro &amp;amp;
synergyc -f n8linuxbox &amp;amp;
&lt;/code&gt;&lt;/pre&gt;
</content></entry><entry><title>Restoring lost screen sockets</title><link href="http://n8foo.com/blog/restoring-lost-screen-sockets/" rel="alternate"/><updated>2007-12-20T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:d0e9f4bb-16ed-392d-a645-37ecce2e0556</id><content type="html">&lt;p&gt;Do your screen sockets get nuked and you can't connect to your screen
sessions? If something auto-cleans the /tmp dir, you may have seen this
before. If you're like me, you end up with 10 or so shells with various
programs running that you then have to follow the process tree to kill
off. This is my only real (huge) frustration with screen. Well, here's
ya go:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ps -x | grep SCREEN | awk '{print $1}' | xargs kill -CHLD&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
</content></entry><entry><title>Christmas tree decorating at high speed</title><link href="http://n8foo.com/blog/christmas-tree-decorating-at-high-speed/" rel="alternate"/><updated>2007-12-05T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:19f4c2b3-def1-3d70-b8b3-c655891676a2</id><content type="html">&lt;video width="640" height="480" controls&gt;
  &lt;source src="http://n8foo.s3.amazonaws.com/blog/Christmas Tree 2007-HD.mp4" type="video/mp4"&gt;
  Your browser does not support the video tag.
&lt;/video&gt;&lt;p&gt;If you watch closely, you can see some sillyness at the beginning. Hehe.  Good stuff!&lt;/p&gt;
</content></entry><entry><title>Peyton Lost, boooooo hoooooo</title><link href="http://n8foo.com/blog/peyton-lost-boooooo-hoooooo/" rel="alternate"/><updated>2007-11-12T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:d95e5053-c996-3f41-89fb-480d26c67529</id><content type="html">&lt;p&gt;&lt;img src="peyton_waah.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I don't even like football, but I did tonight. &amp;gt;:-)&lt;/p&gt;
&lt;p&gt;Go Chargers!!&lt;/p&gt;
</content></entry><entry><title>Spiders on Drugs</title><link href="http://n8foo.com/blog/spiders-on-drugs/" rel="alternate"/><updated>2007-11-08T00:00:00Z</updated><author><name>nathan</name></author><id>urn:uuid:f3b18fb1-64fe-31b9-a6b3-7b5e9ba66a25</id><content type="html">&lt;p&gt;I guess everyone has seen this but me:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://youtube.com/watch?v=sHzdsFiBbFc"&gt;http://youtube.com/watch?v=sHzdsFiBbFc&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;In the 1960s, Dr. Peter Witt gave drugs to spiders and observed their effects on web building. This short film about the results of the experiment was created by First Church Of Christ, Filmmaker.&lt;/p&gt;
&lt;/blockquote&gt;
</content></entry></feed>