<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-6426279</id><updated>2009-04-22T19:56:38.314-07:00</updated><title type='text'>n8 foo</title><subtitle type='html'>nate's blog/journal/mad thought calendar</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default?start-index=26&amp;max-results=25'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.mybrainhurts.com/blog/atom.xml'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>160</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6426279.post-6642741426979167240</id><published>2009-03-30T10:33:00.000-07:00</published><updated>2009-03-31T15:02:12.057-07:00</updated><title type='text'>DIY Encrypted Password Vault</title><content type='html'>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;br /&gt;&lt;br /&gt;encrypt.sh&lt;br /&gt;&lt;pre style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; color: rgb(209, 209, 209); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;span style="color: rgb(153, 153, 169);"&gt;#! /bin/sh &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;openssl bf &lt;span style="color: rgb(0, 221, 221);"&gt;-a&lt;/span&gt; -salt -&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;in&lt;/span&gt; $1&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;txt -out $1&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;bf &lt;span style="color: rgb(176, 96, 176);"&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm &lt;span style="color: rgb(0, 221, 221);"&gt;-v&lt;/span&gt; $1&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;txt&lt;/pre&gt;decrypt.sh&lt;br /&gt;&lt;pre style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; color: rgb(209, 209, 209); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;span style="color: rgb(153, 153, 169);"&gt;#! /bin/sh &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;openssl bf &lt;span style="color: rgb(0, 221, 221);"&gt;-a&lt;/span&gt; &lt;span style="color: rgb(0, 221, 221);"&gt;-d&lt;/span&gt; -salt -&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;in&lt;/span&gt; $1&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;bf&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To use it, create a file named blah.txt that has your secret info in it.  Run the encrypt script first:&lt;br /&gt;&lt;pre style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; color: rgb(209, 209, 209); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;$ .&lt;span style="color: rgb(210, 205, 134);"&gt;/&lt;/span&gt;encrypt.sh blah&lt;br /&gt;enter bf&lt;span style="color: rgb(210, 205, 134);"&gt;-&lt;/span&gt;cbc encryption password&lt;span style="color: rgb(210, 205, 134);"&gt;:&lt;/span&gt;&lt;br /&gt;Verifying &lt;span style="color: rgb(210, 205, 134);"&gt;-&lt;/span&gt; enter bf&lt;span style="color: rgb(210, 205, 134);"&gt;-&lt;/span&gt;cbc encryption password&lt;span style="color: rgb(210, 205, 134);"&gt;:&lt;/span&gt;&lt;br /&gt;removed `blah.txt'&lt;br /&gt;&lt;/pre&gt;It will encrypt the file and remove it.  Check the contents of the file:&lt;br /&gt;&lt;pre style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; color: rgb(209, 209, 209); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;$ cat blah.bf&lt;br /&gt;U2FsdGVkX1&lt;span style="color: rgb(210, 205, 134);"&gt;/&lt;/span&gt;+ZGiXPSZX8MED9aXrm1NfIEjpv5vvFKo&lt;span style="color: rgb(210, 205, 134);"&gt;=&lt;/span&gt;&lt;/pre&gt;It's actually base 64 encoded so you can email it to yourself for safe keeping if you so choose.&lt;br /&gt;&lt;br /&gt;To decrypt for reading:&lt;br /&gt;&lt;pre style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; color: rgb(209, 209, 209); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;$ .&lt;span style="color: rgb(210, 205, 134);"&gt;/&lt;/span&gt;decrypt.sh blah&lt;br /&gt;enter bf&lt;span style="color: rgb(210, 205, 134);"&gt;-&lt;/span&gt;cbc decryption password&lt;span style="color: rgb(210, 205, 134);"&gt;:&lt;/span&gt;&lt;br /&gt;secret host&lt;span style="color: rgb(210, 205, 134);"&gt;:&lt;/span&gt; secret password&lt;br /&gt;secret host2&lt;span style="color: rgb(210, 205, 134);"&gt;:&lt;/span&gt; secret password2&lt;br /&gt;&lt;/pre&gt;Now take the encrypted output file and the 2 scripts, email it to yourself and store a copy on a thumb drive.  :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-6642741426979167240?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/6642741426979167240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2009/03/diy-encrypted-password-vault.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6642741426979167240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6642741426979167240'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2009/03/diy-encrypted-password-vault.html' title='DIY Encrypted Password Vault'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-384501042993830085</id><published>2009-03-23T09:28:00.000-07:00</published><updated>2009-03-24T02:07:24.243-07:00</updated><title type='text'>Why all phones need a silent ring</title><content type='html'>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;br /&gt;&lt;br /&gt;I used iTunes to make a silent ringtone...you can download it here: &lt;a href="http://www.mybrainhurts.com/blog/images/2009/2/silent_ring.m4r"&gt;iPhone Silent Ringone&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-384501042993830085?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/384501042993830085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2009/03/or-why-all-phones-need-silent-ring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/384501042993830085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/384501042993830085'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2009/03/or-why-all-phones-need-silent-ring.html' title='Why all phones need a silent ring'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-6463409687713590149</id><published>2009-03-13T16:14:00.000-07:00</published><updated>2009-03-16T10:31:31.184-07:00</updated><title type='text'>automated nmap scans</title><content type='html'>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;br /&gt;&lt;br /&gt;&lt;pre style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; color: rgb(209, 209, 209); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;span style="color: rgb(153, 153, 169);"&gt;#! /bin/sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DIR&lt;span style="color: rgb(210, 205, 134);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;/opt/nmap/scans&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;"&lt;/span&gt;&lt;br /&gt;NETWORKS&lt;span style="color: rgb(210, 205, 134);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;"192.168.1.0-255"&lt;/span&gt;&lt;br /&gt;TODAY&lt;span style="color: rgb(210, 205, 134);"&gt;=&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;`date +%Y%m%d`&lt;/span&gt;&lt;br /&gt;YESTERDAY&lt;span style="color: rgb(210, 205, 134);"&gt;=&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;`date &lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(0, 221, 221); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;-d&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; yesterday +%Y%m%d`&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;for&lt;/span&gt; network &lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;in&lt;/span&gt; $NETWORKS&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;do&lt;/span&gt;&lt;br /&gt;      nmap &lt;span style="color: rgb(0, 221, 221);"&gt;-n&lt;/span&gt; -sS $network -oG $DIR&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;$network&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;$TODAY&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;nmap&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;for&lt;/span&gt; network &lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;in&lt;/span&gt; $NETWORKS&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;do&lt;/span&gt;&lt;br /&gt;      diff -I &lt;span style="color: rgb(0, 196, 196);"&gt;"^#"&lt;/span&gt; $DIR&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;$network&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;$TODAY&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;nmap $DIR&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;$network&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;$YESTERDAY&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;nmap  &lt;span style="color: rgb(227, 74, 220);"&gt;&gt;&lt;/span&gt; $DIR&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;$network&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;$TODAY&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;diff&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;for&lt;/span&gt; network &lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;in&lt;/span&gt; $NETWORKS&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;do&lt;/span&gt;&lt;br /&gt;      SIZE&lt;span style="color: rgb(210, 205, 134);"&gt;=&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;`find &lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;$DIR&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(64, 1, 90); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;/&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;$network&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(230, 97, 112); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-weight: bold;"&gt;.&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;$TODAY&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(230, 97, 112); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-weight: bold;"&gt;.&lt;/span&gt;&lt;span style="background: rgb(40, 24, 0) none repeat scroll 0% 0%; color: rgb(255, 255, 255); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;diff -size +0b`&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: rgb(210, 205, 134);"&gt;[&lt;/span&gt; &lt;span style="color: rgb(0, 196, 196);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;$SIZE&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;"&lt;/span&gt; &lt;span style="color: rgb(0, 221, 221);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 196, 196);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;$DIR&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;$network&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;$TODAY&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;.diff"&lt;/span&gt; &lt;span style="color: rgb(210, 205, 134);"&gt;]&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;then&lt;/span&gt;&lt;br /&gt;              cat $DIR&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;$network&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;$TODAY&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;diff &lt;span style="color: rgb(227, 74, 220);"&gt;|&lt;/span&gt; mail &lt;span style="color: rgb(0, 221, 221);"&gt;-s&lt;/span&gt; &lt;span style="color: rgb(0, 196, 196);"&gt;"Change Detected for &lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;$network&lt;/span&gt;&lt;span style="color: rgb(0, 196, 196);"&gt;"&lt;/span&gt;  user@host&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;.&lt;/span&gt;com&lt;br /&gt;      &lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(230, 97, 112); font-weight: bold;"&gt;done&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-6463409687713590149?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/6463409687713590149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2009/03/automated-nmap-scans.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6463409687713590149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6463409687713590149'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2009/03/automated-nmap-scans.html' title='automated nmap scans'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-3316943384454566874</id><published>2009-01-03T20:20:00.000-08:00</published><updated>2009-01-03T20:49:52.424-08:00</updated><title type='text'>automated disk partitioning with sfdisk</title><content type='html'>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;pre&gt;[root@host]# sfdisk -l /dev/sdc&lt;br /&gt;&lt;br /&gt;Disk /dev/sdc: 121601 cylinders, 255 heads, 63 sectors/track&lt;br /&gt;Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0&lt;br /&gt;&lt;br /&gt;Device Boot Start     End   #cyls    #blocks   Id  System&lt;br /&gt;/dev/sdc1          0+ 121600  121601- 976760001   83  Linux&lt;br /&gt;/dev/sdc2          0       -       0          0    0  Empty&lt;br /&gt;/dev/sdc3          0       -       0          0    0  Empty&lt;br /&gt;/dev/sdc4          0       -       0          0    0  Empty&lt;br /&gt;&lt;/pre&gt;To list them in a dump format, suitable as input to sfdisk (for cloning, saving or for some wacky awesome script): &lt;pre&gt;[root@host ]# sfdisk -d /dev/sdc&lt;br /&gt;# partition table of /dev/sdc&lt;br /&gt;unit: sectors&lt;br /&gt;&lt;br /&gt;/dev/sdc1 : start=       63, size=1953520002, Id=83&lt;br /&gt;/dev/sdc2 : start=        0, size=        0, Id= 0&lt;br /&gt;/dev/sdc3 : start=        0, size=        0, Id= 0&lt;br /&gt;/dev/sdc4 : start=        0, size=        0, Id= 0&lt;br /&gt;&lt;/pre&gt;You can use that dump in a fashion like this to clone a disks's partition map:&lt;br /&gt;&lt;pre&gt;sfdisk -d /dev/sdc | sfdisk /dev/sdd&lt;br /&gt;&lt;/pre&gt;Or for saving it and using it later:&lt;br /&gt;&lt;pre&gt;sfdisk -d /dev/sdc &gt; partition.sfdisk&lt;br /&gt;sfdisk /dev/sdc &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-3316943384454566874?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/3316943384454566874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2009/01/sfdisk-is-bomb.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/3316943384454566874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/3316943384454566874'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2009/01/sfdisk-is-bomb.html' title='automated disk partitioning with sfdisk'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-8294144648137770442</id><published>2008-12-31T23:44:00.000-08:00</published><updated>2009-01-01T11:42:14.889-08:00</updated><title type='text'>End of 2008</title><content type='html'>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;div&gt;&lt;br /&gt;&lt;div&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="http://farm4.static.flickr.com/3160/3068700522_9beff40893_m.jpg" alt="2 Adventurers" height="180" width="240" /&gt;&lt;/a&gt;&lt;br /&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=978FHU6MlCA"&gt;The mechanical wonderment behind a bowling alley machine&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-8294144648137770442?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/8294144648137770442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/12/end-of-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8294144648137770442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8294144648137770442'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/12/end-of-2008.html' title='End of 2008'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-233713705683446138</id><published>2008-11-05T14:35:00.000-08:00</published><updated>2008-11-05T14:50:21.165-08:00</updated><title type='text'>ssh tab completion on known_hosts</title><content type='html'>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 ~/.ssh/known_hosts.  Add this to your .bashrc:&lt;br /&gt;&lt;pre style="color: rgb(0, 0, 0); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;blockquote&gt;SSH_COMPLETE&lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;(&lt;/span&gt; $&lt;span style="color: rgb(128, 0, 128);"&gt;(&lt;/span&gt;cat ~&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); font-weight: bold;"&gt;.&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;ssh/known_hosts&lt;/span&gt; &lt;span style="color: rgb(227, 74, 220);"&gt;|&lt;/span&gt; &lt;span style="color: rgb(15, 105, 255);"&gt;\&lt;/span&gt;&lt;br /&gt;cut &lt;span style="color: rgb(68, 170, 221);"&gt;-f&lt;/span&gt; &lt;span style="color: rgb(0, 140, 0);"&gt;1&lt;/span&gt; &lt;span style="color: rgb(68, 170, 221);"&gt;-d&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;" "&lt;/span&gt; &lt;span style="color: rgb(227, 74, 220);"&gt;|&lt;/span&gt; &lt;span style="color: rgb(15, 105, 255);"&gt;\&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(187, 121, 119); font-weight: bold;"&gt;sed&lt;/span&gt; &lt;span style="color: rgb(68, 170, 221);"&gt;-e&lt;/span&gt; s&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;,&lt;span style="color: rgb(128, 0, 0); font-weight: bold;"&gt;.&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;/g&lt;/span&gt; &lt;span style="color: rgb(227, 74, 220);"&gt;|&lt;/span&gt; &lt;span style="color: rgb(15, 105, 255);"&gt;\&lt;/span&gt;&lt;br /&gt;uniq &lt;span style="color: rgb(128, 0, 128);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(128, 0, 128);"&gt;)&lt;/span&gt;&lt;br /&gt;complete &lt;span style="color: rgb(68, 170, 221);"&gt;-o&lt;/span&gt; default -W &lt;span style="color: rgb(0, 0, 230);"&gt;"${SSH_COMPLETE[*]}"&lt;/span&gt; ssh&lt;br /&gt;&lt;/blockquote&gt;&lt;/pre&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;span style="font-family:courier new;"&gt; | &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;grep domain.com&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;after the &lt;span style="font-family:courier new;"&gt;uniq&lt;/span&gt;.  If you're like me, this will save a lot of keystrokes over the next few years.&lt;br /&gt;&lt;br /&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;br /&gt;&lt;pre style="color: rgb(0, 0, 0); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;blockquote&gt;cat ~&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); font-weight: bold;"&gt;.&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;ssh/known_hosts&lt;/span&gt; &lt;span style="color: rgb(227, 74, 220);"&gt;|&lt;/span&gt; &lt;span style="color: rgb(15, 105, 255);"&gt;\&lt;/span&gt;&lt;br /&gt;cut &lt;span style="color: rgb(68, 170, 221);"&gt;-f&lt;/span&gt; &lt;span style="color: rgb(0, 140, 0);"&gt;1&lt;/span&gt; &lt;span style="color: rgb(68, 170, 221);"&gt;-d&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;" "&lt;/span&gt; &lt;span style="color: rgb(227, 74, 220);"&gt;|&lt;/span&gt; &lt;span style="color: rgb(15, 105, 255);"&gt;\&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(187, 121, 119); font-weight: bold;"&gt;sed&lt;/span&gt; &lt;span style="color: rgb(68, 170, 221);"&gt;-e&lt;/span&gt; s&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;,&lt;span style="color: rgb(128, 0, 0); font-weight: bold;"&gt;.&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(64, 1, 90);"&gt;/g&lt;/span&gt; &lt;span style="color: rgb(227, 74, 220);"&gt;|&lt;/span&gt; &lt;span style="color: rgb(15, 105, 255);"&gt;\&lt;/span&gt;&lt;br /&gt;uniq &lt;/blockquote&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-233713705683446138?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/233713705683446138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/11/ssh-tab-completion-on-knownhosts.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/233713705683446138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/233713705683446138'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/11/ssh-tab-completion-on-knownhosts.html' title='ssh tab completion on known_hosts'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-8406288274109647281</id><published>2008-09-27T20:26:00.001-07:00</published><updated>2008-09-28T01:27:41.030-07:00</updated><title type='text'>New Midpipe</title><content type='html'>&lt;div style="float: right; margin-left: 10px; margin-bottom: 10px;"&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="" style="border: 2px solid rgb(0, 0, 0);" /&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;br /&gt;Originally uploaded by &lt;a href="http://www.flickr.com/people/n8foo/"&gt;n8foo&lt;/a&gt;&lt;/span&gt;&lt;/div&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;br /&gt;&lt;br /&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;br /&gt;&lt;br /&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;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-8406288274109647281?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/8406288274109647281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/09/new-midpipe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8406288274109647281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8406288274109647281'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/09/new-midpipe.html' title='New Midpipe'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-4601801340804596013</id><published>2008-08-12T23:32:00.000-07:00</published><updated>2008-08-13T00:53:04.067-07:00</updated><title type='text'>HD Video Test</title><content type='html'>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;br /&gt;&lt;br /&gt;Is Vimeo the best place to host HD video?  Anyone?  Bueller?   Anyway, enjoy some test shots from the backyard...&lt;br /&gt;&lt;br /&gt;&lt;a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab-03375297713342391 visible ontop" href="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;/a&gt;&lt;a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab-03375297713342391 visible ontop" href="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;/a&gt;&lt;a style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab-03375297713342391 visible ontop" href="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;/a&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;a href="http://www.vimeo.com/1514388?pg=embed&amp;amp;sec=1514388"&gt;HD Test - Backyard Oddities&lt;/a&gt; from &lt;a href="http://www.vimeo.com/user310962?pg=embed&amp;amp;sec=1514388"&gt;nathan hubbard&lt;/a&gt; on &lt;a href="http://vimeo.com/?pg=embed&amp;amp;sec=1514388"&gt;Vimeo&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-4601801340804596013?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/4601801340804596013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/08/hd-video-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/4601801340804596013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/4601801340804596013'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/08/hd-video-test.html' title='HD Video Test'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-7737241745870007057</id><published>2008-08-04T23:08:00.000-07:00</published><updated>2008-08-04T23:38:10.830-07:00</updated><title type='text'>changing your server over to GMT</title><content type='html'>&lt;blockquote&gt;&lt;/blockquote&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;br /&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;cat /usr/share/zoneinfo/GMT &gt; /etc/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;localtime&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;That is actually what sets the time.  It's a binary file and is what our system tools and libraries look at.&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;blockquote&gt;vi /etc/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;sysconfig&lt;/span&gt;/clock&lt;/blockquote&gt;&lt;/span&gt;Edit the ZONE to be GMT.  Mine looks like this:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;ZONE="GMT"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;UTC&lt;/span&gt;=true&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;ARC=false&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Verify it looks right with these commands.&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;date ; date -u ; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;sbin&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;hwclock&lt;/span&gt; --show&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Reboot, done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-7737241745870007057?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/7737241745870007057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/08/changing-your-server-over-to-gmt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/7737241745870007057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/7737241745870007057'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/08/changing-your-server-over-to-gmt.html' title='changing your server over to GMT'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-3928701184154783725</id><published>2008-06-01T21:51:00.000-07:00</published><updated>2008-06-04T03:28:32.770-07:00</updated><title type='text'>Statistics, Charts and R</title><content type='html'>For a few weeks now, I've been playing around with the statistical computing package "R" to draw some graphs/plots of data.  Why would I want to do this?  Let me quote one of my favorite movies, &lt;span style="font-weight: bold;"&gt;Sneakers&lt;/span&gt;:  &lt;blockquote style="font-style: italic;"&gt;The world isn't run by weapons anymore, or energy, or money. It's run by little ones and zeroes, little bits of data. It's all just electrons.  ...&lt;snip&gt;... There's a war out there, old friend. A world war. And it's not about who's got the most bullets. It's about who controls the information. What we see and hear, how we work, what we think... it's all about the information!&lt;/snip&gt;&lt;/blockquote&gt;Well, you get the point.  We all know that information is king and analyzing and visualizing that information is becoming more and more important.  Presenting data in a way that is easy to digest is key to getting your audience to understanding that data.   So let me make an introduction...&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&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="http://www.mybrainhurts.com/blog/images/2008/5/race.csv"&gt;CSV file&lt;/a&gt;.   Download the file, save it locally, read that file in with R:&lt;br /&gt;&lt;pre&gt;race&lt;-read.csv("race.csv")&lt;/pre&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 'race$CITY', 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;&lt;/span&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;br /&gt;&lt;pre&gt;summary(race)&lt;/pre&gt;To see stats on the racers ages, type in:&lt;br /&gt;&lt;pre&gt; summary(race$AGE)&lt;/pre&gt;Which spits out:&lt;br /&gt;&lt;pre&gt;   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.&lt;br /&gt;10.00   28.00   35.00   37.06   44.00   81.00 &lt;/pre&gt;Minimum age of a runner was 10, oldest was 81.  Average age was 37.06 years old.  Doing this for &lt;tt&gt;race$SEX&lt;/tt&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="http://farm4.static.flickr.com/3121/2550921166_a98bc2247d.jpg" alt="Age vs Time" height="338" hspace="10" vspace="10" width="500" /&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;br /&gt;&lt;pre   style="border-style: solid; border-width: 1px; padding: 0.5cm;font-family:Courier New;font-size:10pt;"&gt;race&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;-&lt;/span&gt;read.&lt;span style="color: rgb(0, 0, 0);"&gt;csv&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"race.csv"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;#Main Plot.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;plot&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;race&lt;span style="color: rgb(0, 255, 0);"&gt;$SECONDS&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;60&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;race&lt;span style="color: rgb(0, 255, 0);"&gt;$AGE&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;col&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"#5fae27"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;main&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;xlab&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"Minutes"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;ylab&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"Age"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;cex&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;0.5&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;type&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"p"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;# Set the Title&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;title&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;main&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"Age vs Time"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;# Draw the Red Line&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;lines&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;stats&lt;span style="color: rgb(0, 0, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;lowess&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;race&lt;span style="color: rgb(0, 255, 0);"&gt;$SECONDS&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;60&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;race&lt;span style="color: rgb(0, 255, 0);"&gt;$AGE&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;f&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;0.1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;),&lt;/span&gt;&lt;br /&gt;col&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"red"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;lwd&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;#Draw the Blue Line&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;lines&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;stats&lt;span style="color: rgb(0, 0, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;lowess&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;race&lt;span style="color: rgb(0, 255, 0);"&gt;$SECONDS&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;60&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;race&lt;span style="color: rgb(0, 255, 0);"&gt;$AGE&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;f&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;0.3&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;),&lt;/span&gt;&lt;br /&gt;col&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"blue"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;br /&gt;lwd&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;3&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/pre&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;br /&gt;&lt;pre&gt;?function&lt;/pre&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;br /&gt;&lt;br /&gt;Let's generate another one, a histogram.  That's real easy, you can just type this:&lt;br /&gt;&lt;pre style="border-style: solid; border-width: 1px; padding: 0.5cm; font-size: 10pt; font-family: Courier New;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;hist&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;race&lt;span style="color: rgb(0, 255, 0);"&gt;$AGE&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;col&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"RED"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;xlab&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"Age"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;breaks&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;100&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;main&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"Histogram of Racers Age"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/pre&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="http://farm4.static.flickr.com/3068/2546957291_458ba078ae_o.jpg" alt="2006 San Diego Super Run 10K" height="227" width="482" /&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;br /&gt;&lt;br /&gt;I have been making more of these, mostly around sysadmin type stuff.  I'll post those as I get more time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-3928701184154783725?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/3928701184154783725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/06/statstics-charts-and-r.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/3928701184154783725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/3928701184154783725'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/06/statstics-charts-and-r.html' title='Statistics, Charts and R'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-6423097630593037776</id><published>2008-04-15T19:37:00.000-07:00</published><updated>2008-04-15T19:46:40.107-07:00</updated><title type='text'>I got Joe Jobbed!</title><content type='html'>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;br /&gt;&lt;pre&gt;&lt;br /&gt;:0:&lt;br /&gt;* ^X-Spam-Status:.*ANY_BOUNCE_MESSAGE.*&lt;br /&gt;bounces&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Done!&lt;br /&gt;&lt;br /&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;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-6423097630593037776?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/6423097630593037776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/04/i-got-joe-jobbed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6423097630593037776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6423097630593037776'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/04/i-got-joe-jobbed.html' title='I got Joe Jobbed!'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-8869971207264937178</id><published>2008-02-26T19:34:00.000-08:00</published><updated>2008-02-27T13:37:34.690-08:00</updated><title type='text'>UNIX paste, sed and nl commands</title><content type='html'>3 highly useful commands you will find as part of your standard UNIX toolbox. I'll give an example situation for relevance:&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;&lt;pre&gt;Blah Season 1 Disc 1-1.mp4&lt;br /&gt;Blah Season 1 Disc 1-2.mp4&lt;br /&gt;Blah Season 1 Disc 1-3.mp4&lt;br /&gt;Blah Season 1 Disc 1-4.mp4&lt;br /&gt;Blah Season 1 Disc 2-1.mp4&lt;br /&gt;Blah Season 1 Disc 2-2.mp4&lt;br /&gt;Blah Season 1 Disc 2-3.mp4&lt;br /&gt;Blah Season 1 Disc 2-4.mp4&lt;/pre&gt;&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;&lt;pre&gt;Pilot&lt;br /&gt;The Fat Man&lt;br /&gt;Little John&lt;br /&gt;Howard&lt;br /&gt;The Reconing&lt;br /&gt;Half Way&lt;br /&gt;Blah&lt;br /&gt;Blah Pt 2&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What I want to end up with is files named something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Blah - S01E01 - Pilot.mp4&lt;br /&gt;Blah - S01E02 - The Fat Man.mp4&lt;/pre&gt;&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;&lt;pre&gt;# ls -tr *.mp4 | sed 's/^/"/g' | sed 's/$/"/g' &gt; tracklist.txt&lt;/pre&gt;&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;# vi episodes.txt&lt;br /&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;br /&gt;&lt;br /&gt;&lt;pre&gt;:%s/\t.*//g&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can do other various cleanup like removing the " character:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;:%s/"//g&lt;/pre&gt;&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;&lt;pre&gt;nl -n rz -w 2 -s " - " episodes.txt \&lt;br /&gt;| sed "s/^/\"Blah - S01E/g" \&lt;br /&gt;| sed "s/$/.mp4\"/g" \&lt;br /&gt;&gt; newnames.txt&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To break that down, this is what is happening:&lt;br /&gt;&lt;br /&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 &gt; sends the output to a file.&lt;br /&gt;&lt;br /&gt;Output looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;"Blah - S01E01 - Pilot.mp4"&lt;br /&gt;"Blah - S01E02 - The Fat Man.mp4"&lt;br /&gt;"Blah - S01E03 - Little John.mp4"&lt;br /&gt;"Blah - S01E04 - Howard.mp4"&lt;br /&gt;"Blah - S01E05 - The Reconing.mp4"&lt;br /&gt;"Blah - S01E06 - Half Way.mp4"&lt;br /&gt;"Blah - S01E07 - Blah.mp4"&lt;br /&gt;"Blah - S01E08 - Blah Pt 2.mp4"&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now we merge the 2 files and prepend the 'mv' command to get a script we can run:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;paste tracklist.txt newname.txt | sed 's/^/mv /g' &gt; script.sh&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Which looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;mv "Blah Season 1 Disc 1-1.mp4" "Blah - S01E01 - Pilot.mp4"&lt;br /&gt;mv "Blah Season 1 Disc 1-2.mp4" "Blah - S01E02 - The Fat Man.mp4"&lt;br /&gt;mv "Blah Season 1 Disc 1-3.mp4" "Blah - S01E03 - Little John.mp4"&lt;br /&gt;mv "Blah Season 1 Disc 1-4.mp4" "Blah - S01E04 - Howard.mp4"&lt;br /&gt;mv "Blah Season 1 Disc 2-1.mp4" "Blah - S01E05 - The Reconing.mp4"&lt;br /&gt;mv "Blah Season 1 Disc 2-2.mp4" "Blah - S01E06 - Half Way.mp4"&lt;br /&gt;mv "Blah Season 1 Disc 2-3.mp4" "Blah - S01E07 - Blah.mp4"&lt;br /&gt;mv "Blah Season 1 Disc 2-4.mp4" "Blah - S01E08 - Blah Pt 2.mp4"&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Check the script for sanity, then run it!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;bash -x script.sh&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;w00t!&lt;br /&gt;&lt;br /&gt;If you want the shell script I use to automate this somewhat:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#! /bin/sh&lt;br /&gt;&lt;br /&gt;ls -tr *.mp4 | sed 's/^/"/g' | sed 's/$/"/g' &gt; tracklist.txt&lt;br /&gt;nl -n rz -w 2 -s " - " episodes.txt \&lt;br /&gt;| sed "s/^/\"$1 - $2E/g" \&lt;br /&gt;| sed "s/$/.mp4\"/g" \&lt;br /&gt;&gt; newnames.txt&lt;br /&gt;paste tracklist.txt newnames.txt | sed 's/^/mv /g' &gt; script.sh&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The arguments are the name of the series and the season, like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;bash ./rename.sh Blah S01&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;P.S. If you're trying to guess the show by the track names, I made them up. :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-8869971207264937178?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/8869971207264937178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/02/unix-paste-sed-and-nl-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8869971207264937178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8869971207264937178'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/02/unix-paste-sed-and-nl-commands.html' title='UNIX paste, sed and nl commands'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-1345616677720954752</id><published>2008-02-25T19:29:00.001-08:00</published><updated>2008-02-26T19:02:55.963-08:00</updated><title type='text'>My Synergy Setup</title><content type='html'>&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;br /&gt;&lt;br /&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;br /&gt;&lt;br /&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" width="240" height="180" alt="My Home Workstation" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;Config on the Mac Pro:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;n8pro:bin nathan$ cd /usr/local/bin&lt;br /&gt;n8pro:bin nathan$ ls&lt;br /&gt;jhead  jpegtran synergyc synergys xv&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The config file on the Mac Pro:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;n8pro:~ nathan$ cd /usr/local/etc/&lt;br /&gt;n8pro:etc nathan$ cat synergy.conf&lt;br /&gt;  section: screens&lt;br /&gt;     n8pro.local:&lt;br /&gt;     n8bookpro.local:&lt;br /&gt;     homelinux:&lt;br /&gt;  end&lt;br /&gt;  section: links&lt;br /&gt;     n8pro.local:&lt;br /&gt;         left = homelinux&lt;br /&gt;     homelinux:&lt;br /&gt;         right = n8pro.local&lt;br /&gt;         down = n8bookpro.local&lt;br /&gt;n8bookpro.local:&lt;br /&gt;   up = homelinux&lt;br /&gt;  end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Commands I run on the Mac Pro (server):&lt;br /&gt;&lt;pre&gt;# synergys -f -c /usr/local/etc/synergy.conf&lt;/pre&gt;&lt;br /&gt;Commands I run on the Linux Box (client):&lt;br /&gt;&lt;pre&gt;# synergyc -f n8pro&lt;/pre&gt;&lt;br /&gt;Commands I run on the MacBook Pro (client):&lt;br /&gt;&lt;pre&gt;# synergyc -f n8pro&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Extra credit:&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;&lt;pre&gt;cat /usr/local/bin/setup_synergy.sh&lt;br /&gt;#! /bin/bash&lt;br /&gt;killall synergyc&lt;br /&gt;sleep 2&lt;br /&gt;synergyc -f n8pro &amp;amp;&lt;br /&gt;synergyc -f n8linuxbox &amp;amp;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-1345616677720954752?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/1345616677720954752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2008/02/my-synergy-setup.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1345616677720954752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1345616677720954752'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2008/02/my-synergy-setup.html' title='My Synergy Setup'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-6158562888887067380</id><published>2007-12-20T03:16:00.000-08:00</published><updated>2008-03-03T11:06:29.260-08:00</updated><title type='text'>Restoring lost screen sockets</title><content type='html'>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;br /&gt;&lt;br /&gt;&lt;tt&gt;ps -x | grep SCREEN | awk '{print $1}' | xargs kill -CHLD&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-6158562888887067380?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/6158562888887067380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/12/restoring-lost-screen-sockets.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6158562888887067380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/6158562888887067380'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/12/restoring-lost-screen-sockets.html' title='Restoring lost screen sockets'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-4057954090439070600</id><published>2007-12-05T14:37:00.001-08:00</published><updated>2007-12-05T14:38:32.427-08:00</updated><title type='text'>Christmas tree decorating at high speed</title><content type='html'>&lt;a style="left: 0px ! important; top: 18px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible" href="http://www.vimeo.com/moogaloop.swf?clip_id=418612&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=01AAEA"&gt;&lt;/a&gt;&lt;object type="application/x-shockwave-flash" data="http://www.vimeo.com/moogaloop.swf?clip_id=418612&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=01AAEA" height="266" width="400"&gt; &lt;param name="quality" value="best"&gt; &lt;param name="allowfullscreen" value="true"&gt; &lt;param name="scale" value="showAll"&gt; &lt;param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=418612&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=01AAEA"&gt;&lt;/object&gt;&lt;br /&gt;&lt;a href="http://www.vimeo.com/418612/l:embed_418612"&gt;Christmas Tree 2007&lt;/a&gt; from &lt;a href="http://www.vimeo.com/user310962/l:embed_418612"&gt;nathan hubbard&lt;/a&gt; on &lt;a href="http://vimeo.com/l:embed_418612"&gt;Vimeo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you watch closely, you can see some sillyness at the beginning.  Hehe.  Good stuff!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-4057954090439070600?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/4057954090439070600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/12/christmas-tree-decorating-at-high-speed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/4057954090439070600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/4057954090439070600'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/12/christmas-tree-decorating-at-high-speed.html' title='Christmas tree decorating at high speed'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-8096340478728149899</id><published>2007-11-11T23:15:00.001-08:00</published><updated>2007-11-11T23:20:17.053-08:00</updated><title type='text'>Peyton Lost, boooooo hoooooo</title><content type='html'>&lt;img src="http://www.mybrainhurts.com/blog/images/2007/10/peyton_waah.jpg"&gt;&lt;br /&gt;&lt;br /&gt;I don't even like football, but I did tonight.  &gt;:-)  &lt;br /&gt;&lt;br /&gt;Go Chargers!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-8096340478728149899?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/8096340478728149899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/11/peyton-lost-boooooo-hoooooo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8096340478728149899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/8096340478728149899'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/11/peyton-lost-boooooo-hoooooo.html' title='Peyton Lost, boooooo hoooooo'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-1799186007648848817</id><published>2007-11-08T11:48:00.000-08:00</published><updated>2007-11-08T11:50:05.208-08:00</updated><title type='text'>Spiders on Drugs</title><content type='html'>I guess everyone has seen this but me:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://youtube.com/watch?v=sHzdsFiBbFc"&gt;http://youtube.com/watch?v=sHzdsFiBbFc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&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;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-1799186007648848817?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='related' href='http://youtube.com/watch?v=sHzdsFiBbFc' title='Spiders on Drugs'/><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/1799186007648848817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/11/spiders-on-drugs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1799186007648848817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1799186007648848817'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/11/spiders-on-drugs.html' title='Spiders on Drugs'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-2680494649109513229</id><published>2007-07-24T02:52:00.000-07:00</published><updated>2007-07-24T02:59:12.014-07:00</updated><title type='text'>looking at your boot sector</title><content type='html'>Yes yes, I know, sometimes you just get curious about your boot sector.  Your Sysadmin says you'll go to hell if you play with it, and god knows what would happen if you tried to modify it.  But sometimes, when you've been screwing with Lilo and Grub and you can't really remember which one is installed, it's nice to have a peek:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;dd if=/dev/hda of=mbr.img bs=512 count=1 &lt;br /&gt;xxd -g 4 mbr.img&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Where /dev/hda is the drive you want to look at. &lt;br /&gt;&lt;br /&gt;Output should look something like this:&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;-snip-&lt;br /&gt;0000150: 31fffcf3 a51f61ff 26427cbe 7f7de840  1.....a.&amp;B|..}.@&lt;br /&gt;0000160: 00eb0ebe 847de838 00eb06be 8e7de830  .....}.8.....}.0&lt;br /&gt;0000170: 00be937d e82a00eb fe475255 42200047  ...}.*...GRUB .G&lt;br /&gt;0000180: 656f6d00 48617264 20446973 6b005265  eom.Hard Disk.Re&lt;br /&gt;0000190: 61640020 4572726f 7200bb01 00b40ecd  ad. Error.......&lt;br /&gt;00001a0: 10ac3c00 75f4c300 00000000 00000000  ..&lt;.u...........&lt;br /&gt;-snip-&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;Oh no, I've displayed all my most intimate parts for everybody to see.  Oh well...hey, there's Grub.  Cool.  :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-2680494649109513229?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/2680494649109513229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/07/looking-at-your-boot-sector.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/2680494649109513229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/2680494649109513229'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/07/looking-at-your-boot-sector.html' title='looking at your boot sector'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-4662829629468996175</id><published>2007-07-10T22:55:00.000-07:00</published><updated>2007-07-10T23:09:23.511-07:00</updated><title type='text'>1:1 NAT on your Linux/Netfilter Firewall</title><content type='html'>So you want to map a public IP to a private IP behind your Linux (netfilter) based firewall.  Here is the syntax:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;## Standard Stuff ##&lt;br /&gt;echo 1 &gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;iptables --table nat -A POSTROUTING -o eth0 -j SNAT --to $NAT_IP&lt;br /&gt;&lt;br /&gt;## The 1:1 NAT stuff ##&lt;br /&gt;iptables -t nat -A PREROUTING -d $EXTERNAL_IP  \&lt;br /&gt;        -j DNAT --to-destination $INTERNAL_IP&lt;br /&gt;iptables -t nat -A POSTROUTING -s $INTERNAL_IP \&lt;br /&gt;        -j SNAT --to-source $EXTERNAL_IP&lt;br /&gt;iptables -t nat -A POSTROUTING -s $INTERNAL_NET -d $INTERNAL_IP \&lt;br /&gt;        -j SNAT --to-source $NAT_IP&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Where $NAT_IP is the external IP of your firewall.  The last rule is required if you want hosts on your internal net to be able to talk to that external IP as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-4662829629468996175?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/4662829629468996175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/07/11-nat-on-your-linuxnetfilter-firewall.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/4662829629468996175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/4662829629468996175'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/07/11-nat-on-your-linuxnetfilter-firewall.html' title='1:1 NAT on your Linux/Netfilter Firewall'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-3038571413072882829</id><published>2007-06-14T03:00:00.000-07:00</published><updated>2007-06-14T03:03:08.200-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='machdb'/><title type='text'>MachDB</title><content type='html'>After a successful night of coding, I decided to start blogging my development of the MachDB. &lt;br /&gt;&lt;br /&gt;Yay!  First post!  I'll describe it more later.&lt;br /&gt;&lt;br /&gt;(also checking out the cool labels that blogger has now)&lt;br /&gt;&lt;br /&gt;And going to bed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-3038571413072882829?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/3038571413072882829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/06/machdb.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/3038571413072882829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/3038571413072882829'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/06/machdb.html' title='MachDB'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-9169755956264967046</id><published>2007-05-27T01:08:00.000-07:00</published><updated>2007-05-27T04:39:30.956-07:00</updated><title type='text'>Great song: Two Sisters by Fiction Plane</title><content type='html'>&lt;img src="http://www.mybrainhurts.com/blog/images/2007/4/00022842-427250.jpg" align="right" hspace="10" vspace="10" /&gt;Watching Jay Leno this week, I heard a band I wasn't familiar with, &lt;a href="http://en.wikipedia.org/wiki/Fiction_Plane"&gt;Fiction Plane&lt;/a&gt;.   3 talented guys sang a great song called "Two Sisters".  One of the best rock/pop songs I've heard in a long time. And going back to look up the name, I discovered that the &lt;a href="http://www.nbc.com/The_Tonight_Show_with_Jay_Leno/calendar/05212007.shtml"&gt;NBC Jay Leno web site&lt;/a&gt; has a free 160kbps MP3 for download....right above a link to buy it.  :)  Get it right &lt;a href="http://www.nbc.com/The_Tonight_Show_with_Jay_Leno/music/mp3/Fiction_Plane_Two_Sisters.mp3"&gt;here&lt;/a&gt;, before somebody realizes the (what has to be) mistake and takes it down.&lt;br /&gt;&lt;br /&gt;I'm always impressed with bands that can create great music with only a few bodies.  Trivia note: If you &lt;a href="http://images.google.com/images?svnum=10&amp;um=1&amp;amp;hl=en&amp;safe=off&amp;amp;client=firefox-a&amp;rls=org.mozilla%3Aen-US%3Aunofficial&amp;amp;amp;amp;amp;q=fiction+plane&amp;amp;btnG=Search+Images"&gt;look them up&lt;/a&gt;, you may think the lead singer, Joe Sumner, looks familiar.  Sting is his dad.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-9169755956264967046?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/9169755956264967046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/great-song-two-sisters-by-fiction-plane.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/9169755956264967046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/9169755956264967046'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/great-song-two-sisters-by-fiction-plane.html' title='Great song: Two Sisters by Fiction Plane'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-2383399730584869414</id><published>2007-05-26T02:21:00.000-07:00</published><updated>2007-05-26T05:43:15.382-07:00</updated><title type='text'>1080p Sky Timelapse</title><content type='html'>I got a new toy recently.  A &lt;a href="http://www.amazon.com/Canon-TC80N3-Remote-Control-Cameras/dp/B00009XVA3/ref=pd_bbs_sr_1/103-0730095-7686221?ie=UTF8&amp;s=electronics&amp;amp;qid=1180171431&amp;sr=8-1"&gt;Canon TC-80N3&lt;/a&gt;...a programmable remote timer for my DSLR.   I've always been a huge fan of Time Lapse video, especially the clouds moving and flowers blooming. I made one of my own, recorded at full image size and scaled *down* to 1080p for your viewing pleasure.  File is 28MB:  &lt;a href="http://www.mybrainhurts.com/blog/images/2007/4/sky_timelapse_20070509_1080p.mp4"&gt;Mira Mesa Night Sky Timelapse 2007-05-09&lt;/a&gt;.  Right-click &amp;amp; save, then play. Flash preview below:&lt;br /&gt;&lt;br /&gt;&lt;embed src="/flash/mediaplayer.swf" width="720" height="404" allowfullscreen="true" flashvars="&amp;displayheight=404&amp;file=http://www.mybrainhurts.com/blog/images/2007/4/sky_timelapse_20070509_1080p.mp4.ff.flv&amp;height=404&amp;image=http://www.mybrainhurts.com/blog/images/2007/4/night_timelapse_20070509.png&amp;width=720" /&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;Other than seeing the stars move at 450 times normal speed, the neatest part is the planes flying around at the bottom.  They almost look like UFO's. You can see the fog roll in later in the shots as the camera gets a layer of dew on the lens.  The exposure was 10sec each, taken every 30 seconds and playback is at 15fps.&lt;br /&gt;&lt;br /&gt;I'll be making more of these and posting them to my blog as I have time.  Tell me what you think.&lt;br /&gt;&lt;br /&gt;Other timelapse posts:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mybrainhurts.com/blog/2006/04/blogercize-my-time-lapse.html"&gt;Blogerize My Time Lapse&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mybrainhurts.com/blog/2006/04/6-hours-of-friday.html"&gt;6 hours of Friday&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mybrainhurts.com/blog/2006/04/more-timelapses.html"&gt;More Timelapses&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mybrainhurts.com/blog/2006/11/pumpkins.html"&gt;Pumpkins&lt;/a&gt;&lt;br /&gt;&lt;a href="http://s3.vmix.com/maint.html"&gt;Flight of the Servers/VMIX Down Page&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-2383399730584869414?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/2383399730584869414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/1080p-sky-timelapse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/2383399730584869414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/2383399730584869414'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/1080p-sky-timelapse.html' title='1080p Sky Timelapse'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-2032106558016534137</id><published>2007-05-25T13:59:00.000-07:00</published><updated>2007-05-26T03:19:04.035-07:00</updated><title type='text'>10 News video on a Mac (and VMIX on TV!)</title><content type='html'>&lt;a href="http://mfile.akamai.com/12922/wmv/vod.ibsys.com/2007/0511/13299238.200k.asx"&gt;&lt;img src="http://www.mybrainhurts.com/blog/images/2007/4/VMIX%20on%20TV.png" align="right" hspace="10" vspace="10" /&gt;&lt;/a&gt;My company, &lt;a href="http://www.vmix.com/"&gt;VMIX&lt;/a&gt; was recently on the local San Diego ABC affiliate, 10 News.  I was &lt;a href="http://mfile.akamai.com/12922/wmv/vod.ibsys.com/2007/0511/13299238.200k.asx"&gt;actually in a few of the shots&lt;/a&gt; and when looking for the video, found that the &lt;a href="http://www.10news.com/"&gt;10news.com&lt;/a&gt; website's windows media video player didn't work on my Mac.  So I created a quick hack to return the URL to the .asx file so I can play it with &lt;a href="http://www.apple.com/downloads/macosx/video/vlcmediaplayer.html"&gt;VLC&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Search for the story and pull up the video detail page.  The URL should be something like this:  &lt;a href="http://www.10news.com/video/13299238/detail.html"&gt;http://www.10news.com/video/13299238/detail.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Open up "Terminal" on your mac and paste this command, replacing the first URL with the URL of your video detail page:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;curl http://www.10news.com/video/13299238/detail.html -s \&lt;br /&gt;| grep 200k \&lt;br /&gt;| awk -F"'" '{print "http://mfile.akamai.com/12922/wmv/vod.ibsys.com"$2}' \&lt;br /&gt;| sed 's/wmv$/asx/g'&lt;/tt&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The result should be something like this:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;http://mfile.akamai.com/12922/wmv/vod.ibsys.com/2007/0511/13299238.200k.asx&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Which you should be able to play in &lt;a href="http://www.apple.com/downloads/macosx/video/vlcmediaplayer.html"&gt;VLC&lt;/a&gt;. You can also include that URL in your blog to quote the story.  Hit &lt;a href="http://mfile.akamai.com/12922/wmv/vod.ibsys.com/2007/0511/13299238.200k.asx"&gt;this link&lt;/a&gt; to see the video coverage and my geeky mug at the keyboard.  Video clip courtesy of 10news.com.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-2032106558016534137?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/2032106558016534137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/10-news-video-on-mac-and-vmix-on-tv.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/2032106558016534137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/2032106558016534137'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/10-news-video-on-mac-and-vmix-on-tv.html' title='10 News video on a Mac (and VMIX on TV!)'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-1806461215828070386</id><published>2007-05-22T13:58:00.000-07:00</published><updated>2007-05-26T06:37:29.845-07:00</updated><title type='text'>Removing the Stank from your Shoes</title><content type='html'>I was explaining this to a friend that suggested I blog it.  I try to do it every 6 months with my shoes if they need or not.  &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Put shoes in zip lock bag or a double layer of tied up plastic grocery bags&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Put in the freezer overnight (I do 2 days)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If they still stink, pour baking soda inside the shoe and repeat&lt;/li&gt;&lt;li&gt;Let them thaw out in the bag.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;The reason this works:  the bacteria inside your shoe that produce odor thrive in a warm moist environment.  Freeze them and it will kill them out.  The baking soda will absorb the smell, if it remains after the bacteria die.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-1806461215828070386?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/1806461215828070386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/removing-stank-from-you-shoes.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1806461215828070386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1806461215828070386'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/removing-stank-from-you-shoes.html' title='Removing the Stank from your Shoes'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426279.post-1656058410536200915</id><published>2007-05-19T23:35:00.000-07:00</published><updated>2007-05-20T02:05:09.991-07:00</updated><title type='text'>UNIX shell commands for job notifications</title><content type='html'>Ever spawn off a big job and immediately realize it'd have been great to get a notification when it's done?  If it still has hold of your terminal, you could blindly type the next command and hope it works.  But if it's forked into the background, that won't even work.  Here's how to do it:&lt;br /&gt;&lt;br /&gt;Find the process ID of your job.  In my case it was 22603:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;$ ps auxw | grep batch_process&lt;br /&gt;n8foo   22603  0.0  0.1  8044 2076 pts/18   S+   01:24   0:00 batch_process -bg &lt;br /&gt;&lt;br /&gt;$ ( while ps 22603; do sleep 60 ; done ; date | mail you@yourcompany.com -s "process done"  ) &amp;&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;Now I can log out and wait to get a mail on it.  &lt;br /&gt;&lt;br /&gt;The same thing works when waiting for a machine to come back up:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;until ping -c 2 hostname.domain.com ; do sleep 10 ; done ; date | mail you@yourcompany.com -s "hostname back up" &lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Alter the number of seconds of sleep for higher resolution on the checks.  The above will send 2 ping checks every 10 seconds.  Close enough for rock and roll.&lt;br /&gt;&lt;br /&gt;I learned something just now while double-checking my ping syntax:  "&lt;tt&gt;-a     Audible ping.&lt;/tt&gt;"  Yes, ping will bonk your shell on each packet return.  Whoah cool!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/6426279-1656058410536200915?l=www.mybrainhurts.com%2Fblog'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/1656058410536200915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/unix-shell-commands-for-job.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1656058410536200915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426279/posts/default/1656058410536200915'/><link rel='alternate' type='text/html' href='http://www.mybrainhurts.com/blog/2007/05/unix-shell-commands-for-job.html' title='UNIX shell commands for job notifications'/><author><name>Nathan</name><uri>http://www.blogger.com/profile/03714591529204612877</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>