<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Spiffed&apos;s Computing Notebook</title>
<link>http://spiffie.org/computing/</link>
<description></description>
<copyright>Copyright 2009</copyright>
<lastBuildDate>Tue, 24 Feb 2009 00:14:21 -0500</lastBuildDate>
<generator>http://www.movabletype.org/?v=4.23-en</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 


<item>
<title>The cord for PowerEdge 6650, Proliant DL580 G2, and other high powered devies.</title>
<description><![CDATA[<p>Almost all servers, desktops, UPSs, and other computing hardware uses an IEC C14 socket (which mates with an IEC C13 plug) (like the ones below).</p>

<p><img src="/computing/archives/2009/02/24/200px-IEC60320_C14.jpg" alt="" title="" /> <img src="/computing/archives/2009/02/24/200px-IEC60320_C13.jpg" alt="" title="" /></p>

<p>Larger devices which draw more current, however, use a C20 socket (and C19 plug). They look like an angry slit-eyed C19 plug, they&#8217;re also square (see below).</p>

<p><img src="/computing/archives/2009/02/24/PXO596_400px.jpg" alt="" title="" /> <img src="/computing/archives/2009/02/24/2007731144253762.jpg" alt="" title="" /></p>

<p>Almost certainly, you&#8217;re now thinking the hardware manufacturer hates you. If this is used equipment, the cord is never included, and if it&#8217;s new equipment, the cord is usually a C20 to C19 cord - and you likely don&#8217;t have a C20 outlet handy.</p>

<p><ul><li>If you do have C20 outlets in your PDU or UPS available, you want a (or more likely two) C20 to C19 cord(s) like the one below.<br>
<a href="http://www.infinitecables.com/pop/cb_pw-125.htm"><img src="/computing/archives/2009/02/24/cb_pw-125.jpg" alt="" title="" /></a>
<li>If you don&#8217;t have a C20 outlet available, and your equipment draws less than 15 amps, you likely want either a NEMA 5-15P to C19 or C14 to C19 cord<br>
<a href="http://www.infinitecables.com/pop/cb_pw-121.htm"><img src="/computing/archives/2009/02/24/cb_pw-121.jpg" alt="" title="" /></a> <a href="http://www.infinitecables.com/pop/cb_pw-120.htm"><img src="/computing/archives/2009/02/24/cb_pw-120.jpg" alt="" title="" /></a>
<li>If you&#8217;re crazy, you can swap out the C20 for C14 sockets. They generally have the same tooling. This is of course wildly out of spec.
<li>If you&#8217;re equipment draws more than 15 amps, and you don&#8217;t have C20 outlets handy, you likely want some form of &#8216;twist-lock&#8217; style NEMA plug (like an L5 or L6 or maybe, but not likely, an L7) to C19 cord.
<li>If you&#8217;re equipment draws more than 15 amps, and you don&#8217;t have C20 outlets, and you don&#8217;t have NEMA &#8216;twist-lock&#8217; outlets, then you maybe want a NEMA 5-20R or TT-30 to C19 cord.
<li>Finally, if you&#8217;re equipment draws more than 15 amps, and you don&#8217;t have C20 outlets, and you don&#8217;t have NEMA &#8216;twist-lock&#8217; outlets, and you don&#8217;t have either of the (barely) normal non-locking NEMA connectors, you likely need an electrician. Either you have odd high-amperage outlets and need new outlets or an adapter or you have no high-amperage outlets and you either need new outlets or a new circuit.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2009/02/the_cord_for_po.html</link>
<guid>http://spiffie.org/computing/archives/2009/02/the_cord_for_po.html</guid>
<category>Hardware</category>
<pubDate>Tue, 24 Feb 2009 00:14:21 -0500</pubDate>
</item>

<item>
<title>Fixing bad MSS discovery across iptables based firewalls</title>
<description><![CDATA[<p>If you have an <code>iptables</code> based firewall with differing MTUs on it's public and private interfaces, you may need to use <code>iptables</code> <code>TCPMSS</code> target to force proper MSS discovery.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2009/02/fixing_bad_mss.html</link>
<guid>http://spiffie.org/computing/archives/2009/02/fixing_bad_mss.html</guid>
<category>Linux</category>
<pubDate>Tue, 17 Feb 2009 21:16:48 -0500</pubDate>
</item>

<item>
<title>Use molly-guard and stop rebooting the wrong server</title>
<description><![CDATA[<p><a href="http://packages.debian.org/etch-backports/molly-guard">Molly-guard</a> is the unix admin analog to Gmail's <a href="http://gmailblog.blogspot.com/2008/10/new-in-labs-stop-sending-mail-you-later.html">mail goggles</a>.</p>

<p>Named after the <a href="http://catb.org/jargon/html/M/molly-guard.html">physical molly-guard</a>, the molly-guard command wraps various commands (by default the halt/reboot/shutdown/poweroff group) and performs various actions before calling them (by default, asking you which host this is). <em>It's a life saver when you've nearly powered down the production database server in a $250/incident datacenter 2000km away thinking it was the print server in the other room.</em></p>
]]></description>
<link>http://spiffie.org/computing/archives/2009/02/use_molly-guard.html</link>
<guid>http://spiffie.org/computing/archives/2009/02/use_molly-guard.html</guid>
<category>Linux</category>
<pubDate>Tue, 10 Feb 2009 23:28:41 -0500</pubDate>
</item>

<item>
<title>Removing EXIF data with find and jhead</title>
<description><![CDATA[<p>Let&#8217;s imagine you&#8217;ve got a load of pictures on a *nix box somewhere, and you&#8217;d prefer they didn&#8217;t have <a href="http://en.wikipedia.org/wiki/Exchangeable_image_file_format">EXIF</a> data attached? You&#8217;d need a way to find all the jpeg files and a way to strip their EXIF data. Thankfully, both tasks are easily solved, one with find and one with <a href="http://www.sentex.net/~mwandel/jhead/">jhead</a>.</p>

<h3>Using jhead</h3>

<p>A look at the <a href="http://www.sentex.net/~mwandel/jhead/">jhead page</a> shows the <code>--purejpg</code> argument will strip any EXIF data.</p>

<h3>Building the find query</h3>

<p>We need to find files who&#8217;s name ends in <code>.jpg</code>, <code>.jpeg</code>, <code>.JPG</code>, or <code>.JPEG</code> in a given directory tree. A quick look at the <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?find">find man page</a> shows us the <code>-iregex</code> parameter accepts a case insensitive regexp. <code>.*\.jpe?g$</code> looks for the following parameters:</p>

<ul>
<li><code>.*</code> - any number of characters</li>
<li><code>.jp</code> - the literal characters <code>.</code> <code>j</code> and <code>p</code></li>
<li><code>e?</code> - one or no <code>e</code> characters.</li>
<li><code>g</code> - a litteral <code>g</code> character</li>
<li><code>$</code> - and these must all be at the very end of the string</li>
</ul>

<p>The parameter <code>-exec</code> will execute a command on any matching files, substituting the actual filename for <code>{}</code>, and we must end the command with a <code>;</code>.</p>

<h3>The final command</h3>

<p><code>find . -iregex '.*\.jpe?g$' -exec jhead -purejpg '{}' \;</code></p>

<p>This will find any file with a .jpg or .jpeg extension (in any case) in the current directory (recursively) and strip it&#8217;s exif data.</p>

<h3>One step further</h3>

<p>Maybe you didn&#8217;t name all your JPEG files <code>something.jpg</code>. Maybe you named them foo_picture; how ever will you find them? Enter the unix &#8216;file&#8217; command, it reads a files contents and looks for keys to it&#8217;s file type. We&#8217;ll use it here to build a command that searches the tree looking for files that look like binary jpeg files.</p>

<ul>
<li><code>find . -type f -exec file -i -F \0 '{}' \;</code> - Find actual files (<code>-type f</code>) and execute the file command on them, but set file to seperate it&#8217;s data with NULLs (since you&#8217;re unlikely to have a NULL in your filename) and output the results as a mime type (because it&#8217;s easier to parse later).</li>
<li><code>awk -F\0 '$2 == " image/jpeg" {printf "%s\0",$1}'</code> - use awk to check the type feild for the jpeg mime type, then only print the file path (followed by a NULL).</li>
<li><code>xargs -0 -n 1 jhead -purejpg</code> - use xargs to split the input on NULLs and feed one path at a time to the jhead command.</li>
</ul>

<p>Putting it all togeather, we get <code>find . -type f -exec file -i -F \0 '{}' \;|awk -F\0 '$2 == " image/jpeg" {printf "%s\0",$1}'|xargs -0 -n 1 jhead -purejpg</code></p>

<p>This is, of course, much slower than the pattern matching find command above.</p>

<pre><code> time find ./public_html/ -type f -exec file -i -F \0 '{}' \; \
    |awk -F\0 '$2 == " image/jpeg" {printf "%s\0",$1}'|xargs -0 -n 1 jhead -purejpg
 real    0m21.299s
 user    0m4.214s
 sys     0m16.290s

 time find ./public_html/ -iregex '.*\.jpe?g$' -exec jhead -purejpg '{}' \;
 real    0m7.819s
 user    0m0.548s
 sys     0m2.565s
</code></pre>

<p>And that&#8217;s after the entire directory tree has been pulled into memory cache!</p>
]]></description>
<link>http://spiffie.org/computing/archives/2008/08/removing_exif_d.html</link>
<guid>http://spiffie.org/computing/archives/2008/08/removing_exif_d.html</guid>
<category>Unix</category>
<pubDate>Mon, 25 Aug 2008 14:33:04 -0500</pubDate>
</item>

<item>
<title>Unfreezing Screen</title>
<description><![CDATA[<p>I&#8217;m sure many people have done this: typed a command, then realized they&#8217;ll need root, so they hit <tt>ctrl-a</tt> for the beginning of the line, then started typing <tt>sudo</tt>. And this works wonderfully, unless your in a screen session, in which case it locks up completely.</p>

<p>From the <a href="http://www.manpagez.com/man/1/screen/">screen manpage</a> we see that <tt>ctrl-a</tt> puts screen into command mode, and the <tt>s</tt> of <tt>sudo</tt> sends an &#8216;xoff&#8217; to the terminal.</p>

<p>What does xoff do? It&#8217;s a control signal in xon/xoff handshaking that says &#8216;stop sending data to me&#8217;, so the machine stops sending your terminal data.</p>

<p>To get your screen session back, send <tt>ctrl-a</tt> then <tt>q</tt>. This sends the matching xon. Xon ofcourse says &#8216;go ahead, send data, I&#8217;m ready&#8217;.</p>

<p>To avoid the issue in the first place, use <tt>ctrl-a</tt> followed by <tt>a</tt> to jump to the beginning of the line.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2008/08/unfreezing_scre.html</link>
<guid>http://spiffie.org/computing/archives/2008/08/unfreezing_scre.html</guid>
<category>Unix</category>
<pubDate>Wed, 20 Aug 2008 10:57:13 -0500</pubDate>
</item>

<item>
<title>Printing Canada Post CN22 Labels</title>
<description><![CDATA[<p>If you do alot of cross-border shipping, you no doubt have a whack of CN22 customs forms to fill-out everyday. This template should make your life just a little easier.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2008/03/printing_canada.html</link>
<guid>http://spiffie.org/computing/archives/2008/03/printing_canada.html</guid>
<category>Online Sales</category>
<pubDate>Tue, 25 Mar 2008 14:27:04 -0500</pubDate>
</item>

<item>
<title>DIY Antistatic wrap</title>
<description><![CDATA[<p><script src="/script/flickrnotes.php?2328424099"></script></p>

<p>Some people are more resourceful then others. I received these as a return, complete with tin-foil/aluminium-foil to fight static (or ward off mind rays?).</p>
]]></description>
<link>http://spiffie.org/computing/archives/2008/03/diy_antistatic.html</link>
<guid>http://spiffie.org/computing/archives/2008/03/diy_antistatic.html</guid>
<category>Hardware</category>
<pubDate>Wed, 12 Mar 2008 11:13:55 -0500</pubDate>
</item>

<item>
<title>Packaging and Shipping eBay Items.</title>
<description><![CDATA[<p><script src="/script/flickrnotes.php?2308379336"></script></p>

<p>This is a short tutorial on going from PayPal payment emails to packaged products.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2008/03/packaging_and_s.html</link>
<guid>http://spiffie.org/computing/archives/2008/03/packaging_and_s.html</guid>
<category>Online Sales</category>
<pubDate>Mon, 03 Mar 2008 14:28:45 -0500</pubDate>
</item>

<item>
<title>Markdown and flickrnotes</title>
<description><![CDATA[<p><a href="http://daringfireball.net/projects/markdown/">Markdown</a> makes writing in Movable Type painless and <a href="http://www.ladyada.net/rant/2007/02/you-have-defeated-ie6-you-gain-12-exp-and-4-gold/">flickrnotes</a> makes embedding flickr images relatively easy, but together, they make embedding flickr images completely painless.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2008/02/markdown_and_fl.html</link>
<guid>http://spiffie.org/computing/archives/2008/02/markdown_and_fl.html</guid>
<category>Software Problems</category>
<pubDate>Tue, 26 Feb 2008 13:30:31 -0500</pubDate>
</item>

<item>
<title>Installing Windows 3.1 in VMWare</title>
<description><![CDATA[<p>If you plan on installing Windows 3.1 or even just DOS in VMWare, you'll need a few extra things. I have prepared a <a href="http://spiffie.org/computing/archives/2007/09/01/VMWare4Dos.zip">floppy image containing utilities for DOS in VMWare</a>.</p>

<p>It contains the following:</p>

<ul>
<li><code>DOSIDLE.EXE</code> - A small TSR utility that puts the processor into idle mode; without this, your VM will use 100% of the host CPU, all the time. Retreived from <a href="http://www.jradconsulting.com/download/index.html">http://www.jradconsulting.com/download/index.html</a> as <code>dosidle210.zip</code>. (c) Marton Balog and widely distributed by VMWare.</li>
<li><code>CDROM</code> directory - Contains a setup application for Hitachi IDE CDROM drives, this also conveniently supports the VMWare emulated CDROM drive (and likely any other ATAPI drive).</li>
<li><code>PCNET</code> directory - AMD's DOS/NDIS2 driver files for the PCNet family of network interfaces. This will come in handy if you plan to install Windows 3.x. Simply point the installer to these files.</li>
</ul>
]]></description>
<link>http://spiffie.org/computing/archives/2007/09/installing_wind.html</link>
<guid>http://spiffie.org/computing/archives/2007/09/installing_wind.html</guid>
<category>Software Problems</category>
<pubDate>Sat, 01 Sep 2007 00:39:54 -0500</pubDate>
</item>

<item>
<title>Via Velocity VT6122 Unstable in Linux</title>
<description><![CDATA[<p>After much experimenting in Debian Etch and Slackware 11, with various 2.6.x kernels up to and including 2.6.22, the VT6122 gigabit ethernet chipset, combined with either the built in <code>via_velocity</code> driver or the via supplied <code>velocityget</code> driver, results in an unstable link under load.</p>

<p>When the network is under heavy use (copying a file over samba/netatalk counts), the following appears multiple times in syslog indicating the continual reset of the network.</p>

<pre><code>Aug 27 14:31:13 Enterprise kernel: eth0: failed to detect cable link
Aug 27 14:31:16 Enterprise kernel: eth0: Link auto-negotiation speed 1000M bps full duplex
</code></pre>

<p>Based on this, I do not recomend the use of Velocity based cards in Linux computers.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2007/08/vt6122_unstable_linux.html</link>
<guid>http://spiffie.org/computing/archives/2007/08/vt6122_unstable_linux.html</guid>
<category>Linux</category>
<pubDate>Mon, 27 Aug 2007 18:53:01 -0500</pubDate>
</item>

<item>
<title>Via Velocity velocityget module with kernel 2.6.22</title>
<description><![CDATA[<p>The latest <code>velocityget</code> Via Velocity driver does not compile under kernel 2.6.22. </p>
]]></description>
<link>http://spiffie.org/computing/archives/2007/08/velocityget_2622.html</link>
<guid>http://spiffie.org/computing/archives/2007/08/velocityget_2622.html</guid>
<category>Linux</category>
<pubDate>Sun, 26 Aug 2007 20:05:57 -0500</pubDate>
</item>

<item>
<title>Install VMWare ESX Server 3 in VMWare Workstation</title>
<description><![CDATA[<p><img alt="VMWare Virtual Infrastructure ESX Server" src="http://spiffie.org/computing/archives/2007/07/21/vi_esx.gif" width="104" height="49" align="right" />
If you install <a href="http://vmware.com/products/vi/esx/">ESX Server 3</a> into a <a href="http://vmware.com/products/desktop/workstation.html">VMWare Workstation</a> virtual machine, you&#8217;ll find it installs perfectly fine, but the VMWare network adapter is not supported by ESX Server. Thankfully, the adapter is modeled after the AMD PCNet32 adapter and VMWare server is based on Linux.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2007/07/install_vmware.html</link>
<guid>http://spiffie.org/computing/archives/2007/07/install_vmware.html</guid>
<category>Software Problems</category>
<pubDate>Sat, 21 Jul 2007 00:44:38 -0500</pubDate>
</item>

<item>
<title>o2.c</title>
<description>o2.c is an ethernet &amp; ip packet grabber for linux adapted from Sean Walton&apos;s snooper.c.</description>
<link>http://spiffie.org/computing/archives/2006/12/o2c.html</link>
<guid>http://spiffie.org/computing/archives/2006/12/o2c.html</guid>
<category>Code</category>
<pubDate>Sat, 23 Dec 2006 15:16:33 -0500</pubDate>
</item>

<item>
<title>Shared-libary build fails on AMD_64</title>
<description><![CDATA[<p>While trying to link against a shared library I received the following error: <code>relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC</code>.</p>

<p>The solution is quite simple, in the <code>Makefile</code> of the offending library, simply add <code>-fPic</code> to the end of the <code>CFLAGS</code> line. Finally, rebuild and reinstall the library (<code>make clean &amp;&amp; make &amp;&amp; make install</code>).</p>

<p>I am sure there are cleaner ways (like passing the extra CFLAGS to configure), but it works for one off jobs.</p>
]]></description>
<link>http://spiffie.org/computing/archives/2006/02/sharedlibary_bu.html</link>
<guid>http://spiffie.org/computing/archives/2006/02/sharedlibary_bu.html</guid>
<category>OpenBSD</category>
<pubDate>Fri, 24 Feb 2006 22:56:50 -0500</pubDate>
</item>


</channel>
</rss>