<?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' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6847666534489502628</id><updated>2012-04-19T23:14:35.511-05:00</updated><category term='Unix'/><category term='Python'/><category term='Gripes'/><category term='Kindle'/><category term='Quickie'/><category term='Amazon'/><category term='Misc'/><category term='Gadgets'/><category term='GNU'/><category term='Apple'/><category term='BSD'/><category term='osx'/><category term='OS X'/><category term='Code'/><category term='Scripting'/><category term='posix'/><category term='AWK'/><category term='Linux'/><category term='Society'/><category term='mac'/><category term='Software'/><category term='Lua'/><category term='macports'/><category term='Android'/><category term='palm pre webos'/><title type='text'>This is Not a Discussion</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default?start-index=26&amp;max-results=25'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-6645404657306022504</id><published>2011-11-23T23:18:00.001-06:00</published><updated>2011-11-24T01:17:07.133-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Software'/><category scheme='http://www.blogger.com/atom/ns#' term='Quickie'/><category scheme='http://www.blogger.com/atom/ns#' term='Gadgets'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><category scheme='http://www.blogger.com/atom/ns#' term='Kindle'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><title type='text'>Ways in which the Kindle Fire fails...now fix them</title><content type='html'>There are plenty of negative reviews out there about the new Kindle Fire. In my opinion many of those reviews unfairly try to draw comparisons between Amazon's device and the iPad. Here I look at the unit irrespective of what comes out of Cupertino. I'm not interested in bashing Amazon or their product(s). Nor am I attempting to be apologetic for their failings.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;100% Grade-A Fail&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Power button&lt;/li&gt;&lt;ol&gt;&lt;li&gt;It's inconveniently located (at the bottom of the device)&lt;/li&gt;&lt;li&gt;Resting the device on a table for reading is impractical as the power is constantly activated (unless you use a case or hold the device upside down)&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Speakers&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Low quality&lt;/li&gt;&lt;li&gt;Low volume&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Volume Control&lt;/li&gt;&lt;ol&gt;&lt;li&gt;There is no hardware access to the volume settings (no slider or rocker). When playing a video or using an app you have to:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Activate the menu system (not required in all cases)&lt;/li&gt;&lt;li&gt;Tap on the setting icon at the top of the device&lt;/li&gt;&lt;li&gt;Slide the Volume slider to the desired value&lt;/li&gt;&lt;li&gt;Hope that your application isn't paused during this process because otherwise you'll be repeating steps 2 and 3 until you get it just right.&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;li&gt;Multiple-Account support&lt;/li&gt;&lt;ol&gt;&lt;li&gt;one account &amp;lt;--&amp;gt; one device works in some (read: many) contexts. But with device like this it just makes sense to support multiple accounts (and by accounts I mean specifically Amazon accounts)&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Performance&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Silk&lt;/li&gt;&lt;ol&gt;&lt;li&gt;It's not fast (admittedly this may change overtime as they mine behavior from the millions of users they have)&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Touch Response and Processing&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Sometimes the device doesn't register touches&lt;/li&gt;&lt;li&gt;Sometimes the touches seem to register instantly other times they seem to register quite a while after the touch event&lt;/li&gt;&lt;li&gt;Sometimes (read: frequently) a 'tap' is registered as a swipe (and vice versa)&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;li&gt;Specs&lt;/li&gt;&lt;ol&gt;&lt;li&gt;RAM&lt;/li&gt;&lt;ol&gt;&lt;li&gt;only 512 (it does make a difference especially with bloated Dalvik apps)&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Storage&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Dear Amazon, in an effort to make your devices more affordable please feel free to either keep the internal capacity to something under 8GB or exclude things like SD-Card slots. DO NOT DO BOTH!!!&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Fail Lite&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Content Offerings&lt;/li&gt;&lt;ol&gt;&lt;li&gt;News Stand - Magazines are poorly formatted for the device. The content is neither rich nor interactive&lt;/li&gt;&lt;li&gt;Apps - A sparse subset of the apps in the Amazon App Store are available for the Fire. Few compelling titles exist (evidenced by the fact that the daily free title is consistently #1 in the store).&amp;nbsp;Finding titles that might appeal to a user based on their age is very difficult. The categories they have are pretty broad and not very helpful .&lt;/li&gt;&lt;li&gt;Docs - The built in PDF reader is one step above worthless. It works great if your PDF was formatted specifically for a 1024x600 display, otherwise you'll find that resizing and panning are slow and often cause you drum your fingers on the table top as you wait for the rendering engine to redraw the text you're trying to read.&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Keyboard - The built-in keyboard is mediocre. The least they could do is allow LastPass integration so that you can use LastPass to fill in your account credentials from time to time.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Even So...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;I'm not displeased with my purchase. My original intention was to get the device for myself, do some development on/for it and get them for my nieces and nephews. I do not think that the Kindle Fire is as kid friendly as is the Nook Color/Tablet. Touchy Books are oddly formatted on the Fire but look great on the Nook offerings. Finding age appropriate material is much more difficult on the Fire than on the Nook. This causes quite the quandary as Amazon has a much better ecosystem for a device like this, they just lack the polish. Were I buying based only on the device offerings as they exist today, I'd probably get the young ones Nook Tablets. I think, though, that is more of an investment in a platform and I feel Amazon has all the right ingredients to make the best platform. Barnes and Noble just doesn't have the same synergy across Music, Movies, Books, Apps, etc...&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-6645404657306022504?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/6645404657306022504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2011/11/ways-in-which-kindle-fire-failsnow-fix.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6645404657306022504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6645404657306022504'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2011/11/ways-in-which-kindle-fire-failsnow-fix.html' title='Ways in which the Kindle Fire fails...now fix them'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-1568967172459232504</id><published>2011-07-21T15:10:00.000-05:00</published><updated>2011-07-21T15:10:43.409-05:00</updated><title type='text'>Some quick functions from my .shrc_local</title><content type='html'>It's pretty well known that I have a fairly hefty .&lt;a href="https://github.com/gcw/dotfiles/blob/master/dot_shrc"&gt;shrc&lt;/a&gt; which I created sometime ago to address the little things that bugged me when going from FreeBSD to say Linux or from OS X to maybe Cygwin ( &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;${deityOfYourChoice:="God"}&lt;/span&gt; help me ). &amp;nbsp;When I published it, I tried to make sure that it was both functional for the general public (ok.. admittedly a self-selecting sub-sub-sub culture of the general public) and generic enough to not get in the way of people who want to extend it for their specific needs.&lt;br /&gt;Enter: .&lt;i&gt;shrc_local&lt;/i&gt;. There are other places where one could make customizations and I actively encourage that, but if you just want something simple you can create a &lt;i&gt;~/.shrc_local&lt;/i&gt; and drop it in there.&lt;br /&gt;&lt;br /&gt;Here is one example of that (pulled directly from my .shrc_local):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;rvm(){&lt;br /&gt;    #Quick wrapper function to make RVM (https://rvm.beginrescueend.com/) work&lt;br /&gt;    #if you're using a sane shell instead of 'bash'. Bash still needs to be &lt;br /&gt;    #installed as RVM depends on it. This function simply wraps around bash&lt;br /&gt;    #passing in the init script (~/.rvm/scripts/rvm) and the parameters so that&lt;br /&gt;    #you aren't stuck when your default shell is something other than bash or &lt;br /&gt;    #zsh&lt;br /&gt;    echo "&lt;br /&gt;        source ${HOME}/.rvm/scripts/rvm &lt;br /&gt;        rvm $*&lt;br /&gt;    " | bash&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;Here is another:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;update_pkgsrc(){&lt;br /&gt;    #Quick function to update my pkgsrc source tree.&lt;br /&gt;    export CVSROOT=anoncvs@anoncvs.NetBSD.org:/cvsroot&lt;br /&gt;    cd /usr/local/pkgsrc&lt;br /&gt;    cvs update -A -Pd&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I hope others will find these useful but if not.. at least I've posted them somewhere so that I can find them easily instead of searching through my &lt;a href="http://www.tarsnap.com/"&gt;tarsnap&lt;/a&gt; archives.. ;-)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-1568967172459232504?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/1568967172459232504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2011/07/some-quick-functions-from-my-shrclocal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/1568967172459232504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/1568967172459232504'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2011/07/some-quick-functions-from-my-shrclocal.html' title='Some quick functions from my .shrc_local'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-8981303530258655893</id><published>2011-07-09T22:28:00.000-05:00</published><updated>2011-07-09T22:28:41.799-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Quickie'/><category scheme='http://www.blogger.com/atom/ns#' term='BSD'/><title type='text'>tmux is awesome: how I use it for development with web2py</title><content type='html'>Thank goodness for BSD hackers. GNU Screen is a very nice piece of software. Tmux, however, is flippin awesome. The simple concept of Windows with Panes is enough to make me forever discontent with the any other terminal multiplexer. It's a useful feature and one that I employ in many of my scripts.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-rNz17EtoGpU/ThkZTjCaYwI/AAAAAAAAABA/3a66944csdg/s1600/Screen+shot+2011-07-09+at+10.14.58+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://2.bp.blogspot.com/-rNz17EtoGpU/ThkZTjCaYwI/AAAAAAAAABA/3a66944csdg/s400/Screen+shot+2011-07-09+at+10.14.58+PM.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The above is an example of a multi-pane window. It's the result of the following script that I use when I do development in web2py. The left side can be used to track down debugging messages or even open a vi/vim session. The upper right pane is where my web2py server is running and I can pop in to restart it as needed. The middle and bottom right panes are used for making (frequent) commits my version control system of choice (&lt;a href="http://www.fowwil-scm.org/"&gt;fossil&lt;/a&gt;) and running tests (web2py makes it really easy to run tests from the command line).&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;TMUX Script:&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;#! /bin/sh&lt;br /&gt;&lt;br /&gt;create_session(){&lt;br /&gt;&lt;br /&gt;    #get to our main directory&lt;br /&gt;    cd ~/prog/web2py/generic&lt;br /&gt;&lt;br /&gt;    #Create new empty session (detached)&lt;br /&gt;    tmux new-session -d -s ${1}&lt;br /&gt;&lt;br /&gt;    #Split first window (vertically&lt;br /&gt;    tmux split-window -h  -t ${1}:0  '{&lt;br /&gt;        while [ "${restart_answer:-yes}" != "no" ]; do&lt;br /&gt;            ./web2py.py --no-cron -a "admin"&lt;br /&gt;            echo ""&lt;br /&gt;            echo "Press ENTER to restart web2py"&lt;br /&gt;            echo "Enter \"no\" to quit"&lt;br /&gt;            read restart_answer&lt;br /&gt;        done ;}'&lt;br /&gt;    &lt;br /&gt;    cd /Users/gcw/prog/web2py/generic/applications&lt;br /&gt;    tmux split-window -v -t ${1}:0 -p 65&lt;br /&gt;    tmux split-window -v -t ${1}:0 -p 50&lt;br /&gt;    tmux select-pane -t ${1}:0&lt;br /&gt;    &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;create_session web2py-generic&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;Everything get's started up in up in detatched mode which means that when I want to connect to it I just run 'tmux attach -t web2py-generic and I'm in.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-8981303530258655893?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/8981303530258655893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2011/07/tmux-is-awesome-how-i-use-it-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8981303530258655893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8981303530258655893'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2011/07/tmux-is-awesome-how-i-use-it-for.html' title='tmux is awesome: how I use it for development with web2py'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-rNz17EtoGpU/ThkZTjCaYwI/AAAAAAAAABA/3a66944csdg/s72-c/Screen+shot+2011-07-09+at+10.14.58+PM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-8156314928928920640</id><published>2011-06-26T12:17:00.001-05:00</published><updated>2011-06-26T12:20:59.450-05:00</updated><title type='text'>pkgsrc alogside homebrew</title><content type='html'>I live on the unix command line. Many mac users gasp in horror when the see me at a prompt that they think is "DOS" or something. They think I've broken my Macbook Pro and this is the way I 'fix' it. When I try to explain to them that I'm more at home with a keyboard and a blinking cursor than with a mouse/touchpad inside a GUI they just don't get it. On the other side you have people who say "well if you like the command line so much why not just use Ubuntu". The short answer is: with very few exceptions (Slackware, Gentoo and Funtoo), every Linux distribution I've used makes me want to slap the developers and stab the users/zealots who peddle that crap. &lt;b&gt;&amp;lt;FlameOff&amp;gt;&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;flame-retardant&gt;&lt;/flame-retardant&gt;&lt;/b&gt;The Linux kernel is nothing less than a coup, to be admired for all of the hours of sheer genius that resulted in the very rich functionality it holds. Why no Linux distributions are as equally inspiring a mystery. &lt;b&gt;&amp;lt;/FlameOff&amp;gt;&lt;/b&gt; Save your shouts of protest, I've used Redhat (before RHEL and Fedora after) , LinuxMint (hell I run one of the mirrors), Trisquel, Debian, YellowDog, Ubuntu, Mandrake, Mandriva, Yggdrasil, Suse and they all leave me running back to a good old sensible BSD&lt;b&gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;While I've never been much of a fan of NetBSD in particular, one would have to concede that they did a really good thing by making &lt;a href="http://www.netbsd.org/docs/software/packages.html"&gt;pkgsrc&lt;/a&gt; so flexible. The fact that runs on every modern Unix(-like) system is just plain awesome. Since OS X is Unix, pkgsrc just fits. I've used &lt;a href="http://finkproject.org/"&gt;fink&lt;/a&gt; (bleh), &lt;a href="http://www.macports.org/"&gt;macports&lt;/a&gt; (nice but much less flexible) and &lt;a href="http://mxcl.github.com/homebrew/"&gt;Homebrew&lt;/a&gt; (great but very incomplete). In fact I still use Homebrew as my defualt solution for unix tools. The problem is that they are pretty restrictive as to what they will accept and the formulae tend to be pretty slim on options. So when I need more flexibility in what available I reach for pkgsrc.&lt;br /&gt;&lt;br /&gt;One of the pluses with homebrew is that it expects to be installed in /usr/local and to have all of it's packages installed and linked under /usr/local/&lt;somedir&gt;. The kicker is that /usr/local should be set to permissions that allow an unprivileged user manage and install applications. All the others default to installing things as &lt;i&gt;root. &lt;/i&gt;My setup:&lt;/somedir&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Make sure&amp;nbsp;&lt;a href="http://developer.apple.com/xcode/"&gt;Xcode&lt;/a&gt;&amp;nbsp;is installed&lt;/li&gt;&lt;li&gt;As an admin user :&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sudo mkdir -p /usr/local/src&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sudo chown -R [USERID]:staff /usr/local/ &lt;/span&gt;#replace [USERID] with your normal user id&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sudo chmod 775 /usr/local/*&lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;As normal (unprivileged) user:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: small; line-height: normal;"&gt;&lt;a href="https://github.com/mxcl/homebrew/wiki/installation"&gt;Install homebrew&lt;/a&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Install git:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;brew install git&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;update brew formulae (just incase):&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;brew update&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;a href="http://www.netbsd.org/docs/software/packages.html#bootstrap"&gt;Install pkgsrc&lt;/a&gt;:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;cd /usr/local/&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;curl ftp://ftp.netbsd.org/pub/pkgsrc/pkgsrc-2011Q1/pkgsrc.tar.gz | tar xzvf -&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;cd pkgsrc/bootstrap&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;./bootstrap --pkgdbdir /usr/local/var/db/pkg --unprivileged --prefix /usr/local/pkg&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div&gt;At &amp;nbsp;step 3.4.2 we use the tarball path given at&amp;nbsp;http://www.netbsd.org/docs/software/packages.html#bootstrap This path will likely change in the near future. So get the latest copy for your purposes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In 3.4.4 we setup pkgsrc to install to /usr/local/pkg so more of our binaries will be in /usr/local/pkg/bin or /usr/local/pkg/sbin. It's important to modify your PATH and MANPATH variables. You generally want pkgsrc apps to be found AFTER their homebrew counterparts. If you don't know what those last to sentences mean, please stop before you break your computer.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the end you'll have a working pkgsrc install alongside your homebrew install. You can install packages from either system without needing to escalate to an administrative user.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-8156314928928920640?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/8156314928928920640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2011/06/pkgsrc-alogside-homebrew.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8156314928928920640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8156314928928920640'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2011/06/pkgsrc-alogside-homebrew.html' title='pkgsrc alogside homebrew'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-6569362367479534293</id><published>2011-03-20T14:52:00.003-05:00</published><updated>2011-03-22T22:28:21.244-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='posix'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Here Strings, echo, sed and ed</title><content type='html'>It's not uncommon to see people (mis)using sed in simple scripts to modify files. A pretty typical pattern is something like:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;for i in $({some operation that returns file names}) ; do&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sed -i -e 's/old/new/' ${1}&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For (at least) the BSD and GNU versions of &lt;i&gt;sed&lt;/i&gt;: &lt;b&gt;&lt;i&gt;-i&lt;/i&gt;&lt;/b&gt; means edit this file in place and &lt;b&gt;&lt;i&gt;-e&lt;/i&gt;&lt;/b&gt; simply tells it to execute the following command(s) on the file(s) given.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;UPDATE (03/22/11):&lt;/b&gt; To clarify, my point here is that using sed to edit files in place is bad practice, generally speaking. Creating a stream with which to edit the contents of one file as it's placed into a new file is not, here, my gripe.&lt;br /&gt;&lt;br /&gt;I've never been a fan of using sed in this manner. The reasons are many but let's go with "sed is a &lt;u&gt;&lt;b&gt;s&lt;/b&gt;&lt;/u&gt;tream &lt;u&gt;&lt;b&gt;ed&lt;/b&gt;&lt;/u&gt;itor and that's not a stream there". Basically the usage above is turning a specialized tool (stream editor) into a generic tool (file editor). Instead of overloading &lt;i&gt;sed&lt;/i&gt; with this type of work, I generally use &lt;i&gt;ed&lt;/i&gt; which was designed to edit files (not streams). I'd use something like:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;for i in $({some operation that returns file names}) ; do&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ed ${i} &amp;lt;&amp;lt;-EOF&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;%s/old/new/&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;w&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;q&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;EOF&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This usage is a bit more verbose but avoids ambiguity and possible incompatibility with&amp;nbsp;&lt;b&gt;&lt;i&gt;-i&lt;/i&gt;&lt;/b&gt;. While both BSD and GNU version of &lt;i&gt;sed&lt;/i&gt; have &lt;b&gt;&lt;i&gt;-i&lt;/i&gt;&lt;/b&gt; they implement it differently. The BSD version expects an extension for the backup file that's created. For GNUbies this probably isn't an issue. All of their systems are GNU/Linux and they only ever have to work with GNU &lt;i&gt;sed&lt;/i&gt;. For those of us who work on unix systems of various flavors it's a bit more pertinent.&lt;br /&gt;&lt;br /&gt;If you're working on the command line and don't want to bother with a multi-line &lt;b&gt;here document&lt;/b&gt; just to do a simple file edit you do have options.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;printf&lt;/i&gt; (both the shell built-in and standalone utility) can be used to reliably send control characters (including the newline character) to &lt;b&gt;STDOUT&lt;/b&gt; which can then be piped into the &lt;i&gt;ed&lt;/i&gt; command:&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;for i in $({some operation that returns file names}) ; do&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf '\%s/old/new/\nw\nq\n' | ed ${i}&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;done&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately you have to escape the &lt;b&gt;%&lt;/b&gt; character that you want passed through because otherwise it looks like you're saying '%s' which has special meaning for &lt;i&gt;printf&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Another option if you're using a modern ksh93 work-a-like is to use here strings in combination with string formatting:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;for i in $({some operation that returns file names}) ; do&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ed ${i} &amp;lt;&amp;lt;&amp;lt; $'%s/old/new/\nw\nq\n'&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;done&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-6569362367479534293?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/6569362367479534293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2011/03/here-strings-echo-sed-and-ed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6569362367479534293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6569362367479534293'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2011/03/here-strings-echo-sed-and-ed.html' title='Here Strings, echo, sed and ed'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-6851855956613416334</id><published>2010-12-11T13:40:00.000-06:00</published><updated>2010-12-11T13:40:27.200-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Software'/><category scheme='http://www.blogger.com/atom/ns#' term='Quickie'/><category scheme='http://www.blogger.com/atom/ns#' term='BSD'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Quick script to run Cherokee under runit</title><content type='html'>For one of my web services I'm using the &lt;a href="http://www.cherokee-project.com/"&gt;Cherokee&lt;/a&gt; web server, which just happens to be awesome. I don't want to run anything as root if I don't absolutely have to. &lt;a href="http://smarden.org/runit/"&gt;Runit&lt;/a&gt; gives one great flexibility in the way services are managed. Part of this flexibility is the ability to delegate to users what services they have runit supervise with their own instances of the superviser. I won't be discussing that just in this post. Instead let's look at &lt;i&gt;&lt;a href="http://smarden.org/runit1/chpst.8.html"&gt;chpst&lt;/a&gt;&lt;/i&gt;. This is a great little utility that comes with runit to allow you to start a process with different state attributes like user, group, memory, directory, and more. I use it to conditionally manage the start of the cherokee server thusly:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;# cat /var/service/cherokee/run&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#!/bin/sh&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/sbin:/usr/local/bin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;if [ $(id -u) -eq 0 ] ; then&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;chpst -u mirror:www cherokee -C \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /usr/local/etc/cherokee/cherokee.conf&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cherokee -C /usr/local/etc/cherokee/cherokee.conf&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This way, when root's supervisor process (re)starts the server the process has no elevated privileges. If any other user stops and restarts the process it executes normally with the privileges of that user. This setup means that we cannot run on port 80. As a remedy for this we run on port 8080 and redirect at the gateway.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-6851855956613416334?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/6851855956613416334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/12/quick-script-to-run-cherokee-under.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6851855956613416334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6851855956613416334'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/12/quick-script-to-run-cherokee-under.html' title='Quick script to run Cherokee under runit'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-3570159278802456761</id><published>2010-10-03T22:21:00.003-05:00</published><updated>2010-10-11T19:56:16.186-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='macports'/><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Quickie'/><category scheme='http://www.blogger.com/atom/ns#' term='BSD'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>quick start and stop functions for runit('s runsvdir)</title><content type='html'>I've been playing around with &lt;a href="http://mxcl.github.com/homebrew/"&gt;HomeBrew&lt;/a&gt; and I actually like it much more than I'd expected. I was in the process of migrating many services away from my &lt;a href="http://www.netbsd.org/docs/software/packages.html"&gt;pkgsrc&lt;/a&gt; and &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; setup and decided to write a couple of handy little shell functions to manage &lt;a href="http://smarden.org/runit/"&gt;runit&lt;/a&gt;:&lt;br /&gt;&lt;div class="p1"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&amp;nbsp;&lt;s&gt;1 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;#!/bin/ksh&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;2 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;my_pathadd PATH ~/bin ~/scripts ~/.bin&lt;/s&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;3&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;4&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;5 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;runit_start(){&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;6 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;#handy little function for starting runit on a service directory speified&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;7 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;#by ${SERVDIR}.&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;8 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;span class="s2"&gt;&lt;b&gt;&lt;s&gt;SERVDIR&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;="&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;/usr/local/var/service&lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;"&lt;/s&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;9 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;span class="s2"&gt;&lt;b&gt;&lt;s&gt;RUNSVCMD&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;="&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;runsvdir -P &lt;/s&gt;&lt;/b&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;${SERVDIR}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;"&lt;/s&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;10&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;11 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;if &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;{&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;ps -auxww |&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;${RUNSVCMD}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;|&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;-v '&lt;/s&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;'&amp;nbsp;&lt;/s&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;;&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;then&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;12 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;echo&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;'&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;already running&lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;'&lt;/s&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;13 &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;else&lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;14 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;echo&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;-n &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;"&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;starting runsvdir on &lt;/s&gt;&lt;/b&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;${SERVDIR}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;: &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;"&lt;/s&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;15 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;#nohup runsvdir -P ${SERVDIR} &amp;amp;&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;16 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;eval&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;nohup&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;${RUNSVCMD}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&amp;amp;&lt;/s&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;17 &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;fi&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;18 &lt;/s&gt;&lt;/b&gt;&lt;span class="s2"&gt;&lt;b&gt;&lt;s&gt;}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;19&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;20&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;21 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;runit_stop(){&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;22 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;#function to stop runit&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;23 &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;typeset&lt;/s&gt;&lt;/b&gt;&lt;span class="s2"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;i&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;24 &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;for &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;i &lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;in&lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;$(&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;ps -auxww&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;|&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;${RUNSVCMD}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;|&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;-v &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;'&lt;/s&gt;&lt;/span&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;'|&lt;/s&gt;&lt;/span&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;awk &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;'&lt;/s&gt;&lt;/span&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;{print $2}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;'&lt;/s&gt;&lt;/span&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;)&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s3"&gt;&lt;s&gt;;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;do&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;25 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;kill&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;-1&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;${i}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;26 &lt;/s&gt;&lt;/b&gt;&lt;span class="s3"&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;done&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;27 &lt;/s&gt;&lt;/b&gt;&lt;span class="s2"&gt;&lt;b&gt;&lt;s&gt;}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;28&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;29 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;s&gt;runit_status(){&lt;/s&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;30 &lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/s&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;{&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;ps -auxww|&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;span class="s4"&gt;&lt;b&gt;&lt;s&gt;${RUNSVCMD}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;|&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;-v '&lt;/s&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;grep&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;';&lt;/s&gt;&lt;span class="s5"&gt;&lt;b&gt;&lt;s&gt;}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;2&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;&amp;gt;&amp;nbsp;/dev/null ||&amp;nbsp;&lt;/s&gt;&lt;span class="s1"&gt;&lt;b&gt;&lt;s&gt;echo&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;&amp;nbsp;&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;"&lt;/s&gt;&lt;span class="s6"&gt;&lt;b&gt;&lt;s&gt;not running&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;s&gt;"&lt;/s&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;b&gt;&lt;s&gt;31 &lt;/s&gt;&lt;/b&gt;&lt;span class="s2"&gt;&lt;b&gt;&lt;s&gt;}&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="s2"&gt;&lt;b&gt;&lt;s&gt;&lt;br /&gt;&lt;/s&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Updated to be portable across KSH and ZSH.... I don't care enough about BASH to check compatibility there (10-11-10):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SERVDIR="/usr/local/var/service"&lt;br /&gt;RUNSVCMD="/usr/local/bin/runsvdir -P ${SERVDIR}"&lt;br /&gt;&lt;br /&gt;runit_start(){&lt;br /&gt;    #handy little function for starting runit on a service directory speified&lt;br /&gt;    #by ${SERVDIR}. &lt;br /&gt;    if { ps -auxww | grep "${RUNSVCMD}" | grep -v 'grep' 2&amp;gt; /dev/null ;} ; then&lt;br /&gt;        echo 'already running'&lt;br /&gt;    else &lt;br /&gt;        echo -n "starting runsvdir on ${SERVDIR}: "&lt;br /&gt;        #nohup runsvdir -P ${SERVDIR} &amp;amp;&lt;br /&gt;        eval nohup " " ${RUNSVCMD} &amp;amp;&lt;br /&gt;    fi&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;runit_stop(){&lt;br /&gt;    #function to stop runit&lt;br /&gt;    typeset i&lt;br /&gt;    for i in $(ps -auxww|grep "${RUNSVCMD}"|grep -v 'grep'|awk '{print $2}'); do&lt;br /&gt;        kill -1 ${i}&lt;br /&gt;    done&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;runit_status(){&lt;br /&gt;    { ps -auxww|grep "${RUNSVCMD}"|grep -v 'grep' 2&amp;gt; /dev/null ;} ||\&lt;br /&gt;        echo "not running"&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div bgcolor="#000000" text="#ffffff"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-3570159278802456761?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/3570159278802456761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/10/quick-start-and-stop-functions-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/3570159278802456761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/3570159278802456761'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/10/quick-start-and-stop-functions-for.html' title='quick start and stop functions for runit(&apos;s runsvdir)'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-8204185145985717782</id><published>2010-07-03T16:12:00.004-05:00</published><updated>2010-07-04T17:19:44.866-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Society'/><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><title type='text'>Dealing with the F'Idiots at the Woodfield Apple Store</title><content type='html'>&lt;ul&gt;&lt;li&gt;May 28th&amp;nbsp;&lt;/li&gt; &lt;ul&gt;&lt;li&gt;I make a trip to the local Apple Store (Woodfield Mall in Schaumburg, Il) and purchase a Mac Mini ($799)&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;June 15th&lt;/li&gt; &lt;ul&gt;&lt;li&gt;I find out that apple has just released details fo the new 'unibody aluminum' Mac Mini. There is no longer a $599 and $799 version.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;June 25th&lt;/li&gt; &lt;ul&gt;&lt;li&gt;After calling around to double check on the ability to exchange my Mac Mini from 5/28 with for a new one, I'm told that I can return and repurchase the same one that I have. This would result in a $100 credit going to me as a result of the End Of Life pricing on the product that I'd purchased previously. Alternately I can return the previous generation Mac Mini and get the new one with no problem.&lt;/li&gt;&lt;li&gt;I go to the Woodfield Apple Store:&lt;/li&gt; &lt;ul&gt;&lt;li&gt;Point of Sales system was down so we (about 20 customers) had to wait for that the be brought back up&amp;nbsp;&lt;/li&gt;&lt;li&gt;In talking to another customer trying to make a purchase while the POS was down we discovered that the Sales Rep who had tried to ring her up manually, ended up overcharging her by $100.&amp;nbsp;&lt;/li&gt;&lt;li&gt;While the system was still down I asked if it would be possible for them to start a memory upgrade and data swap so that things could be done in parallel. I was told that was not an option and I'd just have to wait.&amp;nbsp;&lt;/li&gt;&lt;li&gt;I finally get checked-out and I'm told that my memory upgrade and data swap will take about 2.5 to 3 hours. Based on this information I decide to hang around in the area and get some shopping done until my new Mac Mini is ready.&amp;nbsp;&lt;/li&gt;&lt;li&gt;3 hours later I get a call from a woman calling her self "Cat" saying that my data will take at least another 7 hours to transfer because they didn't know I had so much information on my system. I asked why I was told only 2.5 to 3 hours before and she said that she didn't know how much data was on there before the transfer started. When I asked why, when they figured out that it would take more than 3 hours, they hadn't called me to adjust my expectation, I got no direct reply. She continued on stating that my machine would need to be stuck in the store overnight to complete the transfer by morning. This was unacceptable. I asked about coming in and just getting my mac and transferring the critical pieces myself. She said the whole process would have to be started all over again. I told her that was on my way in and that I'd decide what to do when I go there. She said that she would keep the transfer in progress and not stop it until I let her know what I wanted to do.&lt;/li&gt;&lt;li&gt;15 minutes later I show up at the Woodfield Apple Store and ask a sales rep. who I can speak to about the data on my two Minis that was being transferred. The rep. disappears into the back room, then comes out and hands me my new aluminum Mac Mini. I asked him about the transfer and tell him that I'd been told it would take another 7 hours. He said that "Cat" told him that the transfer was done and that sometimes the calculation is off on the program that does the transfer. I asked him pointedly "Are you absolutely sure that all of my data has been transferred? I'd hate to find out that there was some sort of misunderstanding here". He replied that "Cat" had told him that the transfer was done and he trusts her when she says it. Based on his confidence in her word I decide to go and do some other shopping before returning home for the evening to take care of the dogs and get started on a project (part of the reason I needed to have the data transferred).&amp;nbsp;&lt;/li&gt;&lt;li&gt;2 hours later I return home, plug-in my Mac Mini and discover that my user account is there:&lt;/li&gt; &lt;ul&gt;&lt;li&gt;I log-in:&lt;/li&gt; &lt;ul&gt;&lt;li&gt;Looks good. I should be able to get some work done this evening&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Later I discover that my email application doesn't seem to be available. Then I notice that some settings are off. Suddenly I realize that not all of my data had been transferred. I did a quick &lt;i&gt;du -s&lt;/i&gt; on my home directory to see that only about 72 gigs of the 250gigs had been moved.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;I call the Woodfield Apple Store and end up speaking to a guy who identifies himself as "Tommy". Tommy tells me that he'll try to get to the bottom of what happened with 1) me being told 3 hours then 7 hours for a transfer time 2) me being told that everything had been transferred when it, in fact, had not and 3) what the Woodfield Apple Store could do to make sure that I got my data back. After being away from the phone for a bit he came back and said that he didn't know what the breakdown was between "Cat" and the sales rep. who had brought my mini to me but that if I wanted to come back to the store (in the 20 minutes left before they closed), they would make sure the transfer happened and I could pick up my machine int he morning. I told him that there was no way I could get back over there in that short period of time and that I'd been expecting to work (on my new Mac Mini) that evening. "Tommy" told me that he'd keep my Mac Mini there so that I could return anytime in the next couple of weeks to get my data transferred. He then asked me if I thought I'd be in on the next day (Sunday) to complete the transfer. I told him that there was no way I'd be able to be there the next day as I had things to do outside of dealing with the &lt;i&gt;magical and revolutionary customer support&lt;/i&gt; at the Woodfield Apple Store. He said that was fine and that I should just know that it will be there when I'm ready to come and transfer my data. I replied that it would most likely be on one of the next two weekends. He said that was fine.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;July 2nd I make an appointment at the genius bar because my one of the four USB ports doesn't seem to be functioning properly. When I arrive I speak to one of the geniuses who says that the unit will be replaced. I asked him about buying back my old Mac Mini that is waiting for me there so that I can just do the data transfer at home and return it when I'm done. He goes in back, then returns. He tells me that there is no Mac Mini back there waiting for me. Trying to refrain from putting my fist through the Genius Bar I say "are you flipp'n serious?". He is.&amp;nbsp;&lt;/li&gt; &lt;ul&gt;&lt;li&gt;Later he asks me if I want my data from the old aluminum Mac Mini transferred to the replacement they are giving me. Initially I said "yes, please" then I find out that they will do it the same way as they did the previous "transfer" and I changed my mind, stating that I didn't have any confidence that they could do so without screwing it up. I said that I'd just rather find out what happened with my old Mac Mini (the one purchased on May 28th) so that I can do the transfer from there.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;July 3rd I call up the Woodfield Apple Store to ask for "Tommy" and try to figure out what happened to my data. I get a manager named "Dan" who telle me that my Mac Mini from 5/28 has most likely been shipped back to Apple. He further states that he was told that I have a back-up of my data at home that I'd prefer to use rather than having them (do their f***ing job and) transfer my data. This struck me as odd given that I never told anyone that I had a backup. I did say that they were inept but I never said that I had a back up. "Dan" keeps telling me that from what he knows of the situation my data is basically gone and if I have any questions I can speak with "Tommy" tomorrow sometime. In his vast ineptitude he continually responded to my questions with answers to questions I'd never asked. When I told him that I'm trying to figure out why there seem to be so many issues of miscommunication there at that store he said "...if I could get your data back for you I would but I just don't have it here with me. Maybe Tommy did something with it and he can find it for you tomorrow". This is, of course a perfectly appropriate answer to the question that had been asked 5 minutes prior but for the question of "miscommunication"... uhmm all this response does is prove the necessity to figure out what the hell is wrong with the capacity of the employees at the Woodfield Apple Store to communicate effectively. They don't seem to listen. When I'd asked "is there anyone who can get in touch with Tommy so I can figure out what's going on with my data". He responded "Tommy is off today". To which I replied "Great now can you answer the question that I actually asked; I didn't ask whether he was off today I asked whether there was anyone who could get in touch with him.. ". Dealing with idiots is rather vexing. I think I'll have to have a shirt made up that says "I see dumb people (everytime I deal with the Woodfield Apple Store)"&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As it stands now I have to wait to talk to Tommy to figure out what happened to my data. Never mind the fact that I'm out of time and money on the project that I had to hand off to another party to complete because of apples' ineptitude. Do you think Apple will send me a $15K gift card to make up for the difference? No, I didn't think so.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If Apple hadn't pulled a time estimate out of their asses I could have made an informed decision to either transfer the key data myself &amp;nbsp;and leave the rest to be done later or decided to purchase back my old unit and do the transfer at home. If they hadn't lied to me by saying that the transfer had been completed when it hadn't I could have made arrangements get the key data and proceed with my work. In both cases I would have known not to continue shopping and running errands. I could have just gotten to business. Instead by trusting Apple employees to know WTF they were talking about, I ended up being screwed. Screwed out of time (which I'll never get back), money (which Apple is not likely to fork over to me), oh yeah and my flipp'n data which is apparently off in bit heaven. We'll know more tomorrow, hopefully.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's interesting to me that no one at the Apple Stores knows of anyway for customers to provide feedback on their customer experience other than the survey that may or may not come to you via email after you've completed a transaction there.&lt;br /&gt;&lt;br /&gt;UPDATE: according to the sales rep. that I just spoke to at 800-My-Apple. There is a Customer Relations Group to be sought by calling 408.996.1010. We'll see where this leads.&lt;br /&gt;&lt;br /&gt;UPDATE: Just about a hour ago I was informed that my data is likely unrecoverable. They have offered to take half off the cost of the Mac Mini that I'd purchased most recently. It's a bit insulting to think that they have cost me so extensively and move to remedy this by offering half of my money back without regard to the time and money I've been out as a result of trusting them.&lt;br /&gt;&lt;br /&gt;UPDATE: Yesterday (7/3/10) I got spoke to another manager at the Apple Store in Woodfield who was under the impression that I'd chosen to not have my data transferred and then got upset when I discovered that none of my data was available. I corrected his perception of the situation by going through the above time line. In the end I told him that the offer to just credit back half of the purchase price on the mac mini was insulting. I stated that I wanted something in writing detailing; 1) why I was told 2 - 3 hours given that it was obviously not a reasonable time frame to transfer my data; 2) why I hadn't been notified in advance of 3 hours passing that it would take 7 more hours than they had originally told me to complete the transfer; 3) Why it is that I was told my transfer had been completed when in fact it had not been completed; 4) Why I was told that my data would be maintained in the store for later retrieval when in fact it was not; 5) Why my data was not maintained in the store; 6) how this will be avoided in the future so that I can continue to patronize Apple in the future with confidence. I further added that if they were going to give me a credit they could also give me 50% off of the unit (Mac Mini) &amp;nbsp;I'd planned to purchase before all of this happened seeing as it was only because of this mishap that I haven't been able to make that purchase.&lt;br /&gt;&lt;br /&gt;This morning I received a voice mail from "Tommy" saying basically that Apple will give me 50% off of only one unit.. either the one I've already purchased or a new one. There was no mention of the statement of how this all happened or what will be done to make sure that it doesn't happen again. Personally, the credit/money is a much more minor issue than the issue of confidence, which is something that I told the last manager that I'd spoken to. Further "Tommy" added that "... unfortunately Apple is not responsible for lost data...". This just galls. 1) we're past the issue of just the lost data, we're on to the issue of the fact that Apple has told me several things that have turned out to be as far from reality as one can get without working as an intern for Carl Rove.&lt;br /&gt;&lt;br /&gt;I just called to reiterate to the a store manager that money is not my concern but that confidence is.. we'll see if they care enough to actually address the issue.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-8204185145985717782?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/8204185145985717782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/07/dealing-with-fidiots-at-woodfield-apple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8204185145985717782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8204185145985717782'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/07/dealing-with-fidiots-at-woodfield-apple.html' title='Dealing with the F&apos;Idiots at the Woodfield Apple Store'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-8596495688988117136</id><published>2010-06-19T00:24:00.001-05:00</published><updated>2010-06-19T00:27:29.852-05:00</updated><title type='text'>Apple's Mail app is Teh Suck</title><content type='html'>Just some quick thoughts of things I'd like for Apple's Mail.app to handle that it doesn't and probably never will. Considering that I got an iPad and had expected to use it as a great email device this list is particularly personal to me as Mail on the iPad is more ineptly equipped than Mail on Snow Leopard.&lt;br /&gt;&lt;br /&gt;IMNSHO Mail on the iPad and OS X should have:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Support for Multiple Identities&lt;/li&gt; &lt;ul&gt;&lt;li&gt;This is a no brainer. Every other mail application has had support for this feature since somewhere around 1997. Having multiple "From" addresses is not the same as multiple identities. The Latter includes changes to "Name", "From", "Signature", PGP-Key&lt;/li&gt;&lt;li&gt;There are multiple use cases for this&lt;/li&gt;&lt;li&gt;When I brought this up to the reps at the Apple Store their solutions were just ridiculous:&lt;/li&gt; &lt;ul&gt;&lt;li&gt;Create multiple 'sender accounts' that remain 'off line'&amp;nbsp;&lt;/li&gt;&lt;li&gt;Use MobileMe (don't know how that one was supposed to help)&lt;/li&gt;&lt;li&gt;Do things a different way&amp;nbsp;&lt;/li&gt;&lt;li&gt;Use GMail or Thunderbird&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;PGP/GPG Support&lt;/li&gt; &lt;ul&gt;&lt;li&gt;C'mon PGP's been around since I was in high school (and I'm in my 30s).&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Ability to display Full-Headers&lt;/li&gt; &lt;ul&gt;&lt;li&gt;It's useful.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;ServerSide Filter Support&lt;/li&gt; &lt;ul&gt;&lt;li&gt;Sieve plugins are available for most other Email Applications&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Associating a default email address with a particular mail folder&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm thinking of implementing the above in an app myself but with Apple's fickle approval process I'm reluctant to put in the time and effort only to be rejected for vague reasons.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Until I figure something else out, it's just mutt+msmtp, which I love by the way.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-8596495688988117136?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/8596495688988117136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/06/things-that-bug-me-about-apple-mail.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8596495688988117136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8596495688988117136'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/06/things-that-bug-me-about-apple-mail.html' title='Apple&apos;s Mail app is Teh Suck'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-573245665710005255</id><published>2010-06-11T08:07:00.000-05:00</published><updated>2010-06-11T08:07:07.529-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Quickie'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><title type='text'>The most significant issue with Google dropping Microsoft</title><content type='html'>Admittedly, I've not been following the fall out over Google ditching Microsoft with much interest so it's a certainty that I've missed much commentary on the topic. That said: I'm surprised that in the main stream coverage that I have seen, there was no mention of what I believe to be the most important consequence of Big Search's decision.&lt;br /&gt;&lt;br /&gt;Some contend that MS Windows is no less secure than any other operating system. While I do not agree with this sentiment, I understand the rationale that with popularity and wide adoption any system can become a more attractive target than others in the same space. As such MS Windows with it's domination of the corporate and home desktop market offers a potentially worthy return on investment for an attacker looking for system to compromise. By this reasoning, Google being a very large enterprise has just painted a huge target on the back of Linux and Mac OS X (users) by making it public knowledge that they will offer only those two options, for desktop computing, to employees. Now attackers know that they have at least one very large and attractive target with millions (yes millions) of computing devices running one of two (not too dissimilar) operating systems that would otherwise not be worth investing the time in compromising.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Just a thought&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-573245665710005255?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/573245665710005255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/06/most-significant-issue-with-google.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/573245665710005255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/573245665710005255'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/06/most-significant-issue-with-google.html' title='The most significant issue with Google dropping Microsoft'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-141163366517927084</id><published>2010-06-08T00:03:00.000-05:00</published><updated>2010-06-08T00:05:08.771-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><title type='text'>Blog migration (yes again)</title><content type='html'>I just recently migrated to blogging solution number 5. Well 5 in the last 2 years. I won't count the time on Zope/Plone (which I really liked). I loath MySQL and PHP so I was never find of running Word Press on my network. Having moved to a hosted solution I can now remove the MySQL instances from my network and uninstall all things PHP.... well most things PHP.&lt;br /&gt;&lt;br /&gt;I'm actually working on a blog solution of my own in Python that I hope to have ready by year's end.&lt;br /&gt;&lt;br /&gt;Oh well. For now this is the new home of Not A Discussion. Let's see how long this lasts. &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-141163366517927084?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/141163366517927084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/06/blog-migration-yes-again.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/141163366517927084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/141163366517927084'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/06/blog-migration-yes-again.html' title='Blog migration (yes again)'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-1959133032996805188</id><published>2010-05-16T19:37:00.000-05:00</published><updated>2010-06-07T18:53:50.183-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='BSD'/><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><title type='text'>your interview questions can leave you without qualified talent</title><content type='html'>As a consultant I've been subjected to many technical screenings which have often felt more like interrogations than honest evaluations of my technical merits. One problem is that often people who conduct interviews for technical positions are often not (as) technical (as the party being interviewed). A device often used in such cases is a list of interview questions. The idea being that anyone (technical or not) can ask a set of simple, very narrowly defined, interview questions and from the answers provided determine a candidates ability to perform well in the capacity for which talent is sought. This approach is grossly overused and abused especially in IT, IS, MIS, ISS, etc.&lt;br/&gt;&lt;h2&gt;Scenario&lt;/h2&gt;&lt;br/&gt;Interviewer: tell me Mr. Williams how would you, while on a Solaris 6 machine, view network traffic to determine what was the cause of your network connections to host xyz failiing? Is there any tool that you would use to see what might be happening on the wire?&lt;br/&gt;Candidate: Well sure, I might start by first determining whether I'm getting a timeout or a connection refused, then I'd take a look at the network traffic with tcpdump if I had root privileges on the machine.&lt;/pre&gt;&lt;br/&gt;Interviewer: Is that the only tool you'd use to look at the traffic?&lt;/pre&gt;&lt;br/&gt;Candidate: From the wire; yes. I might save it to a file and process the information with other tools but tcpdump will grab everything that I need so form that point its just a matter of extracting and interpreting it.&lt;/pre&gt;&lt;br/&gt;Interviewer: I'm sorry but that's not right&lt;/pre&gt;&lt;br/&gt;Candidate: What's not right?&lt;/pre&gt;&lt;br/&gt;Interviewer: tcpdump is not the right answer. I was looking for snoop. You're obviously not a good fit.&lt;br/&gt;&lt;h3&gt;evaluation&lt;/h3&gt;&lt;br/&gt;&lt;br/&gt;In this situation &lt;em&gt;Candidate&lt;/em&gt; gave a perfectly valid answer and one that was applicable to multiple systems. &lt;em&gt;Interviewer&lt;/em&gt; had only worked in an environment with Solaris and assumed that anyone who's worked with Solaris would use snoop (which is specific to Solaris). He had never before heard of tcpdump and didn't know that it serves the same function as snoop. As a result he didn't recognize the validity of answer that was more right than the one he was expecting and dismissed a candidate with greater experience and merit than his own.&lt;br/&gt;&lt;br/&gt;This sort of thing happens all the time. I've both witnessed and been subject to it repeatedly. Whether it's tcpdump v. snoop, od v. hexdump, ed v. ex it's all frustratingly common and really should be stopped.&lt;br/&gt;&lt;h2&gt;The Problem&lt;/h2&gt;&lt;br/&gt;Even when the people asking the questions are themselves technical, and in some cases especially so, there is a tendency, in many cases, to expect a specific (set of) answer(s) as opposed to evaluating what's said by the candidate to determine whether it might actually be right. In the Unix/Linux world this problem is compounded by the fact that there are so many ways to get things done in general and each type of system might have several idiosyncratic ways to achieve something in a way that's specific to that particular family of systems and no others.&lt;br/&gt;&lt;h2&gt;What it is that they're after&lt;/h2&gt;&lt;br/&gt;Some interviewers just want to feel superior. They get their sense of importance from being in what they perceive as a position of power. That is an individual issue. The organization is usually looking for someone who can perform well in the position for which they are looking to hire. This is where the whole issue of litmus test questions starts to break down most often.&lt;br/&gt;&lt;br/&gt;It's only natural to presume that if you have an open position, one way to make sure that you hire a qualified candidate is to find someone who's doing or had done exactly the same thing. It's rare but it does happen. More often than not it's the case that you have to interview candidates who display the skills required to perform well in a given role and make a determination based on their experience in several areas as opposed to one given thing. This requires much more insight into their background than can be had from just going down a predetermined list of queries.&lt;br/&gt;&lt;h2&gt;Don't get it twisted&lt;/h2&gt;&lt;br/&gt;I'm not saying that no one should use a list of questions when they go into an interview. Sometimes people purposely ask vague and open questions to see how a person thinks or to find out what assumptions the candidate will make. This is a perfectly useful technique when appropriately qualified. Unfortunately too many people feel empowered by their interview questions and don't do enough to make sure that they are used effectively. Having a good set of key points to be covered is a great way to make sure that you're comfortable with the decision you make about a candidate. The point here is that interviews (particularly those for technical positions) are not conducted like hollywood read-throughs. They are not pre-scripted.&lt;br/&gt;&lt;h2&gt;Tips for successful evaluation of technical candidates&lt;/h2&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;Be specific - If you're asking technical questions you should provide some context. Let the candidate know what your assumptions are about the environment.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Listen - If you ask a question learn how to listen to and evaluate the answer&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Let them have rope - Giving someone enough rope to hang themselves might also mean they have enough to swing to safety. Ask open but pointed questions that allow a candidate to expound.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Do your research - If you're looking for a specific response to a question you should make sure that you know what all of the appropriate responses are. Saying "well I've been doing this for 12 years" does not count as research.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Get ready to be wrong - Letting a candidate prove that their solution is valid is sometimes the only way to know that they know what they are talking about. While not alway practical it's valuable at times.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;Happy head hunting&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-1959133032996805188?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/1959133032996805188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/05/your-interview-questions-can-leave-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/1959133032996805188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/1959133032996805188'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/05/your-interview-questions-can-leave-you.html' title='your interview questions can leave you without qualified talent'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-7004406074048781903</id><published>2010-04-18T12:30:00.000-05:00</published><updated>2010-06-07T18:53:50.174-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gadgets'/><title type='text'>Palm Pre extended battery</title><content type='html'>Palm has made a number of critical blunders in their handling of the Palm Pre and the Pixi; to say nothing of the handling of the company overall. One such blunder IMNSHO was the battery. It would have been perfectly acceptable to have an option at purchase for either a &lt;em&gt;slim&lt;/em&gt; battery or an &lt;em&gt;extended life&lt;/em&gt; battery. Consumers would have been empowered to choose for themselves similarly to the way they could have opted to get the Touchstone Charger. Instead, Palm decided that all of these wonderful features that they managed to jam in to such a tiny little package, should be enjoyed 3 - 4 hours at a time.&lt;br/&gt;&lt;h2&gt;Remedy&lt;/h2&gt;&lt;br/&gt;Thankfully two companies have stepped up to the plate and filled a void created by Palm's chronic myopia. Seidio and Amzer both have extended batteries for the Pre and Pixi. While Amzer has higher capacity offerings in this space, Seidio has more attractive pricing. The standard Pre/Pixi battery is 1150mAh which is fine for a feature phone that won't be doing much online. Wow I just described the Palm Centro which, BTW, has a 1150mAh battery that will fit into the Palm Pre/Pixi.&lt;br/&gt;&lt;h3&gt;Seidio Offerings:&lt;/h3&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;a href="http://www.seidioonline.com/product-p/basi13pmx4.htm" target="_blank"&gt;Innocell 1350 mAh&lt;/a&gt; ( ~ 1.17 x stock battery life)  Fits with standard battery cover&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;a href="http://www.seidioonline.com/product-p/bacy26pmpre-bk.htm" target="_blank"&gt;Innocell 2600 mAh&lt;/a&gt; ( ~ 2.26 x stock battery life) Comes with larger battery cover&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;h3&gt;Amzer Offerings:&lt;/h3&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;a href="http://www.amzer.com/Amzer-SmartCell-1400-mAh-Slim-Extended-Battery-P83629.htm" target="_blank"&gt;Smartcell 1400 mAh&lt;/a&gt; (~ 1.21 x stock battery life) Fits with standard battery cover&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;a href="http://www.amzer.com/Amzer-SmartCell-2800-mAh-Lithium-Ion-Extended-Battery-with-Black-Battery-Door-P83630.htm" target="_blank"&gt;Smartcell 2800 mAh&lt;/a&gt; (~ 2.43 x stock battery life) Comes with larger battery cover&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;a href="http://www.amzer.com/Amzer-SmartCell-3800-mAh-Lithium-Ion-Extended-Battery-with-Black-Battery-Door-P84080.htm" target="_blank"&gt;Smartcell 3800 mAh&lt;/a&gt; (~ 3.03 x stock battery life) Comes with larger battery cover&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;I purchased the Innocell 2600 mAh and have been very pleased with it. At the time of purchase it was around $65 from the precentral.net store. The larger battery cover makes the phone appreciably larger. Because of the great design of the Seidio's replacement cover, the phone looks completely normal just a little bulkier. The contour and curve is great and it feels nice in hand.&lt;br/&gt;&lt;h2&gt;Real world Usage&lt;/h2&gt;&lt;br/&gt;When the Inocell 2600 mAh arrived, I immediately put it on the charger for a full 24 hours. The first day I used it, I was quite shocked to find that even though I'd been using the phone durring my whole hour long commute I still had more than 80% of the battery life left. Throughout the day I put the phone through moderate online use but checking email frequently and using the Facebook and various twitter applications. For the whole of the day while I was at work, I refused to plug in my phone to charge it. On my train ride home I finally got the 20% battery life warning. This was over 10 hours after I'd initially set out with the phone and new battery. Finally after about 12 hours of use I had to pop the battery out, put it in the charger and switch over to the original which had been charging while I was out.&lt;br/&gt;&lt;h2&gt;Tips&lt;/h2&gt;&lt;br/&gt;&lt;ol&gt;&lt;br/&gt;	&lt;li&gt;No matter which battery you get, I highly recommend you get a a standalone wall charger. Both Seidio and Amzer sell them (they look very similar)&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Charging by USB is generally (much) slower than using the wall outlet&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Charge your new battery for at least 8 hours before you start using it. If the package says 24 hours then charge it for 24 hours&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Keep your original battery and cover&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;Tethering and bluetooth are battery hogs&lt;/li&gt;&lt;br/&gt;&lt;/ol&gt;&lt;br/&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br/&gt;I'm generally quite pleased with my decision to get the Innocell 2600 mAh. If I had one complaint it would be that Seidio doesn't offer an even higher capacity battery for the Pre/Pixi. I could have purchased one of the Amzer offerings but I have familiarity with Seidio and I trust the brand. Their products are well regarded. Amzer is a company I hadn't heard of until just recently and their websites and product images don't do much to instill confidence. Amzer's product labeling looks tacky, their website equally so. Perhaps in the future Seidio will offer something in the 3000+ mAh range, hopefully soon. Until then I'm ordering another Innocell 2600 mAh.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-7004406074048781903?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/7004406074048781903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/04/palm-pre-extended-battery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7004406074048781903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7004406074048781903'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/04/palm-pre-extended-battery.html' title='Palm Pre extended battery'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-7596866537087747177</id><published>2010-01-18T00:23:00.000-06:00</published><updated>2010-06-07T18:53:50.164-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Software'/><category scheme='http://www.blogger.com/atom/ns#' term='BSD'/><title type='text'>Upgraded Dovecot on FreeBSD and Sieve stopped working (Fixed)</title><content type='html'>I recently upgraded Dovecot (1.1x to 1.2(.8)) on FreeBSD (7.2) and had a slew of issues.&lt;br/&gt;&lt;h2&gt;Postfix wasn't delivering messages&lt;/h2&gt;&lt;br/&gt;This was because Dovecot wasn't starting and Postfix couldn't get the SASL connection that it needed. The fix was to upgrade/install both dovecot &lt;strong&gt;and&lt;/strong&gt; dovecot-sieve ( I use Dovecot's &lt;em&gt;deliver&lt;/em&gt; as my Local Delivery Agent (LDA) ). The FreeBSD port/package has dropped support for cmu-sieve in favor of dovecot-sieve. So The first thing do to is &lt;a href="http://wiki.dovecot.org/LDA/Sieve/Dovecot#Migration_from_CMUSieve" target="_blank"&gt;make the switch&lt;/a&gt; to dovecot-sieve.&lt;br/&gt;&lt;br/&gt;After some quick config file changes you'll be able to start Dovecot and consequently postfix should be able to come up with out a hitch and start delivery of messages ( in my case I had some permission issues to contend with and you may too, but since it's a highly individualized thing I'm not going into that issue here).&lt;br/&gt;&lt;h2&gt;Problems with Sieve Filters in Dovecot&lt;/h2&gt;&lt;br/&gt;This was a nightmare. Dovecot's deliver was actually delivering messages but not to the folders specified in the filters. First thing I did was turn on debugging.&lt;br/&gt;&lt;pre&gt;mail_debug = yes&lt;/pre&gt;&lt;br/&gt;Then I noticed this message in the log files&lt;br/&gt;&lt;pre&gt;Error: sieve: path to user's main active personal script is unknown. See http://wiki.dovecot.org/LDA/Sieve/Dovecot#configuration&lt;/pre&gt;&lt;br/&gt;This was fixed by adding / to the beginning of  the "sieve" parameter in dovecot.conf (remember that paths are relative to mail_chroot):&lt;br/&gt;&lt;pre&gt;sieve = /%d/%u/.dovecot.sieve&lt;/pre&gt;&lt;br/&gt;That fixed one issue. The next error message I got was:&lt;br/&gt;&lt;pre&gt;Error: sieve: failed to open script /&lt;em&gt;&amp;lt;userdir&amp;gt;&lt;/em&gt;/.dovecot.sieve (view logfile /&lt;em&gt;&amp;lt;userdir&amp;gt;&lt;/em&gt;/.dovecot.sieve.log for more information)&lt;/pre&gt;&lt;br/&gt;turns out that (on my system anyway) despite the fact that wiki.dovecot.com claims that dovecot-sieve supports imapflags and notify including those in your sieve scripts may cause issues. If you have older scripts in use form before you'll need to make suer that they don't include those extensions.  I hope this posting helps others save some time and energy as it was a non trivial task to trouble shoot my installation and figure out what was gong on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-7596866537087747177?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/7596866537087747177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2010/01/upgraded-dovecot-on-freebsd-and-sieve.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7596866537087747177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7596866537087747177'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2010/01/upgraded-dovecot-on-freebsd-and-sieve.html' title='Upgraded Dovecot on FreeBSD and Sieve stopped working (Fixed)'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-4001288746765101966</id><published>2009-11-17T08:06:00.000-06:00</published><updated>2010-06-07T18:53:49.957-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='BSD'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>one .profile to rule them all</title><content type='html'>I got sick of having to try to copy and make major modifications for each environment that I was in. As a consultant I sometimes have to deal with ridiculous policy driven constraints as to what software I can or cannot use. Sometimes it's simply ignorance (like when the CTO of a company said that I could only script in a "...standard shell like BASH..." nothing obscure like KSH) but whatever the case it's a pain when you've grown accustom to something as personal as your shell settings. Now I have a solution.&lt;br/&gt;&lt;br/&gt;The shell is often taken for granted by many a unix user. Some (dare I say most) don't even think about the shell they're using until they try a feature that they've seen somewhere and realize that it doesn't work. Others have extreme bias toward a family of shells basically C(sh) derived shells (Csh, TCsh, Zsh??, etc) vs bourne-like shells (Ksh, BAsh, Zsh??, Ash, DAsh, etc). Still others want a specific version of a particular shell. Because so much functionality has cross-pollenated the shell landscape it can be rather vexing to discover that one feature you've come to expect form &lt;em&gt;your&lt;/em&gt; shell isn't available in the shell you're currently stuck using, or maybe has a different syntax or is otherwise mysteriously incongruent with your habits.&lt;br/&gt;&lt;br/&gt;Well I can't solve all of your problems with shells. What I can do however is make shell initialization easier (for myself and hopefully for you as well) with a new hefty .profile/.shrc file. Each shell has it's own rules on how it uses profile and rc files. In the past there were things that you'd absolutely want to have only in one and not the other. These days things are different and in many cases it's okay to have the same file meet both needs. That is, unless your shell double invokes your initialization script(s); then you're just wasting resources.&lt;br/&gt;&lt;br/&gt;My solution came about because I wanted uniform functionality across the various platforms I use (Darwin/OS X, FreeBSD, OpenBSD, Solaris, HP-UX, and various flavors of Linux) as well as what ever shells I may be forced to use . I prefer ZSH and/or KSH93, but am often stuck with BASH, DASH, ASH, or PDKSH. Rarely am I lucky enough to have MKSH. So I created the following:&lt;br/&gt;&lt;pre&gt;#Title: N/A&lt;br/&gt;#Author:    G. Clifford Williams&lt;br/&gt;#Purpose:   used as a .shrc or .profile this script initializes interactive&lt;br/&gt;#           shell sessions with the specified configuration determined by&lt;br/&gt;#           Operating System and/or shell implementation. In particular this&lt;br/&gt;#           script is for shells that implement the POSIX&lt;br/&gt;#           This Part&lt;br/&gt;&lt;br/&gt;#-----------------------------------------------------------------------------#&lt;br/&gt;#------------------------------------INIT-------------------------------------#&lt;br/&gt;#-----------------------------------------------------------------------------#&lt;br/&gt;    #This section checks to see whether the file has been read already. If so&lt;br/&gt;    #it exits (using the return command) with a nice message. It works by&lt;br/&gt;    #setting a variable named for the pid of the current shell ($$). If the&lt;br/&gt;    #variable is not empty the the file has been processed before.&lt;br/&gt;    #this makes one file suitable for both .provile and .shrc use&lt;br/&gt;[ "$(eval "echo \${my_${$}}")" = "processed" ] &amp;amp;&amp;amp; \&lt;br/&gt;        { echo "already read for my_${$}"; return 1;}&lt;br/&gt;&lt;br/&gt;eval "my_${$}=processed"&lt;br/&gt;&lt;br/&gt;#-----------------------------------------------------------------------------#&lt;br/&gt;#-------------------------------RUN MODE CHECK--------------------------------#&lt;br/&gt;#-----------------------------------------------------------------------------#&lt;br/&gt;case "$-" in&lt;br/&gt;    #This section checks for the 'interactive mode' flag in the '$-' variable&lt;br/&gt;    #By checking the my_INTERACTIVE variable you can set chunks of code to&lt;br/&gt;    #be conditional on the manner in which the shell was invoked&lt;br/&gt;&lt;br/&gt;    *i* )&lt;br/&gt;            my_INTERACTIVE="yes"&lt;br/&gt;            ;;&lt;br/&gt;    * )&lt;br/&gt;            my_INTERACTIVE="no"&lt;br/&gt;            ;;&lt;br/&gt;esac&lt;br/&gt;&lt;br/&gt;#-----------------------------------------------------------------------------#&lt;br/&gt;#------------------------------------FUNCTIONS--------------------------------#&lt;br/&gt;#-----------------------------------------------------------------------------#&lt;br/&gt;my_lecho(){&lt;br/&gt;    [ -n my_SILENT ] || echo "$(date +%H:%M:%S)|$@"&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;my_pathadd(){&lt;br/&gt;    my_tmp1=$1&lt;br/&gt;    shift&lt;br/&gt;    case $my_tmp1 in&lt;br/&gt;        LUA_PATH)&lt;br/&gt;            my_OFS=";"&lt;br/&gt;            ;;&lt;br/&gt;        *)&lt;br/&gt;            my_OFS=":"&lt;br/&gt;            ;;&lt;br/&gt;    esac&lt;br/&gt;&lt;br/&gt;    for PATH_add in $@; do&lt;br/&gt;        if eval "[ -n \"\${$my_tmp1}\" ]" ; then&lt;br/&gt;            if [ -d ${PATH_add} ] ; then&lt;br/&gt;                eval "$my_tmp1=\"\${$my_tmp1}${my_OFS}${PATH_add}\""&lt;br/&gt;            else&lt;br/&gt;                echo "path ($PATH_add) not valid"&lt;br/&gt;            fi&lt;br/&gt;        else&lt;br/&gt;            eval "$my_tmp1=$PATH_add"&lt;br/&gt;        fi&lt;br/&gt;    done&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;my_cleanpath(){&lt;br/&gt;    #function to set a very basic PATH&lt;br/&gt;    PATH=/bin:/usr/bin:/sbin:/usr/sbin&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;my_getshell(){&lt;br/&gt;    ps -p $$ |\&lt;br/&gt;        awk '/sh/ {&lt;br/&gt;            for (i=1;i&amp;lt;=NF;i++){                 if (match($i,/[[:alnum:]]*sh/)){                     sub(/\)/,"",$i);                     print substr($i,RSTART);                     exit;                 }             }         }' } #-----------------------------------------------------------------------------# #-------------------Universal/Generic Settings--------------------------------# #-----------------------------------------------------------------------------# #------Get our SHELL-----# [ -n $my_SHELL ] &amp;amp;&amp;amp; my_SHELL=$(my_getshell) #-----Get our OS-----# my_OS=$(uname)  #----Get our username----# #my_usrname=$(whoami) my_USERNAME=$(id -u) #------Set EDITOR(s)-----# if { which vim 2&amp;gt; /dev/null  1&amp;gt; /dev/null ;}; then&lt;br/&gt;    EDITOR=vim&lt;br/&gt;else&lt;br/&gt;    EDITOR=vi&lt;br/&gt;fi&lt;br/&gt;FCEDIT=$EDITOR&lt;br/&gt;HISTEDIT=$EDITOR&lt;br/&gt;export EDITOR&lt;br/&gt;export FCEDIT&lt;br/&gt;export HISTEDIT&lt;br/&gt;#------Set EDITOR-----#&lt;br/&gt;if { which less 2&amp;gt; /dev/null 1&amp;gt; /dev/null;}; then&lt;br/&gt;    PAGER=less&lt;br/&gt;else&lt;br/&gt;    PAGER=more&lt;br/&gt;fi&lt;br/&gt;export PAGER&lt;br/&gt;&lt;br/&gt;my_FULLHOSTNAME=$(hostname)&lt;br/&gt;my_HOST=${my_FULLHOSTNAME%%.*}&lt;br/&gt;my_DOMAIN=${my_FULLHOSTNAME#*.}&lt;br/&gt;#HISTFILE=${HOME}/.sh_history&lt;br/&gt;my_NEWLINE="&lt;br/&gt;"&lt;br/&gt;#SSH AGENT STUFF&lt;br/&gt;#sagent.sh -T &amp;amp;&amp;amp; . ~/.sagent_info || { sagent.sh -s &amp;amp;&amp;amp; . ~/.sagent_info ; }&lt;br/&gt;&lt;br/&gt;case ${my_OS:-unset} in&lt;br/&gt;    Darwin )&lt;br/&gt;        #-------OS X Specifics-------#&lt;br/&gt;        my_pathadd PATH /usr/pkg/bin&lt;br/&gt;        # MacPorts Installer addition on 2009-01-19_at_01:36:04: adding an appropriate PATH variable for use with MacPorts.&lt;br/&gt;        export PATH=/opt/local/bin:/opt/local/sbin:$PATH&lt;br/&gt;        # Finished adapting your PATH environment variable for use with MacPorts.&lt;br/&gt;        # MacPorts Installer addition on 2009-01-19_at_01:36:04: adding an appropriate MANPATH variable for use with MacPorts.&lt;br/&gt;        export MANPATH=/opt/local/share/man:$MANPATH:/usr/pkg/man&lt;br/&gt;        # Finished adapting your MANPATH environment variable for use with MacPorts.&lt;br/&gt;        export LC_CTYPE=en_US.UTF-8&lt;br/&gt;        ;;&lt;br/&gt;    FreeBSD )&lt;br/&gt;        #-------FreeBSD Specifics-------#&lt;br/&gt;        BLOCKSIZE=K&lt;br/&gt;        export BLOCKSIZE&lt;br/&gt;        my_cleanpath&lt;br/&gt;        my_pathadd PATH /usr/local/bin /usr/local/sbin&lt;br/&gt;        ;;&lt;br/&gt;    Linux )&lt;br/&gt;        #-------Linux Specifics-------#&lt;br/&gt;        my_cleanpath&lt;br/&gt;        my_pathadd PATH /usr/local/bin /usr/local/sbin&lt;br/&gt;        ;;&lt;br/&gt;    CYGWIN_NT-5.1 )&lt;br/&gt;        #-------CygWin Specifics-------#&lt;br/&gt;        CYGWIN=tty ; export CYGWIN&lt;br/&gt;        ;;&lt;br/&gt;esac&lt;br/&gt;&lt;br/&gt;case ${my_SHELL:-unset} in&lt;br/&gt;    zsh )&lt;br/&gt;        #--------Z SHELL--------#&lt;br/&gt;        my_lecho "initializing ZSH"&lt;br/&gt;        PATH=$PATH:${HOME}/scripts&lt;br/&gt;        # Lines configured by zsh-newuser-install&lt;br/&gt;        HISTFILE=~/.zsh_history&lt;br/&gt;        HISTSIZE=2500&lt;br/&gt;        SAVEHIST=1000000&lt;br/&gt;        setopt appendhistory notify&lt;br/&gt;        bindkey -v&lt;br/&gt;        # End of lines configured by zsh-newuser-install&lt;br/&gt;        # The following lines were added by compinstall&lt;br/&gt;        zstyle :compinstall filename '/cygdrive/c/.zshrc'&lt;br/&gt;        autoload -Uz compinit&lt;br/&gt;        compinit&lt;br/&gt;        # End of lines added by compinstall&lt;br/&gt;        PS1="[%n@%m:%/&amp;gt;${my_NEWLINE}%# "&lt;br/&gt;        ENV=${HOME}/.zshrc&lt;br/&gt;        export ENV&lt;br/&gt;        ;;&lt;br/&gt;    bash )&lt;br/&gt;        #--------Bourne Again SHELL--------#&lt;br/&gt;        my_lecho "initializing BASH"&lt;br/&gt;        set -o vi #vi mode editing&lt;br/&gt;        set -b #immediate background job reporting&lt;br/&gt;        set -B #brace expansion&lt;br/&gt;        BASH_ENV=${HOME}/.bashrc&lt;br/&gt;        export BASH_ENV&lt;br/&gt;        #source the BASH_ENV if it's readable&lt;br/&gt;        [ -r ${BASH_ENV} ] &amp;amp;&amp;amp; . ${BASH_ENV}&lt;br/&gt;        HISTFILE=${HOME}/.bash_history&lt;br/&gt;        HISTSIZE=2500&lt;br/&gt;        HISTFILESIZE=100000&lt;br/&gt;        PS1="[\u@\h:\w&amp;gt;\n\$ "&lt;br/&gt;        ;;&lt;br/&gt;    *ksh )&lt;br/&gt;        #--------Korn SHELL--------#&lt;br/&gt;        my_lecho "initializing KSH (or something pretending to be it)"&lt;br/&gt;        set -o vi #vi mode&lt;br/&gt;        set -o bgnice #nice background processes&lt;br/&gt;        set -b #immediate background job reporting&lt;br/&gt;        ENV=${HOME}/.kshrc&lt;br/&gt;        export ENV&lt;br/&gt;        HISTFILE=${HOME}/.ksh_history&lt;br/&gt;        HISTSIZE=2500&lt;br/&gt;        HISTFILESIZE=100000&lt;br/&gt;        PS1='$(whoami)@$(hostname -s):$(pwd)&amp;gt; '&lt;br/&gt;        case $(id -u) in&lt;br/&gt;            0 ) PS1="${PS1}${my_NEWLINE}# ";;&lt;br/&gt;            * ) PS1="${PS1}${my_NEWLINE}$ ";;&lt;br/&gt;        esac&lt;br/&gt;        ;;&lt;br/&gt;    * )&lt;br/&gt;        #--------GENERIC SHELL--------#&lt;br/&gt;        my_lecho "initializing unknown shell"&lt;br/&gt;        set -o vi&lt;br/&gt;        HISTFILE=${HOME}/.sh_history&lt;br/&gt;        HISTSIZE=2500&lt;br/&gt;        HISTFILESIZE=100000&lt;br/&gt;        ENV=${HOME}/.shrc&lt;br/&gt;        export ENV&lt;br/&gt;        #PS1='$(whoami)@$(hostname -s):$(pwd)&amp;gt;'&lt;br/&gt;        PS1="$my_USERNAME@$my_HOST&amp;gt; "&lt;br/&gt;        ;;&lt;br/&gt;esac&lt;br/&gt;&lt;br/&gt;#-------After all is said and done-------#&lt;br/&gt;my_pathadd PATH ~/bin ~/scripts ~/.bin&lt;br/&gt;&lt;br/&gt;#-------Domain specific RC-------#&lt;br/&gt;[ -r ${HOME}/.shrc_${my_DOMAIN} ]  &amp;amp;&amp;amp; .  ${HOME}/.shrc_${my_DOMAIN}&lt;br/&gt;#-------HOST specific RC-------#&lt;br/&gt;[ -r ${HOME}/.shrc_${my_HOST} ]  &amp;amp;&amp;amp; .  ${HOME}/.shrc_${my_HOST}&lt;/pre&gt;&lt;br/&gt;I tried to remove most of the customizations that are specific to what I do and might not be of use to other users.&lt;br/&gt;&lt;br/&gt;Some of the cool things it does:&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;You might notice is that there is built-in invocation checking to help prevent multiple sourcing of the file. In other words if your shell automatically reads both .profile and .shrc when it starts, there is a facility in the above to make sure that it's read only once in cases where it's used as both your .shrc and .profile.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;There's a handy function to add paths to *PATH variables. It actually checks to see whether the given path(s) exist and will only add valid directories to the path variable given.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;There's a function to find out what shell you're running ($SHELL won't always give you what you expect)&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;There's an interactivity check to determine whether the shell was invoked interactively or via a script. This is handy for many reasons.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;There's no non-standard code here. I've only used POSIX facilities here. The only non-shell piece of the whole thing is where i call awk to parse the output of ps -p $$ in my_getshell(). The use of AWK there is generic enough that it should work on all platforms.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;I'll probably put together a todo list as I think of other features to add. I'm currently using this as my .profile/.bash_profile/.zsh_profile and .shrc/.kshrc/.bashrc/.zshrc on several machines.&lt;br/&gt;&lt;br/&gt;UPDATE: I've had the above profile/shrc available online for a while now... you can track my changes to it and other "dot-files" at &lt;a href="http://git.secution.com/cgit/dotfiles"&gt;http://git.secution.com/cgit/dotfiles&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-4001288746765101966?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/4001288746765101966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/11/one-profile-to-rule-them-all.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/4001288746765101966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/4001288746765101966'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/11/one-profile-to-rule-them-all.html' title='one .profile to rule them all'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-305684043492833233</id><published>2009-11-07T00:06:00.000-06:00</published><updated>2010-06-07T18:53:49.951-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Shell tricks: eval helps make dynamic scripting rock.</title><content type='html'>If you write shell scripts of any significant size, &lt;em&gt;eval&lt;/em&gt; is a very good command to understand (well). It can make some code simpler, other code obsolete, and yet other code it makes possible that would not be otherwise.&lt;br/&gt;&lt;h2&gt;What is eval?&lt;/h2&gt;&lt;br/&gt;According to the &lt;a href="http://www.opengroup.org/onlinepubs/009695399/utilities/eval.html"&gt;2004 IEEE Std. 1003.1&lt;/a&gt;:&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;em&gt;&lt;a href="http://www.opengroup.org/onlinepubs/009695399/utilities/eval.html" target="_blank"&gt;eval&lt;/a&gt;&lt;/em&gt; constructs commands by concatenating arguments.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;The example given on the site is pretty simple but not very revealing.&lt;br/&gt;&lt;h2&gt;What can I do with &lt;em&gt;eval&lt;/em&gt;?&lt;/h2&gt;&lt;br/&gt;In practice eval lets you (better) write programs that &lt;em&gt;write&lt;/em&gt; programs, or at least parts of programs. One common use of eval is to create variables with names relative to their execution environment at runtime. I won't go into all the reasons that this might be beneficial but some good ones are: tying the process to a user id it prevent file clobbering, process accounting based on parent process id, to avoid creating arrays or other complex data structures  (good if you want your scripts to be portable and conform to the POSIX standard).&lt;br/&gt;&lt;h2&gt;Enough theory! How do I use eval?&lt;/h2&gt;&lt;br/&gt;Okay here's an example of how to use eval. Sometimes in a script you want to be able to name a variable dynamically. The following function does just that:&lt;br/&gt;&lt;pre&gt;tackon(){&lt;br/&gt;   #simple function to tack arg2 ($2) on to the end of&lt;br/&gt;   #variable X (arg1)&lt;br/&gt;   error_msg="usage: tackon  "&lt;br/&gt;   eval "${1:?${error_msg}}=\"\${$1} ${2:?${error_msg}}\""&lt;br/&gt;}&lt;/pre&gt;&lt;br/&gt;This function is named &lt;em&gt;tackon&lt;/em&gt; because it takes two arguments and appends arg2 to the end of (the value) of arg1. Here's an example of how it works:&lt;br/&gt;&lt;pre&gt;gcw@gcwmbp:/Users/gcw&amp;gt;&lt;br/&gt;$ students="Alex Mark Mike"&lt;br/&gt;gcw@gcwmbp:/Users/gcw&amp;gt;&lt;br/&gt;$ tackon students "Al Tim Steve"&lt;br/&gt;gcw@gcwmbp:/Users/gcw&amp;gt;&lt;br/&gt;$ echo $students&lt;br/&gt;Alex Mark Mike Al Tim Steve&lt;/pre&gt;&lt;br/&gt;To understand what's going on you first have to know that arguments to the function are assigned to two variables named &lt;code&gt;$1&lt;/code&gt; and &lt;code&gt;$2&lt;/code&gt;. When tackon() is called it takes whatever string is passed in as &lt;code&gt;$1&lt;/code&gt; and turns it into a variable. The diagnostics in the above version may be somewhat confusing so here's the function again stripped down to the bare essentials:&lt;br/&gt;&lt;pre&gt;tackon(){&lt;br/&gt;   eval "${1}=\"\${$1} ${2}\""&lt;br/&gt;}&lt;/pre&gt;&lt;br/&gt;Now we can more easily see how this works. Everywhere that we have &lt;code&gt;$1&lt;/code&gt; and &lt;code&gt;${1}&lt;/code&gt; it gets evaluated to the first  argument. If we called our example, where we called tackon with "students" as the first argument it becomes &lt;code&gt; "students=\"${students} ${2}\""&lt;/code&gt;. The quotes and other special characters may neeed to be escaped (based on what behavior you want). &lt;br/&gt;&lt;br/&gt;From this point on there's no magic. Eval executes the interpolated command and you benefit from the heavy lifting of a very nifty command. There are many other cool ways to use eval and maybe I'll go over some of them in the future but for now I'll leave you to fiddle around with this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-305684043492833233?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/305684043492833233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/11/shell-tricks-eval-helps-make-dynamic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/305684043492833233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/305684043492833233'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/11/shell-tricks-eval-helps-make-dynamic.html' title='Shell tricks: eval helps make dynamic scripting rock.'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-7421104384429079590</id><published>2009-10-24T12:47:00.000-05:00</published><updated>2010-06-07T18:53:49.944-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>why I don't write BASH scripts</title><content type='html'>I'm constantly hounded by &lt;span style="text-decoration: line-through"&gt;GNU/Linux newbies&lt;/span&gt; GNUbies about many things relative to scripting; Why don't I use gawk for my awk scripts; Why don't I use '[[' instead of '[' for my condition tests in shell scripts; Why don't I use BASH for my shell scripts?. Such questions rarely come from seasoned UNIX professionals who have worked on multiple flavors of Unix. Explaining the way things work in the real world requires that the audience has an attention span beyond that of the average&lt;em&gt; I'm_pissed_at_society_and_microsoft_sucks&lt;/em&gt;-linux-neophyte.&lt;br/&gt;&lt;h2 style="font-size: 1.5em"&gt;Clarification:&lt;/h2&gt;&lt;br/&gt;I'm not picking on Linux here. While I'm a BSD guy (B+++(++++)). I greatly understand and respect the contributions made by the GNU/Linux community from which we all benefit. There are many religious wars to be fought in computing and I'm not, here, interested in fueling any such conflicts. The bottom line is that due to its popularity, there are plenty of idiots who think they know everything using Linux. A good and smart linux user is an asset to the &lt;em&gt;unix&lt;/em&gt; community as a whole.&lt;br/&gt;&lt;h2 style="font-size: 1.5em"&gt;The Reasons&lt;/h2&gt;&lt;br/&gt;&lt;h3 style="font-size: 1.17em"&gt;It's not installed on my system(s)&lt;/h3&gt;&lt;br/&gt;While I've been using Linux since ~ 1994, I don't consider myself a "Linux Guy". Its a matter of preference, not experience. I simply prefer to use other operating systems over most linux distributions. As a result its quite frequently the case that BASH is not installed by default. Such is the case for FreeBSD and OpenBSD.&lt;br/&gt;&lt;br/&gt;The same could be said of any "enhanced" shell. KSH93 and ZSH are also not installed by default on those systems. All three are available on my Mac, by default.&lt;br/&gt;&lt;h3&gt;It didn't do what I wanted it to do&lt;/h3&gt;&lt;br/&gt;I've been using the korn shell for well over 15 years. When I wanted features beyond the POSIX standard for shell scripting, KSH93 had them. For at least the past 10 years I've been able to do things that are just now available in BASH 4.0. It makes no sense to me to switch to a much less mature code base just to get the same features that are available in the software I've been using for 10+ years.&lt;br/&gt;&lt;h3&gt;It still doesn't do what I want it to do&lt;/h3&gt;&lt;br/&gt;There was much hype surrounding the release of BASH 4.0. Were I a Linux (only) user I'd, likely,  have been right there with the crowd cheering the newest version of the shell that still doesn't do everything I can do with my other shells.&lt;br/&gt;&lt;br/&gt;To be fair BASH 4.0 and ZSH do have one feature that KSH93 does not: the ability to generate sequences ({001..199}) with leading zeroes.&lt;br/&gt;&lt;h3&gt;Poorformance&lt;/h3&gt;&lt;br/&gt;Bash just doesn't stack up when it comes to performance. The performance of KSH93 is comparable to that of Perl and Python. The performance of BASH (and many other shells like ZSH, MKSH, OKSH, POSH, ASH etc..) is comparatively poor.&lt;br/&gt;&lt;br/&gt;Here is a mandelbrot script that I found online &lt;a href="http://www.mathnews.uwaterloo.ca/Issues/mn9703/mandelbrot.php" target="_blank"&gt;somewhere&lt;/a&gt; :&lt;br/&gt;&lt;pre&gt;inmandelbrot() {&lt;br/&gt;    let "mag = $1 * $1 + $2 * $2"&lt;br/&gt;    if [ $mag -gt "40000" ] || [ $5 -ge $6 ]; then&lt;br/&gt;        echo $5&lt;br/&gt;    else&lt;br/&gt;        let "r = ($1 * $1)/100 - ($2 * $2)/100 + $3"&lt;br/&gt;        let "i = ($1 * $2)/100 * 2 + $4"&lt;br/&gt;        let "cnt = $5 + 1"&lt;br/&gt;        inmandelbrot r i $3 $4 $cnt $6&lt;br/&gt;    fi&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;for y in {-20..20}; do&lt;br/&gt;    for x in {-20..20}; do&lt;br/&gt;        let "rval = x * 10"&lt;br/&gt;        let "ival = y * 10"&lt;br/&gt;        val=$(inmandelbrot rval ival rval ival 1 10)&lt;br/&gt;        if [ $val -eq 10 ]; then&lt;br/&gt;            echo -n ".";&lt;br/&gt;        else&lt;br/&gt;            echo -n $val;&lt;br/&gt;        fi&lt;br/&gt;    done&lt;br/&gt;    echo&lt;br/&gt;done&lt;/pre&gt;&lt;br/&gt;I modified it use the {x..y} sequence instead of calling seq(1) as seq is not readily available on non-gnu systems and it improves execution time. The results were pretty stark ksh93 ran the set in under a second while BASH took 6 seconds on my laptop.&lt;br/&gt;&lt;pre&gt;[gcw@gcwmbp:~/prog/fractals&amp;gt;&lt;br/&gt;$ time ksh ./mandelbrot.sh &amp;gt; /dev/null&lt;br/&gt;&lt;br/&gt;real    0m0.782s&lt;br/&gt;user    0m0.640s&lt;br/&gt;sys     0m0.016s&lt;br/&gt;&lt;br/&gt;$ time bash ./mandelbrot.sh &amp;gt; /dev/null&lt;br/&gt;&lt;br/&gt;real    0m7.204s&lt;br/&gt;user    0m1.791s&lt;br/&gt;sys     0m2.207s&lt;/pre&gt;&lt;br/&gt;In (at least) this case KSH93 out performs BASH by roughly 9 times. In the spirit of full disclosure I should note that MKSH and ZSH don't fare much better than BASH when this type of Mandlebrot set. I got times around 90 - 95 percent of those for BASH.&lt;br/&gt;&lt;h3&gt;POSIX -&amp;gt; KSH93 -&amp;gt; ZSH&lt;/h3&gt;&lt;br/&gt;In most of my scripting I try to stick to the POSIX standard for features and tools. I try to avoid using GNU/Linux (only) utilities to make everything as portable as possible. When I do venture beyond the borders of POSIX-Land, I go to KSH93, I've been doing so for so long that it doesn't make sense for me to do anything else, unless... well you see... there is ZSH. The things you can do with ZSH go pretty far beyond standard "shell scripting". While it doesn't have the performance of KSH93 it does do much more than BASH and other "standard" shells and still manages to out perform them (in many cases).&lt;br/&gt;&lt;br/&gt;ZSH does have it's peculiarities. It's close to the other shells at the basic level and then diverges significantly from there.&lt;br/&gt;&lt;h3&gt;In closing&lt;/h3&gt;&lt;br/&gt;Yes BASH is a big a bloated piece of useful software, so too are KSH93 and ZSH. When I started scripting in Korn Shell it was because that's what was available to me at the time. Fortunately, KSH93 has some big advantages over the competition when it comes to features and performance. ZSH has it mainly in features. Because I use both of these shell there's really no reason for me to bother with BASH.  If you're a Linux only type of person, you may be blissfully unaware that other shells exist and might not care at all that more power is out there just waiting to be wielded by the likes of you. That's fine. I'm not looking to discourage any would be BASH-Hackers. I'm just trying to get wannabe's off my back for not being one myself.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-7421104384429079590?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/7421104384429079590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/10/why-i-don-write-bash-scripts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7421104384429079590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7421104384429079590'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/10/why-i-don-write-bash-scripts.html' title='why I don&amp;#39;t write BASH scripts'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-5512691691288791088</id><published>2009-10-19T07:50:00.000-05:00</published><updated>2010-06-07T18:53:49.938-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><title type='text'>15" MacBook Pro battery is failing after just 9.5 months (damn you
Apple)</title><content type='html'>I'm not an Apple loyalist. I don't think they make either the best or the most innovative products. I do like that they've managed to do certain things that other vendors haven't been apt or adept enough to do. Yes; Apple does incessantly boast about the most minute of accomplishments. This makes it difficult for the layperson to determine which of their marketing fluff points is actually worth all of the hype. Hype is what Apple wants   you to be interested in. They don't even hide it (well).&lt;br/&gt;&lt;br/&gt;Recently Apple's been hyping their Laptops and the great battery life. Well today After 9.5 months the battery in my (new Aluminum Uni-Body) 15" MacBook Pro is &lt;em&gt;crashing&lt;/em&gt;. By &lt;em&gt;crashing&lt;/em&gt; I mean that it's only lasting for about 1/3 of the advertised 5 - 6 hours of  life on a full charge.&lt;br/&gt;&lt;br/&gt;It started last week when I'd noticed on the train (during my morning commute) that my battery meter was atypically low. When I got to the office I plugged in my laptop and left it charging for about 9 hours straight. At the end of the work day I left, hoped on the train and noticed that the estimated life on the meter was 1 hour 47 minutes. I decided to deal with it for the rest of the week. On Friday I let the battery drain and did the calibration they recommend on the apple support site. Saturday (after the 8 - 9 hour process) I got the same results as before 1 hour 47 minutes of battery life. So I decided to try it again. No go, still only 1 hour 47 minutes. Now I can either choose to either try to get by online 1 hour 47 minutes at a time or fork over $130 for a new battery hoping that it will live up to the hype.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-5512691691288791088?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/5512691691288791088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/10/15-macbook-pro-battery-is-failing-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/5512691691288791088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/5512691691288791088'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/10/15-macbook-pro-battery-is-failing-after.html' title='15&amp;quot; MacBook Pro battery is failing after just 9.5 months (damn you&#xA;Apple)'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-2934005297945704265</id><published>2009-09-13T17:16:00.000-05:00</published><updated>2010-06-07T18:53:49.932-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='Gripes'/><title type='text'>Snow Leopard is pretty "cool" but still doesn't have some things I'd
like to see</title><content type='html'>I've been using Snow Leopard for over a week now. I'm quite pleased with the performance boost (it actually makes the first core2 based MacMinis usable) and don't really mind the absence of feature creep/bloat. It looks like this was a targeted effort and Apple seems to have hit the mark quite aptly.&lt;br/&gt;&lt;br/&gt;Unfortunately there are some things that still aren't quite right for me with OS X that I'd hoped would have been addressed with the bring forth of this frosted feline.&lt;br/&gt;&lt;h3&gt;Mail.app:&lt;/h3&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Multiple identities&lt;/strong&gt; - This is long overdue. Apple back has welts from how often they pat themselves there for innovation and usability. Some how they have overlooked the basic fact that many people use email with a basic many to one configuration. I have email from over 50 addresses pointing to one email account where everything is sorted and stored. Unfortunately I have no way of creating different sender profiles/identities. NOTE: I'm aware of the ability to use comma separated values in the email address field for a selectable list of &lt;em&gt;From:&lt;/em&gt; addresses but that doesn't affect the signature, name or other identity information.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Address Affinity&lt;/strong&gt; - Apple's Mail.app allows you to specify multiple sender addresses by simply populating the &lt;em&gt;Email address&lt;/em&gt; field with each address you want to use separated by commas. Unfortunately when replying to incoming messages there are no checks against said list of addresses. Thus if your &lt;em&gt;Email address&lt;/em&gt; field contains "&lt;em&gt;you@x.dom, you@xy.dom, you@xyz.dom" &lt;/em&gt;and receive a message addressed to you@xyz.dom, hitting reply won't sent the appropriate &lt;em&gt;From:&lt;/em&gt; address&lt;em&gt;. &lt;/em&gt;Instead it will just use the first entry in the list of comma separated values.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;h3&gt;Stacks:&lt;/h3&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Smart Folders&lt;/strong&gt; - It would be great to be able to create a doc stack form smart folders.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Resize&lt;/strong&gt; - Resizing grid view would be nice (I'm glad we can at least scroll now).&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Custom Icon&lt;/strong&gt; - Setting an Icon/image for you stacks would be a really nice thing to be able to do.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;h3&gt;App Switching:&lt;/h3&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Specific Windows&lt;/strong&gt; - Using the Command Key + Tab will let you switch from one app the the next. Once you're in the appropriate app you can choose a specific window with the Command Key + back tick (`) or tilde (~). It would be great if we could just switch to a specific window with something like the Option Key + Tab. I know there are add-ons that provide this functionality but it's long overdue for inclusion as a core feature of the core interface.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;X11 Apps&lt;/strong&gt; - Aqua treats all X apps as separate windows of the one X11 process. So if you're running xterm and xcalc at the same time Command + (`) will cycle through all windows for both applications indiscriminately. Apple should start treating X11 windows as first class citizens.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;&lt;h3&gt;Command line:&lt;/h3&gt;&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Bash version&lt;/strong&gt; - It would have been nice to see bash updated to version 4.x. I'm not a bash fan ( I prefer ksh93 for scripting and zsh for interactive use because they are cleaner, lighter, faster and more robust) but just makes sense to at least have it included as an option. They could have installed it as /bin/bash4.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Vim version&lt;/strong&gt; - still on 7.2.108 could have been updated.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Terminal.app&lt;/strong&gt; - It had some problems with color overlaying that should be addressed. Light Black over Black doesn't come out right (at least not on my systems especially in mutt). It works fine with Putty, xterm, rxvt, and Iterm.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;Overall I'm pleased with the updates in Snow Leopard. The boost in performance is quite welcome. Hopefully the next update has some more substance to it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-2934005297945704265?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/2934005297945704265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/09/snow-leopard-is-pretty-but-still-doesn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/2934005297945704265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/2934005297945704265'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/09/snow-leopard-is-pretty-but-still-doesn.html' title='Snow Leopard is pretty &amp;quot;cool&amp;quot; but still doesn&amp;#39;t have some things I&amp;#39;d&#xA;like to see'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-8749771045070134594</id><published>2009-07-24T02:01:00.000-05:00</published><updated>2010-06-07T18:53:49.803-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gadgets'/><title type='text'>WebOS 1.1.0 released (oooh yay...sort of)</title><content type='html'>The good folks over at Palm have seen fit to bless the world with a &lt;a href="http://blog.palm.com/palm/2009/07/palm-webos-11-enhances-support-for-enterprise-and-beyond.html" target="_blank"&gt;significant update&lt;/a&gt; to their Web Operating System. There are plenty of goodies in this update  for corporate users and according to &lt;a href="http://www.precentral.net" target="_blank"&gt;PreCentral.net&lt;/a&gt;, plenty of &lt;a href="http://www.precentral.net/webos-11-tons-undocumented-features" target="_blank"&gt;secret (??) goodies&lt;/a&gt; for everyone else as well. All of this is good news for the Palm devout. There are, however, a few things that are not in this much lauded upgrade that have been over due since 1.0.2.&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;generic copy and paste&lt;/strong&gt; -- I should be able to select text from a text message, IM, e-mail message, or web page and paste it into any of the aforementioned without being limited to "editable text fields" of a web form&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;password retention/auto-fill&lt;/strong&gt; -- I still need to re-enter my password for websites when the device is rebooted. This is exceedingly vexing with good secure passwords that are more than 18 characters long&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Integration with other information services&lt;/strong&gt; -- Facebook is nice and it was a smart move on the part of Palm to get that working well. If they were concerned with &lt;strong&gt;&lt;em&gt;real&lt;/em&gt; &lt;em&gt;synergy&lt;/em&gt;&lt;/strong&gt; they would allow us to integrate information from OpenSocial or Naymz, LinkedIn, MySpace, and others.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;IMAP 'idle' support for subfolders&lt;/strong&gt; -- It's great to get IMAP "push" for email in my mail box. Now let me get it on the subfolders that I've marked as favorites. Waiting for the sync of 12 different mailboxen is not fun when you have to go though them one at a time and each receives several tens of messages an hour.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;Resolution of the iTunes Sync Issue&lt;/strong&gt; -- The new version of WebOS manages to re-enable iTunes sync compatibility for version 8.2.1. Great news for those who are inept enough to let iTunes manage all of their media exclusively. For the rest of us this is almost a non-issue. I say almost because the real issue is this sophomoric game they are playing with Apple. Okay, so the lead engineers of the first generation iPhone are now working on the Pre score 1 Palm. They launched a device that's not blessed by Apple and it syncs with iTunes, score 2 Palm. Apple insinuates that they may consider certain technologies in the Palm Pre to be infringing on their IP rights, score 1 apple. Apple disables iTunes sync with the Pre, score 2 Apple. Palm re-enables iTunes Sync with WebOS 1.1.0. It's starting to feel like a high school "who can be the biggest jack-ass" contest. You can only win by loosing. Apple can just play defense and ride this out while Palm will be left with egg on their face if they don't buck up and figure out a way to cut the crap.&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-8749771045070134594?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/8749771045070134594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/07/webos-110-released-oooh-yaysort-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8749771045070134594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/8749771045070134594'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/07/webos-110-released-oooh-yaysort-of.html' title='WebOS 1.1.0 released (oooh yay...sort of)'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-6360839189921139344</id><published>2009-07-11T21:03:00.000-05:00</published><updated>2010-06-07T18:53:49.797-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='AWK'/><title type='text'>CAWKLib</title><content type='html'>CAWK (Cawk's Another Web Kit) is a web framework written in AWK that is soon to be under development. When we started working on it we discovered that we needed a better way to manage file inclusions than the '-f' command line option. We decided to write our own pre-processor and package it with the custom libraries that we were developing.  That project grew into two separate projects. The first being BangCAWK (so named for the 'shebang' line that it replaces), the pre-processor, the second being CAWKLib, the library of functions.&lt;br/&gt;&lt;br/&gt;Writing code that others may use is vexing and trying On the one hand you'd like for others to be able to use your code if it can help them out. On the other hand you've now got to now make it better documented, more readable, and robust so that people who decide to pick it up don't either shoot themselves in the foot or want to shoot you (in the head).&lt;br/&gt;&lt;br/&gt;We're trying to balance the development of the features that we need with implementing things in a logical and consistent manner for people who may choose to reuse what we produce. I don't know how well we're doing that but you can decide for you self by checking it out @ &lt;a href="http://git.secution.com/cgit/CAWKLib" target="_blank"&gt;http://git.secution.com/cgit/CAWKLib&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-6360839189921139344?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/6360839189921139344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/07/cawklib.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6360839189921139344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/6360839189921139344'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/07/cawklib.html' title='CAWKLib'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-5268590125207367481</id><published>2009-06-27T03:20:00.000-05:00</published><updated>2010-06-07T18:53:48.363-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='macports'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Lua'/><category scheme='http://www.blogger.com/atom/ns#' term='osx'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>LUA_PATH on OSX</title><content type='html'>Earlier today I was playing around with Lua and luarocks on my laptop (which happens to be a MacBook Pro). I thought maybe I'd try re-writing &lt;a href="http://hyperreal.org/raves/vrave/" target="_blank"&gt;telechat&lt;/a&gt; in Lua with the LuaSocket package. After I'd installed Lua 5.1.4 via mac ports along with luarocks:&lt;br/&gt;&lt;pre&gt;$ sudo port -v install lua luarocks&lt;/pre&gt;&lt;br/&gt;I installed LuaSocket.&lt;br/&gt;&lt;pre&gt;$ sudo luarocks install luasocket&lt;/pre&gt;&lt;br/&gt;I was under the mistaken impression that when I tried to run some example code, the ENVIRONMENT would be setup and functioning properly. Unfortunately this was not the case:&lt;br/&gt;&lt;pre&gt;$ lua&lt;br/&gt;Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio&lt;br/&gt;&lt;br/&gt;&amp;gt; require "sockets"&lt;br/&gt;/opt/local/share/lua/5.1/luarocks/require.lua:256: module 'sockets' not found:&lt;br/&gt;        no field package.preload['sockets']&lt;br/&gt;        no file './sockets.lua'&lt;br/&gt;        no file '/opt/local/share/lua/5.1/sockets.lua'&lt;br/&gt;        no file '/opt/local/share/lua/5.1/sockets/init.lua'&lt;br/&gt;        no file '/opt/local/lib/lua/5.1/sockets.lua'&lt;br/&gt;        no file '/opt/local/lib/lua/5.1/sockets/init.lua'&lt;br/&gt;        no file './sockets.so'&lt;br/&gt;        no file '/opt/local/lib/lua/5.1/sockets.so'&lt;br/&gt;        no file '/opt/local/lib/lua/5.1/loadall.so'&lt;br/&gt;stack traceback:&lt;br/&gt;        [C]: in function 'plain_require'&lt;br/&gt;        /opt/local/share/lua/5.1/luarocks/require.lua:256: in function 'require'&lt;br/&gt;        stdin:1: in main chunk&lt;br/&gt;        [C]: ?&lt;/pre&gt;&lt;br/&gt;After some investigation I'd realized that the LUA_PATH wasn't set up by the packages that were installed. Since I'd installed the LuaSocket package as the administrator (with the &lt;em&gt;sudo&lt;/em&gt; command). I needed to include the system-wide path to the rocks libraries. I did this for my user only by editing my .kshrc file. If  I'd wanted to do the same thing in bash I could have used .bshrc or .bashrc. To do it for every user of the system I could have use /etc/profile and /etc/login.  In any case I put in this line:&lt;br/&gt;&lt;pre&gt;export LUA_PATH="/opt/local/share/lua/5.1//?.lua;/opt/local/lib/luarocks/?.lua;;"&lt;/pre&gt;&lt;br/&gt;After that was included everything ran fine (don't forget to reload your environment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-5268590125207367481?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/5268590125207367481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/06/luapath-on-osx.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/5268590125207367481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/5268590125207367481'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/06/luapath-on-osx.html' title='LUA_PATH on OSX'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-1841358342867657090</id><published>2009-06-27T02:44:00.000-05:00</published><updated>2010-06-07T18:53:48.356-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='posix'/><category scheme='http://www.blogger.com/atom/ns#' term='AWK'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='Lua'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Adventures in Lua (I)</title><content type='html'>After studying and working with Lua for about a year now, I find it to be a very powerful and innovative language. While the syntax is not my favorite, overall it's fun to work with. Recently I started using the standalone &lt;em&gt;lua&lt;/em&gt; interpreter for some general purpose scripting which has revealed to me a few key reasons that Lua (the language) or at least &lt;em&gt;lua&lt;/em&gt; (the interpreter) won't be readily employed for system scripting on a large scale anytime soon.&lt;br/&gt;&lt;ul&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;GetOpts&lt;/strong&gt; - Doesn't exist. Which isn't really a big deal for me.. sure the (korn) shell has it but plenty of other scripting languages don't have it (like AWK)&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;DELIMITERS&lt;/strong&gt; - in the LUA_PATH environment variable the delimiters are semicolons(;) as opposed to the colons(:) used in most posix apps.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;RegEx&lt;/strong&gt; - Lua doesn't have the Posix Regular Expressions Engine nor GNU's or Perls. There are some very innovative constructs for complex (and simple) pattern matching and an equivilent to back references called yank but it's going to take you some time to get used to if you're accustom to regular Unix REs.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;ARGV[] &amp;amp; ARGC&lt;/strong&gt; - They don't exist... well not as you might expect them to anyway. There is an &lt;em&gt;arg&lt;/em&gt; or &lt;em&gt;args&lt;/em&gt; table created with the values passed to the script as command line arguments, however I was told that &lt;em&gt;args&lt;/em&gt; is deprecated or will be shortly.&lt;/li&gt;&lt;br/&gt;	&lt;li&gt;&lt;strong&gt;COMMENTS&lt;/strong&gt; - Okay this one is really a minor issue. If you're used to SQL comments as opposed to those in the shell, AWK, Perl, bc, etc.. then you're in good shape. In Lua Comments begin with a double hyphen or dash (--)&lt;/li&gt;&lt;br/&gt;&lt;/ul&gt;&lt;br/&gt;As I said before, I really enjoy working with Lua. The systems engineer/hacker in me wants to find as many ways to utilize it as possible. (Yes, I'm crazy like that.) We'll see if I've reached any new conclusions after I've done more applications programming with lua.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-1841358342867657090?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/1841358342867657090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/06/adventures-in-lua-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/1841358342867657090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/1841358342867657090'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/06/adventures-in-lua-i.html' title='Adventures in Lua (I)'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-2645883104542364198</id><published>2009-06-20T01:03:00.000-05:00</published><updated>2010-06-07T18:53:48.352-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gadgets'/><category scheme='http://www.blogger.com/atom/ns#' term='palm pre webos'/><title type='text'>WebOS 1.0.3 available for the Pre but no new Apps.</title><content type='html'>Earlier today (okay technically it was yesterday) Palm made version 1.0.3 of WebOS available for Pre users. While I'm sure it may have many goodies to increase performance or reliability. The one thing it most certainly doesn't have is a way to magically make Palm get off it's ass and release their damn SDK and get more apps in the App Catalog.&lt;br/&gt;&lt;br/&gt;So far I've been relatively pleased with the Pre. There are some sticking points which I presume will be addressed in fairly short order. The thing that's made me most want to chuck my little "river stone" into the river is the fact that there are only (as of this writing) 30 apps available for download from the App Store.. I mean App Catalogue err uhh Catalog.&lt;br/&gt;&lt;h2&gt;What are they Thinking?&lt;/h2&gt;&lt;br/&gt;SmartPhones and mobile internet devices live and die by the applications that run on them. There is no one who should understand this better than the people at Palm. They basically created the SmartPhone with the HandSpring VisorPhone in 2000 and before that they helped create the mobile applications market with PalmOS running on the Palm Pilot 500 and beyond.&lt;br/&gt;&lt;br/&gt;What made the Palm Pilot so popular wasn't the ease with this one could pick up Grafiti or the number of stylus taps it took to get to a contact or create an appointment. It was the ability to download new applications and write some of your own.&lt;br/&gt;&lt;h2&gt;Seriously release it already&lt;/h2&gt;&lt;br/&gt;There will likely be a swell of development for the platform once the tools are made available. That is if they don't kill all of their momentum by making us wait too long. They've built a fairly nifty device with a great interface. It's something you want to keep in your hands and play with. The only problem is that there's nothing to keep you occupied while you're holding it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-2645883104542364198?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/2645883104542364198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/06/webos-103-available-for-pre-but-no-new.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/2645883104542364198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/2645883104542364198'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/06/webos-103-available-for-pre-but-no-new.html' title='WebOS 1.0.3 available for the Pre but no new Apps.'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6847666534489502628.post-7991025361110653775</id><published>2009-06-19T04:32:00.000-05:00</published><updated>2010-06-07T18:53:48.347-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AWK'/><title type='text'>An AWKing we will go</title><content type='html'>I've been meaning to setup awkscripting.com for a while. Well it's finally up. There's not much there yet but as I collect resources on awk and continue to write scripts for which most people will call me crazy, it should hopefully grow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6847666534489502628-7991025361110653775?l=www.notadiscussion.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.notadiscussion.com/feeds/7991025361110653775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.notadiscussion.com/2009/06/awking-we-will-go.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7991025361110653775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6847666534489502628/posts/default/7991025361110653775'/><link rel='alternate' type='text/html' href='http://www.notadiscussion.com/2009/06/awking-we-will-go.html' title='An AWKing we will go'/><author><name>G. Clifford Williams</name><uri>http://www.blogger.com/profile/06252135206732232923</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_s9iN9i-_UPs/TA2oqZeWyuI/AAAAAAAAAAM/sl6XWzj5Hmk/S220/Photo+28.jpg'/></author><thr:total>0</thr:total></entry></feed>
