<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Patshead.com Blog</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/" />
    <link rel="self" type="application/atom+xml" href="http://blog.patshead.com/atom.xml" />
    <id>tag:blog.patshead.com,2010-09-01://2</id>
    <updated>2012-01-24T19:11:43Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.12</generator>

<entry>
    <title>Using and Customizing zsh-syntax-highlighting With oh-my-zsh</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2012/01/using-and-customizing-zsh-syntax-highlighting-with-oh-my-zsh.html" />
    <id>tag:blog.patshead.com,2012://2.86</id>

    <published>2012-01-24T21:00:00Z</published>
    <updated>2012-01-24T19:11:43Z</updated>

    <summary> I recently read about this nifty new real-time syntax highlighter: zsh-syntax-highlighting. It looked like it would be pretty handy so I decided to try it out for a couple of weeks. It is a bit too colorful out of...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Shell" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ohmyzsh" label="oh-my-zsh" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="zsh" label="zsh" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="zshsyntaxhighlighting" label="zsh-syntax-highlighting" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p><img src="/Assets/zsh-syntax-highlighting.png"></p>

<p>I recently read about this nifty new real-time syntax highlighter:  <a href="https://github.com/zsh-users/zsh-syntax-highlighting">zsh-syntax-highlighting</a>.  It looked like it would be pretty handy so I decided to try it out for a couple of weeks.</p>

<h2>It is a bit too colorful out of the box</h2>

<p>Too many things are highlighted by default for my tastes.  Every correctly typed command, every file name, and every globbing character is highlighted in one way or another.  I was especially unhappy with the underlined path names.</p>

<h2>Some highlighting is really awesome</h2>

<p>I may not like all the extra noise but there are a few things that I'm finding to be very useful.  Highlighting a misspelled command in red is very nice.  It is nice to catch typos before trying to execute a command.</p>

<p>Highlighting reserved words should be pretty helpful.  I use one-liner <code>for</code> loops all the time but I'm very good at leaving out the <code>do</code>.  Highlighting makes that slightly more obvious but I sure with the <code>done</code> would highlight red if it didn't match a <code>do</code>.  It does match pairs of brackets, though, so maybe I can get in the habit of using those instead of old bash-isms...</p>

<p>It also does a good job of quote highlighting.  That will probably help me catch mismatched and unescaped quotes pretty easy.</p>

<h2>Customizing colors when using <a href="https://github.com/robbyrussell/oh-my-zsh">oh-my-zsh</a></h2>

<p>I had a bit of trouble here.  I tried setting the color variables in a file in my <code>~/.oh-my-zsh/custom</code> directory while loading <a href="https://github.com/zsh-users/zsh-syntax-highlighting">zsh-syntax-highlighting</a> as a plugin from my <code>~/.oh-my-zsh/plugins</code> directory.  When I did this it was acting like the colors were not already defined.  I thought this was a bit strange because <code>oh-my-zsh</code> loads plugins before it runs anything in <code>~/.oh-my-zsh/custom</code>.</p>

<p>I didn't investigate this very heavily.  I just moved <a href="https://github.com/zsh-users/zsh-syntax-highlighting">zsh-syntax-highlighting</a> into my <code>custom</code> directory and loaded it manually.</p>

<p>Here's what my <a href="https://github.com/zsh-users/zsh-syntax-highlighting">zsh-syntax-highlighting</a> configuration looks like:</p>

<pre><code>ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)

source $ZSH/custom/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

ZSH_HIGHLIGHT_STYLES[default]=none
ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=red,bold
ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=green
ZSH_HIGHLIGHT_STYLES[alias]=none
ZSH_HIGHLIGHT_STYLES[builtin]=none
ZSH_HIGHLIGHT_STYLES[function]=none
ZSH_HIGHLIGHT_STYLES[command]=none
ZSH_HIGHLIGHT_STYLES[precommand]=none
ZSH_HIGHLIGHT_STYLES[commandseparator]=none
ZSH_HIGHLIGHT_STYLES[hashed-command]=none
ZSH_HIGHLIGHT_STYLES[path]=none
ZSH_HIGHLIGHT_STYLES[globbing]=none
ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=blue
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=none
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=none
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=none
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=yellow
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=yellow
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=cyan
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=cyan
ZSH_HIGHLIGHT_STYLES[assign]=none
</code></pre>

<p>Most of what I did was remove colors.   </p>
]]>
        

    </content>
</entry>

<entry>
    <title>A Year of Native Linux Indie Games on My Arcade Cabinet - 2011</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2012/01/a-year-of-native-linux-indie-games-on-my-arcade-cabinet---2011.html" />
    <id>tag:blog.patshead.com,2012://2.85</id>

    <published>2012-01-06T21:00:00Z</published>
    <updated>2012-01-24T19:36:00Z</updated>

    <summary>Last January, or maybe a little while before then, I decided to set a small goal for myself and my arcade cabinet. I wanted to buy at least one native game for the arcade table each month. I&apos;ve written about...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Arcade Games" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="arcadecabinet" label="arcade cabinet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bittriprunner" label="bit.trip runner" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blocksthatmatter" label="blocks that matter" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="braid" label="braid" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cavestory" label="cave story" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cortexcommand" label="cortex command" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="droidassault" label="droid assault" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gish" label="gish" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="indiegames" label="indie games" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="irukandji" label="irukandji" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jamestown" label="jamestown" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mactabilis" label="mactabilis" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="scoregasm" label="scoregasm" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="shank" label="shank" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="supermeatboy" label="super meat boy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="synso" label="synso" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="thebindingofisaac" label="the binding of isaac" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="titanattacks" label="titan attacks" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ultratron" label="ultratron" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="voxatron" label="voxatron" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vvvvvv" label="vvvvvv" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wartwat" label="war twat" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>Last January, or maybe a little while before then, I decided to set a small goal for myself and <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">my arcade cabinet</a>.  I wanted to buy at least one <a href="http://blog.patshead.com/2011/02/native-linux-games-for-an-arcade-cabinet-rrootage-noiz2sa-torus-troopers-and-more.html">native game for the arcade table</a> each month.  </p>

<p>I've written about some of these games already, but I haven't managed to get to  all of them yet.  I figured that since it has been about a year since I set my goal that it might be a good time to look back over the last twelve months or so and see how I made out.</p>

<div class="images">
<img src="/Assets/BlocksThatMatter1.jpg">
<img src="/Assets/CaveStory1.png">
<img src="/Assets/Mactabilis1.jpg">
<img src="/Assets/SYNSOCE2.jpg">
<img src="/Assets/WarTwat2.jpg">
<img src="/Assets/voxatron.jpg">
</div>

<h2>The list of games, nearly in order of purchase</h2>

<ul>
<li>Irukandji (blog, <a href="http://www.charliesgames.com/wordpress/?page_id=11">home</a>)</li>
<li>Titan Attacks (<a href="http://blog.patshead.com/2011/01/native-linux-games-for-an-arcade-cabinet-playing-titan-attacks-without-a-mouse.html">blog</a>, <a href="http://www.puppygames.net/titan-attacks/">home</a>)</li>
<li>Braid (<a href="http://blog.patshead.com/2011/01/native-linux-games-for-an-arcade-cabinet-the-humble-indie-bundles.html">blog</a>, <a href="http://braid-game.com/">home</a>)</li>
<li>Cortex Command (<a href="http://blog.patshead.com/2011/01/native-linux-games-for-an-arcade-cabinet-the-humble-indie-bundles.html">blog</a>, <a href="http://www.datarealms.com/">home</a>)</li>
<li>Gish (<a href="http://blog.patshead.com/2011/01/native-linux-games-for-an-arcade-cabinet-the-humble-indie-bundles.html">blog</a>, <a href="http://www.chroniclogic.com/gish.htm">home</a>)</li>
<li>The Bundle of Wrong (SYNSO, War Twat, and friends) (<a href="http://blog.patshead.com/2011/07/not-quite-native-linux-games-for-an-arcade-cabinet-the-bundle-of-wrong.html">blog</a>, <a href="http://bagfullofwrong.co.uk/bagfullofwords/whats-in-bundle-of-wrong/">home</a>)</li>
<li>Mactabilis (<a href="http://blog.patshead.com/2011/07/not-quite-native-linux-games-for-an-arcade-cabinet-mactabilis.html">blog</a>, <a href="http://www.blazingbitgames.com/en/mactabilis/">home</a>)</li>
<li>VVVVVV (blog, <a href="http://thelettervsixtim.es/">home</a>)</li>
<li>And Yet It Moves (blog, <a href="http://www.andyetitmoves.net/">home</a>)</li>
<li>Voxatron (<a href="http://blog.patshead.com/2011/10/native-linux-games-for-an-arcade-cabinet-voxatron.html">blog</a>, <a href="http://www.lexaloffle.com/voxatron.php">home</a>)</li>
<li>Blocks That Matter (<a href="http://blog.patshead.com/2011/11/native-linux-games-for-an-arcade-cabinet-blocks-that-matter.html">blog</a>, <a href="http://www.swingswingsubmarine.com/games/blocks-that-matter/">home</a>)</li>
</ul>

<p>There's also a few games that I'm pretty excited about, but I'm traveling right now it will be a while before I can install them on the arcade cabinet.  I'm hopeful that they'll all fit in very nicely there:</p>

<ul>
<li>Super Meat Boy (blog, <a href="http://supermeatboy.com/">home</a>)</li>
<li>Jamestown (blog, <a href="http://www.finalformgames.com/jamestown/">home</a>)</li>
<li>Bit.Trip Runner (blog, <a href="http://bittripgame.com/bittrip-runner.html">home</a>)</li>
<li>Shank (blog, <a href="http://www.shankgame.com/">home</a>)</li>
<li>Cave Story+ (<a href="http://blog.patshead.com/2011/04/native-linux-games-for-an-arcade-cabinet-cave-story.html">blog</a>, <a href="http://nicalis.com/games.php?game=cavestory">home</a>)</li>
</ul>

<p>If my arcade table happened to have a different controller layout, then I'd be able to add a few more games to the list:</p>

<ul>
<li>Droid Assault (blog, <a href="http://www.puppygames.net/droid-assault/">home</a>)</li>
<li>Ultratron (blog, <a href="http://www.puppygames.net/ultratron/">home</a>)</li>
<li>Scoregasm (blog, <a href="http://www.scoregasm-game.com/">home</a>)</li>
<li>The Binding of Isaac (blog, <a href="http://store.steampowered.com/app/113200/">home</a>)</li>
</ul>

<p>Those are just the handful of twin stick shooters that I already own, and they would all be playable if I had built an upright arcade cabinet.</p>

<h2>Are bundles considered cheating?</h2>

<p>I've listed over 16 indie games I purchased for the arcade table during 2011.  The majority of them were part of various <a href="http://www.humblebundle.com/">Humble Bundles</a>.  If I'm counting actual individual transactions then the count is closer to eight.  </p>

<p>At least two of the <a href="http://www.humblebundle.com/">Humble Bundles</a> that I bought didn't include any games that I could use on the arcade cabinet and most of them came with duplicates...  So I'm just going to split the difference and say that I did reasonably well last year.</p>

<h2>Plans and hopes for 2012</h2>

<p>The last couples games I was waiting patiently for were Super Meat Boy and Voxatron.  I don't really have any specific games in mind that I'm waiting for next year.</p>

<p>I'd really like to get caught up with writing about the rest of last year's games.  I'm already at least a half dozen games behind.  I'll end up a full year behind by 2013 if I don't work harder!</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Native Linux Games for an Arcade Cabinet: Blocks That Matter</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/11/native-linux-games-for-an-arcade-cabinet-blocks-that-matter.html" />
    <id>tag:blog.patshead.com,2011://2.84</id>

    <published>2011-11-12T21:00:00Z</published>
    <updated>2012-01-24T19:38:08Z</updated>

    <summary> Another game from the Humble Voxatron Debut, this is an exciting bundle for my arcade cabinet! There are so many great games that fit quite well on an arcade cabinet: Voxatron, Gish, Blocks that Matter, and Jasper&apos;s Journey. Blocks...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Arcade Games" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="arcadecabinet" label="arcade cabinet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blocksthatmatter" label="blocks that matter" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="humblebundle" label="humble bundle" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p><img src="/Assets/BlocksThatMatter1.jpg"></p>

<p>Another game from the <a href="http://www.humblebundle.com">Humble Voxatron Debut</a>, this is an exciting bundle for <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">my arcade cabinet</a>!  There are so many great games that fit quite well on an arcade cabinet:  <a href="http://www.lexaloffle.com/voxatron.php">Voxatron</a>, <a href="http://blog.patshead.com/2011/01/native-linux-games-for-an-arcade-cabinet-the-humble-indie-bundles.html">Gish</a>, <a href="http://www.swingswingsubmarine.com/games/blocks-that-matter/">Blocks that Matter</a>, and <a href="http://www.lexaloffle.com/jasper.php">Jasper's Journey</a>.</p>

<p><img src="/Assets/BlocksThatMatter2.jpg"></p>

<h2>Blocks That Matter</h2>

<p><a href="http://www.swingswingsubmarine.com/games/blocks-that-matter/">Blocks That Matter</a> is a fun little puzzle-platformer from <a href="http://www.swingswingsubmarine.com/">Swing Swing Submarine</a>.  I haven't had a chance to get too deep into the game yet.  I hope this isn't a spoiler, but I'm up to the level where I have to out run the giant blob guy that is chasing me.</p>

<p>The puzzling aspect seemed pretty simple, but I have a feeling that I'm being deceived...  I think there's already been two little secret boxes that I haven't figured out how to get to already.  In the game you are a little robot, the Tetrobot.  He is able to collect blocks of various materials (wood, sand, rock, etc) by drilling through them or bashing them a few times with his head.  He is able to place down groups of four blocks in shapes much like Tetris pieces.</p>

<p>Some of the blocks, such as rocks, can support their own weight.  Other blocks, like sand, will fall if they are not supported by another block or wall.</p>

<h2>The controls</h2>

<p><a href="http://www.swingswingsubmarine.com/games/blocks-that-matter/">Blocks That Matter</a> has my favorite kind of controls:  every single thing in the game can be done with the keyboard.  No mouse required for anything at all.  That makes it so easy to drop it onto an arcade cabinet.  All that was required was mapping my controller buttons to the correct keys.</p>

<h2>I forgot to record a video...</h2>

<p>... So all I have is this lousy picture:</p>

<p><img src="/Assets/BlocksThatMatter3.jpg"></p>
]]>
        

    </content>
</entry>

<entry>
    <title>Native Linux Games for an Arcade Cabinet:  Voxatron</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/10/native-linux-games-for-an-arcade-cabinet-voxatron.html" />
    <id>tag:blog.patshead.com,2011://2.83</id>

    <published>2011-10-31T20:13:06Z</published>
    <updated>2012-01-24T19:33:37Z</updated>

    <summary>I am cheating a little bit this time... I haven&apos;t even played Voxatron on my arcade cabinet yet because the replacement power supply hasn&apos;t arrived yet. The Humble Voxatron Debut will only be running for about two weeks, so I...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Arcade Games" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="arcadecabinet" label="arcade cabinet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="humblebundle" label="humble bundle" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="voxatron" label="voxatron" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>I am cheating a little bit this time...  I haven't even played <a href="http://www.lexaloffle.com/voxatron.php">Voxatron</a> on <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">my arcade cabinet</a> yet because the <a href="http://blog.patshead.com/2011/10/the-unfortunate-death-of-the-cocktail-arcade-cabinet.html">replacement power supply</a> hasn't arrived yet.  The <a href="http://www.humblebundle.com">Humble Voxatron Debut</a> will only be running for about two weeks, so I figured I should write about it sooner rather than later!</p>

<p><img src="/Assets/voxatron.jpg"></p>

<h2>The controls</h2>

<p><a href="">Voxatron</a> is a neat little 3D platform shooter) will map very easily to the arcade controls.  It uses the arrow keys for movement, <code>z</code> to jump, and <code>x</code> to shoot.  The only other keys that need to be mapped will be <code>enter</code> and <code>escape</code>, for moving around the menus.</p>

<h2>The game</h2>

<p><a href="http://www.lexaloffle.com/voxatron.php">Voxatron</a> is a neat little 3D platform shooter.  It feels a bit like <a href="http://en.wikipedia.org/wiki/Robotron:_2084">Robotron</a> with the addition of jumping.  I've only played through a few levels, so I haven't seen much of the game yet.  I'm (impatiently) waiting to play it with the arcade controls!</p>

<p>The blocky retro-style graphics look awesome.  I especially like that the little light guy's head lights up when he is shooting.  <a href="http://www.lexaloffle.com/voxatron.php">Voxatron</a> will definitely be a welcomed addition to the growing collection of modern games on <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">my arcade cabinet</a>.</p>

<h2>Update 2011-11-11:  It is actually on the cabinet now!</h2>

<p>The cabinet is back up and running and <a href="http://www.lexaloffle.com/voxatron.php">Voxatron</a> looks amazing on there!  I was very impatient and ended up playing through the whole "adventure" mode on my laptop long before the replacement parts for the arcade cabinet arrived.  I know now that it much easier to handle the hold-button-to-lock-shooting-direction control setup with the arcade controls than it is with the keyboard!</p>

<h2>A low quality camera phone video (sorry!)</h2>

<div> 
<object type="application/x-shockwave-flash" data="http://patshead.com/swf/player_flv_maxi.swf" width="640" height="480"> 
     <param name="movie" value="player_flv_maxi.swf" /> 
     <param name="FlashVars" value="flv=http://patshead.com/flv/blog/Voxatron.flv&autoload=0&loop=0&buffer=5&showiconplay=1" /> 
</object> 
</div>

<p>I'm sorry the video is so dark and washed out.  One of these days I'll find a better camera.  Maybe I'll even talk someone into helping me record the videos!</p>
]]>
        

    </content>
</entry>

<entry>
    <title>The Unfortunate Death of the Cocktail Arcade Cabinet</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/10/the-unfortunate-death-of-the-cocktail-arcade-cabinet.html" />
    <id>tag:blog.patshead.com,2011://2.82</id>

    <published>2011-10-30T06:09:35Z</published>
    <updated>2012-01-24T19:37:16Z</updated>

    <summary>I&apos;ve been out of town for most of the last four months. One of the first things I did after &quot;docking&quot; my laptop was fire up the arcade cabinet. It booted right up and I was very happy and relieved...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Cocktail Arcade Cabinet Build" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="arcadecabinet" label="arcade cabinet" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>I've been out of town for most of the last four months.  One of the first things I did after "docking" my laptop was fire up <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">the arcade cabinet</a>.  It booted right up and I was very happy and relieved to see that none of the hard drives had died while I was away.</p>

<p>I store a copy of <a href="http://blog.patshead.com/2011/02/my-backup-strategy-for-my-laptop.html">my Duplicity backups</a> on <a href="http://blog.patshead.com/2010/09/the-beginning-of-an-arcade-cocktail-cabinet-build.html">my arcade cabinet</a> (it is also my <a href="http://blog.patshead.com/2010/12/cocktail-arcade-cabinet-build-part-9---the-computer-hardware-and-software.html">home file server</a>), so I kicked off my script that rsyncs the backups on my laptop over to <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">the arcade cabinet</a>.  Less than a minute later, I hear the drives and fans in the arcade cabinet spin down...</p>

<p>I scratched my head, walked back over, and turned it back on.  This time it shut off about half way through the boot sequence.  I got down on my back and crawled underneath.  I felt like I was checking to make sure the oil filter on <a href="http://en.wikipedia.org/wiki/Mitsubishi_Eclipse#1990.E2.80.931994_.281G.29_Mitsubishi_Eclipse.2C_Eagle_Talon.2C_and_Plymouth_Laser">my DSM</a> was snug (I'd had mine come loose before, the spindle screwed into the oil cooler could be problematic).</p>

<p>While I was looking up into the guts, I hit the power button.  Things were pretty dark from that angle, and I didn't think to bring a flash light.  I touched the CPU fan, it was spinning.  I touched the power supply fan...  It was not spinning.</p>

<p>At least it is an easy problem, just a dead power supply fan.  I'm not surprised that it died, this power supply is probably over four years old by now.</p>

<h2>The silver lining</h2>

<p><a href="http://brianmoses.net">My good friend Brian</a> gave me one of his old video cards:  an <a href="http://www.nvidia.com/object/product_geforce_gts_240_us.html">NVIDIA GeForce GTS 240</a>.  This card is a massive upgrade over the arcade cabinet's current <a href="http://www.nvidia.com/page/geforce6200_pci.html">NVidia GeForce 6200LE</a>, and tons more horsepower than I'm going to need.  The dead power supply is lacking the 6 pin PCIe power connector required by the new card.</p>

<p>I <a href="http://www.amazon.com/gp/product/B002G1YPHK/ref=as_li_ss_tl?ie=UTF8&amp;tag=patsheadcom-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=B002G1YPHK">ordered a new power supply</a>.  It should be here in a few of days.  I'll just have to survive without my home file server for a little while.  This is so much better than coming home to a dead hard drive, or worse, TWO dead hard drives...</p>

<h2>Update 2011-11-02:</h2>

<p>The power supply arrived, but it didn't fix the problem...  It powered up for a minute or two and then shut itself down.  I crawled underneath the cabinet again and started poking at things with my finger and noticed that the CPU heat sink was wobbling:</p>

<p><img src="/Assets/broken-bracket.jpg"></p>

<p>The little nub that holds the heat sink clip snapped off.  I ordered a new bracket, so now I get to wait again.</p>

<p>I got to take a look at the old power supply now that it is out of the case.  It actually has two fans, but I couldn't see the second without removing the monitor.  I tested it out by shorting pins 15 and 16 to start up the power supply.  Both fans started right up.  </p>

<p>I clearly remember sticking a "non conductive instrument" (aka a cheap ball point pen).  I don't recall hearing the usual "THWAP, THWAP, THWAP" sound that usually occurs when you do that with a spinning fan.  I'm starting to think that I should be questioning my sanity!</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Team Fortress 2 is Free to Play!  Getting in-game Purchases Working with Linux and Wine</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/08/team-fortress-2-is-free-to-play-getting-in-game-purchases-working-with-linux-and-wine.html" />
    <id>tag:blog.patshead.com,2011://2.80</id>

    <published>2011-08-16T00:00:00Z</published>
    <updated>2012-01-24T19:39:36Z</updated>

    <summary>Team Fortress 2 is now free to play, so I figured I would give it a try. I don&apos;t really play many first person shooters. For the most part, the only thing that seems to have changed much in the...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
    <category term="teamfortress2" label="Team Fortress 2" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p><a href="http://store.steampowered.com/app/440/">Team Fortress 2</a> is now free to play, so I figured I would give it a try.  I don't really play many first person shooters.  For the most part, the only thing that seems to have changed much in the genre since the early days is the much improved graphics.  Game play usually just involves using bigger and bigger guns to shoot more and more people.</p>

<p>I've always enjoyed games that involve cooperation.  The last first person shooter I played was <a href="http://tremulous.net/">Tremulous</a>.  In fact, <a href="http://blog.brianmoses.net/2011/08/team-fortress-2---free-to-play.html">a friend</a> and I ran a semi-popular <a href="http://tremulous.net/">Tremulous</a> server for a few years.</p>

<p><a href="http://store.steampowered.com/app/440/">Team Fortress 2</a> shares many of the qualities I liked in <a href="http://tremulous.net/">Tremulous</a>, but the community behind <a href="http://store.steampowered.com/app/440/">Team Fortress 2</a> is much more sizable.  It also shares many of the same pitfalls, but overall I am definitely enjoying the experience.</p>

<h2>Getting in-game purchases and Steam connectivity working is easy</h2>

<p>The fix is very easy and I am a bit surprised at just how fragile this is.  You just have to install the Lucida Console font (lucon.ttf).  I just copied the font into <code>~/.PlayOnLinux/fonts</code> on my system, since I'm using <a href="http://www.playonlinux.com/en/">PlayOnLinux</a>.  If you're not, you probably just have to drop a copy in <code>~/.wine/drive_c/windows/Fonts</code> (or some similar location).</p>

<p>I didn't install the font to fix the Steam connectivity.  I installed it to fix the nearly unreadable font in the <a href="http://store.steampowered.com/app/440/">Team Fortress 2</a> console.  I just happened to kill two birds with one stone.</p>

<h2>We're running a Team Fortress 2 server!</h2>

<p>I'm not entirely sure how exciting this is, yet...  Getting a crowd of people to play on a <a href="http://tremulous.net/">Tremulous</a> server was easy.  The community was small and it was pretty easy to differentiate ourselves from the crowd.  This time <a href="http://blog.brianmoses.net/2011/08/team-fortress-2---free-to-play.html">we're</a> just another (barely used) fish in a pond full of other nearly indistinguishable (also barely used) fish.</p>

<p><a href="http://www.gametracker.com/server_info/68.168.146.108:27015/" target="_blank"><img src="http://cache.www.gametracker.com/server_info/68.168.146.108:27015/b_560_95_1.png" border="0" width="560" height="95" alt=""/></a></p>
]]>
        

    </content>
</entry>

<entry>
    <title>(Not Quite) Native Linux Games for an Arcade Cabinet: The Bundle of Wrong</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/07/not-quite-native-linux-games-for-an-arcade-cabinet-the-bundle-of-wrong.html" />
    <id>tag:blog.patshead.com,2011://2.77</id>

    <published>2011-07-22T18:30:00Z</published>
    <updated>2012-01-22T20:38:52Z</updated>

    <summary> I&apos;ve been keeping an eye out for an arena shooter for my arcade cabinet. There are quite a few of them out there, but the majority of them require analog controls. I was pretty excited when I read about...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Arcade Games" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="arcadecabinet" label="arcade cabinet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bundleofwrong" label="bundle of wrong" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="games" label="games" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<div class="images">
<img src="/Assets/SYNSOCE1.jpg">
<img src="/Assets/SYNSOCE2.jpg">
<img src="/Assets/SquidAndLetDie1.jpg">
<img src="/Assets/SquidAndLetDie2.jpg">
<img src="/Assets/WarTwat.jpg">
<img src="/Assets/WarTwat2.jpg">
<img src="/Assets/SquidHardest.jpg">
<img src="/Assets/SquidHardest2.jpg">
<img src="/Assets/SquidHardest3.jpg">
</div>

<p>I've been keeping an eye out for an arena shooter for my arcade cabinet.  There are quite a few of them out there, but the majority of them require analog controls.  I was pretty excited when I read about the <a href="http://bagfullofwrong.co.uk/bagfullofwords/whats-in-bundle-of-wrong/">Bundle of Wrong</a> at <a href="http://www.onlylinuxgames.com/">OnlyLinuxGames.com</a>.</p>

<p>The <a href="http://bagfullofwrong.co.uk/bagfullofwords/whats-in-bundle-of-wrong/">Bundle of Wrong</a> is a <a href="http://en.wikipedia.org/wiki/Pay_what_you_want">pay-what-you-want</a> style bundle.  My expectations were pretty low, I didn't expect the games to run well under Wine.  I was very wrong, all the games in the bundle seem to run flawlessly under Wine.</p>

<p>Every game in the bundle looks quite awesome on <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">my arcade cabinet</a>.  Unfortunately, for now, most of them run a bit slow on there.  The good news is that I will be upgrading the video card soon.  <a href="http://brianmoses.net/">A good friend of mine</a> is letting me steal one of his old video cards that is a few generations newer than the one currently installed in the cabinet.</p>

<h2>The arena shooters:  SYNSO:CE, Squid Harder:SE, and War Twat</h2>

<p>All the arena shooters in the bundle share one thing in common:  they are all extremely colorful and psychedelic.  Especially [War Twat]http://bagfullofwrong.co.uk/bagfullofwords/2009/05/war-twat/)(, which also comes with a "Colour Blindness Edition" for old people like me who tend to lose track of the bullets in the rotating color palette.</p>

<p>I've enjoyed playing all three games, but I think my favorite is probably <a href="http://bagfullofwrong.co.uk/bagfullofwords/2009/05/synso2/">Squid Hardest</a>.  The arena feels a bit larger and I really like the music in Squid Hardest.  I have gotten that little tune stuck in my head a few times already!</p>

<h2>A game with an awesome name:  Squid and Let Die</h2>

<p>I haven't had a chance to play <a href="http://bagfullofwrong.co.uk/bagfullofwords/2010/01/squid-and-let-die/">Squid and Let Die</a> much.  I have only gotten far enough to verify that it runs well on the cabinet.  The short description from the <a href="http://bagfullofwrong.co.uk/">Bagfull of Wrong</a> web site sums it up pretty well:</p>

<blockquote>
  <p>Squid And Let Die is a game. Collect the dots. Do not die. The board is a death trap. Fight inevitability.</p>
</blockquote>

<p>The retro style, mostly green graphics bring back fond memories of the green screen monitor of the <a href="http://www.vintage-computer.com/franklin.shtml">Franklin Ace 1000</a> we had when I was a kid.</p>

<p>The <a href="http://bagfullofwrong.co.uk/bagfullofwords/whats-in-bundle-of-wrong/">Bundle of Wrong</a> is fitting in well with my glowing collection of modern, retro-style games on my arcade cabinet.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Automatically Expanding zsh Global Aliases As You Type</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/07/automatically-expanding-zsh-global-aliases-as-you-type.html" />
    <id>tag:blog.patshead.com,2011://2.75</id>

    <published>2011-07-08T20:00:00Z</published>
    <updated>2012-01-22T20:39:06Z</updated>

    <summary> I am not the first person to think of this idea. My notes seem to think that I originally found the idea on the zsh wiki and I stole the code I started with from hackerific.net. What are global...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Shell" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ohmyzsh" label="oh-my-zsh" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="zsh" label="zsh" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p><img src="/Assets/zsh-globalias.gif"></p>

<p>I am not the first person to think of this idea.  My notes seem to think that I originally found the idea <a href="http://www.zshwiki.org/home/examples/zleiab">on the zsh wiki</a> and I stole the code I started with from <a href="http://hackerific.net/2009/01/23/zsh-abbreviations/">hackerific.net</a>.</p>

<h2>What are global aliases?</h2>

<p>Shell aliases let you condense a long winded and/or hard to remember command down to a short, easy to remember word.  Old school shells will only match the alias if it is the first word in the command.  zsh lets you take that one step further by allowing you to define aliases that will be substituted no matter where they appear on the command line.  These are global aliases.</p>

<p>Here is one of my global aliases that I use all the time:</p>

<pre><code>alias -g G='|&amp; egrep -i'
</code></pre>

<p>With this alias defined, these two commands are equivalent:</p>

<pre><code>cat /proc/cpuinfo G cache
cat /proc/cpuinfo |&amp; egrep -i cache
</code></pre>

<h2>My problem with global aliases</h2>

<p>When I look at a command line with a global alias it isn't always entirely clear to me what the command I am about to run is actually going to do.  Am I sure my <code>G</code> alias has a <code>-i</code> switch?  Does it use <code>|&amp;</code> so that it will also grep <code>stderr</code>?</p>

<h2>The existing solution</h2>

<p>The handy script at <a href="http://hackerific.net/2009/01/23/zsh-abbreviations/">hackerific.net</a> sets things up so that as soon as you hit the space bar after typing the global alias it is automatically expanded right there on the command line.</p>

<p>This is great for a couple of reasons.  You never have to guess what code is hidden inside that alias.  The full text of the command will be right there on the command line and in your history, so you'll never be surprised.  It also means you can go back and tweak the command a bit.</p>

<h2>What I did differently</h2>

<p>There is only one thing I didn't like about the solution at <a href="http://hackerific.net/2009/01/23/zsh-abbreviations/">hackerific.net</a>.  Instead of cleanly defining your global aliases with the alias command you have to add your aliases into a hash table.  His code uses that hash table to expand the aliases on the command line and also to create your actual global aliases (so that they still work at the end of the line).</p>

<p>I like that you only have to define them once but I wanted to build the hash table out of the global aliases that are already defined.</p>

<p>I managed to parse the output of <code>alias -g</code> and stuff it into the hash table, but I wasn't able to make it work without piping the output to Perl and sourcing the output back in.  I tried to make it work with pure shell code, but none of the magic I came up with worked.</p>

<h2>Here's the code!</h2>

<pre><code>typeset -A abbrevs

# Begin Ugly Hack

alias -g | perl -e "print 'abbrevs=('; while (&lt;&gt;) { s/^(.+?)='(.+)'/'\$1' '\$2' /g; s/'\\$/\\$'/g; print; } print ')';" &gt; /tmp/cheater.zsh
source /tmp/cheater.zsh

# End Ugly Hack

globalias() {
   local MATCH
   LBUFFER=${LBUFFER%%(#m)[_a-zA-Z0-9\-]#}
   LBUFFER+=${abbrevs[$MATCH]:-$MATCH}
   zle self-insert
}

zle -N globalias

bindkey " " globalias
bindkey "^ " magic-space           # control-space to bypass completion
bindkey -M isearch " " magic-space # normal space during searches
</code></pre>

<p>You can probably just paste this into your <code>.zshrc</code> near the end, after all your global aliases are defined.</p>

<h2>oh-my-zsh plugin</h2>

<p>I'm running my copy as an <a href="https://github.com/robbyrussell/oh-my-zsh">oh-my-zsh</a> plugin.  I haven't uploaded it to <a href="http://github.com">github</a> yet, though.  I'd prefer to eliminate the ugly pipe-and-source lines first.  I may have to upload it as is if I don't get around to improving it, though.</p>

<p>You can <a href="http://patshead.com/misc-files/globalias.plugin.zsh">download my plugin here</a>, it is identical to the code above, though.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>(Not Quite) Native Linux Games for an Arcade Cabinet:  Mactabilis</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/07/not-quite-native-linux-games-for-an-arcade-cabinet-mactabilis.html" />
    <id>tag:blog.patshead.com,2011://2.76</id>

    <published>2011-07-04T20:00:00Z</published>
    <updated>2012-01-22T20:40:28Z</updated>

    <summary>I set a goal for myself early in the year. I would like to buy one Indie game for my arcade cabinet every month this year. I&apos;ve tried my best to find native Linux games, and there are plenty of...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Arcade Games" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="arcadecabinet" label="arcade cabinet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mactabilis" label="mactabilis" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>I set a goal for myself early in the year.  I would like to buy one Indie game for <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">my arcade cabinet</a> every month this year.  </p>

<p>I've tried my best to find native Linux games, and there are plenty of awesome independent games that run natively on Linux.  The problem is that the vast majority of these games require some sort of analog input, usually a mouse.  <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">My cabinet</a> has no analog controls...</p>

<p>I have been keeping my eye out looking for Windows games that run well under Wine.  There are a large number of Indie games that run very poorly under Wine, most of them were created using <a href="http://en.wikipedia.org/wiki/Game_Maker">GameMaker</a>.</p>

<p>I saw the <a href="http://www.buygamesnotsocks.com/">Buy Games Not Socks</a> and I immediately hoped that <a href="http://www.blazingbitgames.com/en/mactabilis/">Mactabilis</a> would run under wine.  I downloaded the demo and it ran absolutely flawlessly, so I immediately purchased the bundle.</p>

<p>It even runs well on <a href="http://blog.patshead.com/2011/01/cocktail-arcade-cabinet-build-part-10---the-finished-cabinet.html">my arcade cabinet</a> with it's ancient Nvidia 6200LE video card, even <a href="http://blog.patshead.com/2010/11/cocktail-cabinet-build-supplemental---a-mistake-to-avoid-when-choosing-a-display.html">with the video flipped upside down</a>.  I do have to run it with the resolution set to 960x540, though.  </p>

<p><img src="/Assets/Mactabilis1.jpg"></p>

<p>I was happy to learn that everything in the game can be controlled with the arrow keys and a handful of buttons.  After mapping everything I would need I still had one button left over on my six (seven, counting start) button control panel.</p>

<p><img src="/Assets/Mactabilis3.jpg"></p>

<p><a href="http://www.blazingbitgames.com/en/mactabilis/">Mactabilis</a> is an awesome side scrolling shoot 'em up.  The first thing I noticed when I started playing was that the game felt backwards!  I'm so used to my ship being on the left.</p>

<p>This was very easy to get used to.  For half of the first level your ship is moving from left to right, on the second half you reverse direction.  </p>

<p><img src="/Assets/Mactabilis2.jpg"></p>

<p><a href="http://www.blazingbitgames.com/en/mactabilis/">Mactabilis</a> has an interesting feature that I've never seen in a shoot 'em up before.  You can hit a button to move your ship between the foreground and the background layers.  Enemies and obstacles seem to occupy one of the two layers.</p>

<p>If things get too crowded or dangerous in the current layer you can just hit a button to move your ship into the opposite layer.  Enemies in the other layer become transparent, blurry, and desaturated.</p>

<p>This is pretty neat but I was constantly forgetting that this option exists...</p>

<p><img src="/Assets/Mactabilis4.jpg"></p>

<p><a href="http://www.blazingbitgames.com/en/mactabilis/">Mactabilis</a> also seems to have a staggeringly huge number of weapons to purchase for your ship.  I haven't had time yet to get very far into the game, so I can't really comment too much on this.  I can say that the weapon screen has a seven by seven grid of weapons you can purchase.  I can hardly wait to try some of them!</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Updating the BIOS on an HP DV8T Laptop Without Windows (You Can&apos;t)</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/06/updating-the-bios-on-an-hp-dv8t-laptop-without-windows-you-cant.html" />
    <id>tag:blog.patshead.com,2011://2.74</id>

    <published>2011-06-24T20:00:00Z</published>
    <updated>2011-06-28T23:58:15Z</updated>

    <summary>Nearly every piece of hardware in my laptop has worked fine, more or less, with Linux since I bought it early in 2010. There is only one minor buglet that I am aware of and it has been a minor...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Computer Hardware" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="acpi" label="acpi" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dv8t" label="dv8t" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>Nearly every piece of hardware in my laptop has worked fine, more or less, with Linux since I bought it early in 2010.  There is only one minor buglet that I am aware of and it has been a minor nuisance the entire time:  ACPI is unable to read the discharge rate of the battery.</p>

<p>This hasn't really been that big of an issue for me.  The battery only lasts about two and a half hours anyway, and there is no trouble reading the current charge left in the battery.  I was hoping I'd eventually luck out and a kernel upgrade would magically start seeing the discharge rate.  I'm up to 3.0-rc3 and still no luck there.</p>

<p>I didn't have any reason to attempt to fix this problem until yesterday.  I installed a copy of the latest and greatest development version of <a href="http://en.wikipedia.org/wiki/PowerTOP">Powertop</a>, version 1.98.  The new version looks very promising.  I was interested in trying the new calibration feature.  It looks like it does things like cycle your LCD brightness, perform disk i/o, and stress the CPU a bit while monitor power usage.  This doesn't seem to work so well if Powertop is unable to read the battery discharge rate.</p>

<p>My DV8T has a quad core i7 processor and the BIOS version was F.11.  I bought two more DV8T laptops last summer, one for each of my parents.  Theirs have Core 2 Duo processors.  Luckily for me, I have a VPN between here and my parents' house.  I was able to ssh into my mother's laptop and take a look around.  She has BIOS version F.24 and ACPI has no trouble reading the discharge rate.</p>

<h2>Updating the BIOS</h2>

<p>I rarely update the BIOS on my machines.  As far as I'm concerned, if it ain't broke don't fix it.  I decided that, in this case, it seemed to be working on another very similar machine (with the same BIOS) that it was worth giving it a shot.</p>

<p>Here's the rub.  HP's flash utility only runs on Windows.  I don't have Windows installed anywhere here at home.  I probably have an old Windows XP CD squirreled away somewhere, but I have no idea where it is.  I'm disappointed that they don't have a DOS utility like most of their competition does.  It isn't a deal breaker.  I'd still buy another laptop like this, I don't often want to flash the BIOS on any of my laptops.</p>

<p>I tried a BartPE boot disk.  It blue screened.  I ended up downloading the Windows 7 Enterprise 30 day trial from MicroSoft and I installed it on an old spare laptop drive.  This part of the journey is pretty uninteresting.  Windows 7 installed just fine and the BIOS flashed with just a few clicks.</p>

<h2>Total waste of time</h2>

<p>I'm up to BIOS version F.25.  Here is the result:</p>

<pre><code>wonko@zaphod:~$ cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            unknown
remaining capacity:      4640 mAh
present voltage:         16434 mV
wonko@zaphod:~$ cat /sys/class/power_supply/BAT0/current_now 
cat: /sys/class/power_supply/BAT0/current_now: No such device
wonko@zaphod:~$
</code></pre>

<p>Note the <code>present rate: unknown</code> and the <code>No such device</code>.  I'm guessing this ACPI problem only exists on the Core i7 DV8T laptops.  At least I got to see how much the Windows install process has (and hasn't!) changed between Windows XP and Windows 7, for whatever that is worth...</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Trying Out an Improvised Standing Desk</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/06/trying-out-an-improvised-standing-desk.html" />
    <id>tag:blog.patshead.com,2011://2.73</id>

    <published>2011-06-17T20:00:00Z</published>
    <updated>2012-01-22T20:05:06Z</updated>

    <summary>I&apos;ve been reading a lot of good things about standing desks lately. It seems that we can burn up to an extra 50 calories every hour if we stand instead of sit. The entire Internet is also telling us that...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Do It Yourself Projects" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="standingdesk" label="standing desk" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>I've been <a href="http://smarterware.org/7102/how-and-why-i-switched-to-a-standing-desk">reading</a> <a href="http://www.ikeahackers.net/2011/05/effektiv-standing-desk.html">a lot of</a> <a href="http://jessenoller.com/2011/04/25/switching-to-a-standing-desk-thoughts/">good things</a> <a href="http://zenhabits.net/stand/">about standing desks</a> lately.  It seems that we can <a href="http://www.livestrong.com/article/73916-calories-burned-standing-vs.-sitting/">burn up to an extra 50 calories every hour if we stand instead of sit</a>.  The entire Internet is also telling us that <a href="http://consumerist.com/2011/04/sitting-can-literally-kill-you.html">sitting can literally kill us</a>.</p>

<p>I'm not sure how true either of those are, but I still figured I'd give it a try.  Setting up a quick, makeshift standing desk was easy and free.  I did a bit of measuring and started rummaging through our closets.  We have a couple of these <a href="http://www.meritline.com/cd-dvd-510-holder-wallet-holders-wallets---p-39026.aspx">large faux-aluminum CD cases that hold 510 discs</a>.</p>

<p>Putting one of those cases on my cocktail arcade cabinet raises my laptop up to about 43 inches.  That's just about elbow height for me.  The case also happens to be just about the same length and width as <a href="http://blog.patshead.com/2011/05/fixing-the-horrible-wifi-toggle-button-on-an-hp-dv8t-laptop.html">my gigantor 18.4 inch laptop</a>.</p>

<p><img src="/Assets/ImprovisedStandingDesk.jpg"></p>

<h2>Using the standing desk for a few weeks</h2>

<p>The first few days my feet weren't too happy about standing for such long periods of time.  I started out using it for one or two hours each day.  At some point during the first week my feet stopped being a problem.</p>

<p>I seem to be a bit more motivated when I'm standing.  I think I actually do get a bit more work done but I haven't done any science to validate that.</p>

<p>My quick hack of a standing desk has a major flaw:  the display is way too low.  My shoulders and neck start the get pretty tired after a few hours from looking down all the time.</p>

<h2>What can I do about it?</h2>

<p>I'd like to continue using the laptop's keyboard but I'm not sure I can get the display up high enough without putting too steep of an angle on the keyboard.  The display needs to be elevated at least another twelve inches, possibly a bit more.</p>

<p>I have a couple of designs knocking around in my head that I can build out of PVC.  I'd like to throw something together soon, but it looks like I'm probably going to be out of town for a month or two.  In the mean time I will continue to make use of what I have set up.</p>

<h2>The verdict</h2>

<p>Setting up this simple standing desk was definitely worth the very small amount of effort that was required.  If you think the idea of a standing desk is interesting I would encourage you to give it a try for a few days.</p>

<p>I have no plans to convert to using a standing desk full time.  My monitors are going to <a href="http://blog.patshead.com/2010/11/do-it-yourself-dual-lcd-monitor-stand.html">stay firmly attached to my regular desk</a> and you'll have to pry my Aeron chair out of my cold, dead hands.  I think from now on, though, I will always make sure I have somewhere in my office where I can stand up and use my laptop.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Supplimenting btrfs-snap With apt-btrfs-snapshot</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/06/supplimenting-btrfs-snap-with-apt-btrfs-snapshot.html" />
    <id>tag:blog.patshead.com,2011://2.72</id>

    <published>2011-06-10T20:00:00Z</published>
    <updated>2012-01-22T20:40:35Z</updated>

    <summary>I&apos;ve been a very happy user of btrfs-snap for quite a while now. It is great for taking snapshots of a volume at regular intervals. In my opinion, this is a little bit wasteful and cumbersome for the root volume....</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="btrfs" label="btrfs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="btrfssnap" label="btrfs-snap" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>I've been a very happy user of <a href="http://blog.patshead.com/2010/09/simple-automated-btrfs-snapshots-with-btrfs-snap.html">btrfs-snap</a> for quite a while now.    It is great for taking snapshots of a volume at regular intervals.  In my opinion, this is a little bit wasteful and cumbersome for the root volume.  I don't tend to change things on the root volume every hour, or even every day.</p>

<p>Ubuntu 11.10 now has <code>apt-btrfs-snapshot</code> available in the universe repository.  This is an awesome little script that hooks into <code>apt</code> to create a snapshot right before packages are installed or upgraded.</p>

<p>The only thing I wasn't too happy about was that <code>apt-btrfs-snapshot</code> doesn't do any cleanup of old snapshots, so things were getting cluttered pretty quickly:</p>

<p><img src="/Assets/root-snapshots.png"></p>

<h2>Cleaning things up a bit</h2>

<p>I threw together my own little snapshot cleanup script to hook into <code>apt</code>.  It automatically removes all but the five most recent snapshots.  That should be enough history to keep me safe.</p>

<p><img src="/Assets/root-snapshots-post-cleanup.png"></p>

<h2>Still using btrfs-snap as a safety net</h2>

<p>I'm still using <code>[btrfs-snap](http://blog.patshead.com/2010/09/simple-automated-btrfs-snapshots-with-btrfs-snap.html)</code> on my root volume but I'm not keeping anywhere near as much history as I used to.  I'm only keeping a few hourly snapshots and one weekly snapshot.  I'll probably end up dropping the weekly snapshot.</p>

<p><img src="/Assets/root-btrfs-snap.png"></p>

<p>This is my <code>apt-btrfs-snapshot-cleanup.sh</code> script:</p>

<pre><code>#! /bin/bash

DEVICE=/dev/sda2
KEEP=5
MP=`mktemp -d`

mount /dev/sda2 $MP

ls -dr $MP/@apt-snapshot-* | tail -n +$KEEP | while read snap ; do
  btrfs subvolume delete $snap
done

umount $MP
</code></pre>

<p>I also created a file called <code>/etc/apt/apt.conf.d/81-btrfs-snapshot-cleanup</code> containing this line:</p>

<pre><code>DPkg::Pre-Invoke {"if [ -x /usr/bin/apt-btrfs-snapshot ] &amp;&amp; apt-btrfs-snapshot supported; then /home/wonko/bin/sbin/apt-btrfs-snapshot-cleanup.sh; fi "; };
</code></pre>

<p>This will make <code>apt</code> run this script right after it takes a snapshot.  Just tweak that line to match the location of your <code>apt-btrfs-snapshot-cleanup.sh</code> script.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Why I Started Using htop</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/05/why-i-started-using-htop.html" />
    <id>tag:blog.patshead.com,2011://2.71</id>

    <published>2011-05-27T20:00:00Z</published>
    <updated>2011-05-26T06:07:23Z</updated>

    <summary> I have probably been entertaining the idea of replacing top with htop for quite a few years now. I have even made the attempt a few times. Familiarity and muscle memory always brought me back to top. Until now....</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Shell" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="htop" label="htop" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="shell" label="shell" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p><img src="/Assets/htop.png"></p>

<p>I have probably been entertaining the idea of replacing <code>top</code> with <a href="http://htop.sourceforge.net/">htop</a> for quite a few years now.  I have even made the attempt a few times.  Familiarity and muscle memory always brought me back to <code>top</code>.  Until now.</p>

<h2>Some advantages of <a href="http://htop.sourceforge.net/">htop</a></h2>

<p>The biggest advantage of <a href="http://htop.sourceforge.net/">htop</a> for me is that it combines the functionality of <code>top</code> and <a href="http://guichaz.free.fr/iotop/">iotop</a> into a single screen, since <a href="http://guichaz.free.fr/iotop/">iotop</a> lets you add disk i/o related columns to the output.  This feature has saved me quite a bit of time and thought.  I don't have to cross reference processes between <code>top</code> and <a href="http://guichaz.free.fr/iotop/">iotop</a> now, and I also don't have to fire up <code>vmstat</code> as often as I used to.</p>

<p>You can also highlight a process and hit <code>l</code> to get a list of open files for that process.  I haven't needed to use <code>lsof</code> very often since I learned about this feature.</p>

<p>There are some other small advantages to <a href="http://htop.sourceforge.net/">htop</a>.  You can scroll the display horizontally with the mouse which is makes it easy to see the entire command line of a command.  You can also select multiple processes to kill or renice.</p>

<p><a href="http://htop.sourceforge.net/">htop</a> also lets you configure the header area and which columns are displayed in a much more visual manner than <code>top</code>.  </p>

<h2>Some minor problems with <a href="http://htop.sourceforge.net/">htop</a></h2>

<p>I'm not really a fan of <a href="http://htop.sourceforge.net/">htop</a>'s color schemes.  It ships with a half dozen color schemes that are all either very colorful or completely monochromatic.  The color schemes are hard coded so there is no easy way to define your own.</p>

<p>There are <code>top</code> compatibility keys for sorting by memory and cpu usage but there is no key to sort by i/o.  To do that you have to hit <code>F6</code> or <code>&gt;</code> and use the arrow keys to select the i/o column.  This is still better than reaching for <a href="http://guichaz.free.fr/iotop/">iotop</a> but it isn't exactly ideal.  Setting CPU affinity has the same problem.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Fixing the Horrible WIFI Toggle Button on an HP dv8t Laptop</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/05/fixing-the-horrible-wifi-toggle-button-on-an-hp-dv8t-laptop.html" />
    <id>tag:blog.patshead.com,2011://2.70</id>

    <published>2011-05-20T12:40:26Z</published>
    <updated>2012-01-22T20:09:39Z</updated>

    <summary> Update 2011-09-06: The fix worked great until yesterday. That&apos;s probably about three and a half months. I solved the problem more permanently this time. I just unplugged the ribbon cable for the capacitive button bar. I now have fewer...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Do It Yourself Projects" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="dv8t" label="dv8t" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<ul>
<li>Update 2011-09-06:  The fix worked great until yesterday.  That's probably about three and a half months.  I solved the problem more permanently this time.  I just unplugged the ribbon cable for the capacitive button bar.  I now have fewer lights staring back at me and I no longer have dedicated buttons for volume control, but I am confident that my WIFI won't be turning itself off even again.</li>
</ul>

<p>I have had my HP dv8t laptop for a little over a year now.  For the most part I have been very pleased with this machine, it is an excellent quad core desktop replacement.  It is a big, heavy laptop with an 18.4 inch screen.  It usually spends most of its time <a href="http://blog.patshead.com/2010/09/how-to-stow-a-laptop-out-of-sight-for-less-than-4.html">living behind my desk</a> plugged into <a href="http://blog.patshead.com/2010/11/do-it-yourself-dual-lcd-monitor-stand.html">a pair of external monitors</a>.</p>

<p>A few weeks ago I did a little bit of traveling and I was using it in a hotel connected to their wifi.  Sometimes things were fine, other times it was disconnecting and reconnecting the wifi every few minutes.</p>

<p>I've had the wifi inexplicably turn off here at home a few times but I always assumed it was my own fault.  The little blue capacitive button to toggle the wifi is just about a thumb's length from the right side of the laptop, just above the keyboard.  When I am sitting in a chair and I need to lift the laptop to adjust my position that is precisely where I am most like to grab a hold of it.</p>

<p>It usually took me a number of seconds to notice that I had inadvertently hit that switch.  More and more often lately, though, I haven't been so sure that I actually touched the switch...</p>

<h2>The problem is ridiculously common</h2>

<p>I asked my good friend Google about this problem and she showed me all sorts of pages with people complaining about the same problem.  It looks like a design flaw.  I found an <a href="http://sleeplessnerd.blogspot.com/2010/11/how-to-fix-pavilion-dv8t-wireless.html">excellent explanation of the problem and a description of the fix</a> on <a href="http://sleeplessnerd.blogspot.com/">Dave Miller's blog</a>.</p>

<p>There is a layer of foil that shields the cable that connects the capacitive button panel to the motherboard.  It seems that if the laptop body is flexed ever so slightly, like when I pick it up by one side, the foil pulls away from the metal plate and becomes ungrounded.  The problem also seems to occur more often when the laptop is hot.  I imagine I've rarely experienced this problem because the laptop gets pretty good ventilation when I have it "docked" behind my desk.</p>

<p>I saw some forum posts that claimed it also helps to use some foil to shield the area around where the wifi antenna lead connects to the motherboard.  I have no idea if this helps or if it is necessary but I thought it was a pain in the neck unsnapping all the plastic bits to get the keyboard off.  I figured it was best to do everything I might need to do while I was under there!</p>

<h2>What I actually did</h2>

<p>I ended up putting taping a piece of aluminum foil over the whole area where the wifi lead connects to the motherboard.  I put some tape on the underside of the foil to make sure it wouldn't accidentally short anything out.</p>

<p>I made sure that piece of foil was large enough so that it would extend over to the existing foil taped over the capacitive button cable.  I know very little about electronics but I assumed it couldn't hurt to make sure the new foil shielding was also grounded.</p>

<p>Then I taped down my new foil and I taped down the capacitive panel's lead.</p>

<p>So far everything has been working just fine.  I haven't had my wifi turn off on its own even once.  Hopefully the fix will hold up for a long time.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>My Take on &quot;The Go Command&quot;</title>
    <link rel="alternate" type="text/html" href="http://blog.patshead.com/2011/05/my-take-on-the-go-command.html" />
    <id>tag:blog.patshead.com,2011://2.68</id>

    <published>2011-05-13T20:00:00Z</published>
    <updated>2012-01-22T20:40:49Z</updated>

    <summary>When I first saw Zachary Wasserman&apos;s Go Command I wasn&apos;t entirely convinced that it was a good idea. I figured you could get similar functionality with less typing by enabling autocd, properly configuring binfmt_misc, and setting the execute bit on...</summary>
    <author>
        <name>Pat Regan</name>
        <uri>http://blog.patshead.com</uri>
    </author>
    
        <category term="Shell" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="autojump" label="autojump" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ohmyzsh" label="oh-my-zsh" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="zsh" label="zsh" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.patshead.com/">
        <![CDATA[<p>When I first saw <a href="http://zwass.wordpress.com/">Zachary Wasserman's</a> <a href="http://zwass.wordpress.com/2011/03/16/the-go-command/">Go Command</a> I wasn't entirely convinced that it was a good idea.  I figured you could get similar functionality with less typing by enabling <code>autocd</code>, properly configuring <a href="http://en.wikipedia.org/wiki/Binfmt_misc">binfmt_misc</a>, and setting the execute bit on pretty much every single file...</p>

<p>Those three things would be quite convoluted and setting the execute bit on every single file would make me a bit nervous...  <a href="http://zwass.wordpress.com/">Alexy's</a> <a href="http://zwass.wordpress.com/2011/03/16/the-go-command/"><code>go</code> command</a> is safer, easier to implement, easier to carry along with you, and can give us much finer grained control over the process.</p>

<p>To me the <code>go</code> command feels like it could be called the <a href="http://en.wikipedia.org/wiki/DWIM">dwim</a> command.  I wanted my own <code>go</code> command to do more than change directories and open files in my text editor.</p>

<p>I wanted to limit mine to only open appropriate files in my text editor.  I didn't want to be accidentally opening images or videos in <a href="http://emacswiki.org/">Emacs</a>.  I also decided that if a file shouldn't be opened with a text editor that it should be handed off to <code>xdg-open</code>.  That lets me open images, videos, office documents, and anything else I can think of with the same command.</p>

<p>I also felt it was important to integrate <a href="http://blog.patshead.com/2011/02/autojump---the-lazy-way-to-change-directories.html">autojump</a> because I am horribly addicted to it.  So much so that my muscle memory always wants to type <code>j</code> instead of <code>g</code>...  I'm sure if I can start remembering to correct myself I will have that trained out of me in a week or two.</p>

<p>Here's the current revision of my take on the <code>go</code> command.  It works fine on botth <code>zsh</code> and <code>bash</code>.  It fails gracefully if <code>xdg-open</code> or autojump are not found.  If you would like to give it a try you can just copy and paste it into your <code>~/.zshrc</code> or <code>~/.bashrc</code> (whichever is appropriate for your shell).</p>

<pre><code>go() {
   if [ -f "$1" ]; then
     if [ -n "`file $1 | grep '\(text\|empty\|no magic\)'`" ]; then
       if [ -w "$1" ]; then
         $EDITOR "$1"
       else
          sudo $EDITOR "$1"
          #$EDITOR /sudo::"$1" # For emacsclient+tramp
       fi
     else
       if [ -e "`which xdg-open`" ]; then
         if [ -n "$DISPLAY" ]; then
           xdg-open "$1" &gt; /dev/null
         else
           echo "DISPLAY not set:  xdg-open requires X11"
         fi
       else
         echo "xdg-open not found:  unable to open '$1'"
       fi
     fi
   elif [ -d "$1" ]; then
     cd "$1"
   elif [ "" = "$1" ]; then
     cd
   elif [ -n "`declare -f | grep '^j ()'`" ]; then
     j "$1"
   else
     echo "Ran out of things to do with '$1'"
   fi
 }

 alias g=go
</code></pre>

<p>From my perspective there isn't any value in automatically running an <code>ls</code> every time I change directories.  I prefer to see as many previously run commands on my screen at a time as possible and an 80x24 terminal is already pretty cramped as it is.  Even in the rare instances where I vertically maximize my terminal I still don't want to look at the noise of multiple extraneous directory listings starting back at me.  You mileage will most likely vary, though.</p>

<h2>The disadvantage of the go command</h2>

<p>Using three separate commands provides the shell with context to help it provide better completion options to you.  I don't think this is a big loss if you don't use <code>autojump</code>, though.  I haven't figured out how I want to set up the <code>zsh</code> completion settings for my <code>go</code> command, yet.   For now I will just limp along with the basic completion settings.</p>

<p>This is the sort of problem we see with commands like <a href="https://github.com/robbyrussell/oh-my-zsh">oh-my-zsh</a>'s <code>x/extract</code> command.  It will perform a basic extraction for just about any archive you throw at it but you lose the ability to complete on files inside the archive.  </p>

<p><a href="http://www.imdb.com/title/tt0083033/">Happy Friday the 13th!</a></p>

<ul>
<li><strong>Update 2010-05-18:</strong>  I moved this code into an <a href="https://github.com/robbyrussell/oh-my-zsh"><code>oh-my-zsh</code></a> plugin and <a href="https://github.com/robbyrussell/oh-my-zsh/pull/341">submitted a pull request</a> a few days ago.</li>
<li><strong>Update 2010-05-20:</strong>  Added a little bit of functionality.  If the file to edit is read only it will be opened using <code>sudo</code>.</li>
</ul>
]]>
        

    </content>
</entry>

</feed>

