Swaks Release 20111230.0 Available

Updated 2012-03-20: The links below still work for the 20111230.0 release, but this release is no longer current. If you are not specifically looking for the 20111230.0 release, please see the project home page at http://jetmore.org/john/code/swaks/ for the latest release.

A new version of swaks is currently available for download.

Downloads:

New Features:

  • Added –output-file family of options to capture some or all output without requiring shell redirection
  • Added –protect-prompt option to protect “sensitive” user input (currently only auth passwords)
  • Added –auth-hide-password to replace recoverable passwords in SMTP session output with a dummy string
  • Added –auth-extra to have a single interface to pass non-standard authentication options into swaks. Currently used by NTLM and DIGEST-MD5.
  • Added –show-raw-text option to provide more details of exact data being sent on the wire

Notable Changes:

  • SMTP Data token parsing has been changed from single-character (%F) to multi-character (%FROM_ADDRESS%) to reduce chance of collisions with message text, especially non-ascii language encoding. See –use-old-data-tokens to recover old tokens while transitioning. (issue reported by Peter Baranyi)
  • Specifying the NTLM/MSN/SPA DOMAIN by appending “%DOMAIN” to the username is no longer supported. See the new –auth-extra command.
  • The DIGEST-MD5 authentication no longer uses the (buggy) Authen::DigestMD5 module. The Authen::SASL module is now used.

Notable Bugs Fixed:

  • Previous release broke ability to use –header to set custom headers (first reported by David Favor)
  • Previous release would not allow a file to be used to provide the message data if the file name contained the character “n”. (first reported by dietrich.rebmann@******)
  • swaks has never properly handled creating date strings for timezones that are not on an even hour boundary. (report from, and patch provided by, Peter Samuelson)
  • The documented behavior of the “no-” prefix on swaks’ options did not work when –OPTION and –no-OPTION were given in the same context.
  • The DIGEST-MD5 auth type was not completely implemented. Worked extensively with Erwan Legrand to get as complete and useful an implementation as possible.
  • Previous release contained a regression in which TLS responses sent in multiple packets were not processed correctly. (reported by Peter J. Holzer)

Why “Tinker Bell” is a great movie.

So, Disney decided to make some new movies focused on Tinker Bell from the Peter Pan universe, and released “Tinker Bell” in 2008.  I checked it out from the library last week and finally saw all the whole thing with my daughters tonight.  Let me give you a very quick plot synopsis:

A young girl trying to find her way in a new place struggles to change herself into what she thinks she wants to be, only to find that she was already what she wanted to be.

Not exciting for me.  The flesh has been painted onto those bones a thousand times, usually with the “new place” being school and “wants to be” being popular.  Whatevs.

But now let me synopsize Tinker Bell:

A young fairy (Tinker Bell) is born on Neverland.  Through a sorting ceremony she is selected to be in the guild of tinkers (makers/fixers) and not one of the “Nature” fairies (who are responsible for things like the changing seasons, caring for animals, etc).  Tink shows extreme talent as a tinker, but a MacGuffin pushes her to make a dedicated attempt to join any other guild.  Many attempts at this fail.  She eventually fails very publicly and catastrophically.  After some soul searching, she realizes she can use her skill as a tinker to make tools that will erase the effects of the catastrophe.

So why is this different to me?

  1. The biggie for me, the thing that even made me pay attention to the movie, is that her skill was “making”.  Not singing or cheerleading.  I know that they were handed the “tinker” role by J. M. Barrie, but they didn’t have to run with it.  The fact that she was a literal tinker wasn’t covered in the 1953 Peter Pan, which is the only real work they had to respect in this movie.  They could easily have ditched the literal tinker aspect of her character and no one would have made a fuss, but they didn’t.  They kept it and made Tink a “maker”, which I think is great.
  2. I absolutely love that the MacGuffin doesn’t involve a boy in any way.  The plot’s not driven by Tink’s desire to get a boyfriend, by someone else’s attempt to steal her boyfriend, etc.  Absolutely none of her sense of self worth in this movie is driven by a relationship she does or doesn’t have with a boy.  It was a very refreshing experience to watch a movie where the female lead was fulfilled by making a device that can paint ladybugs and not by a dude smiling at her.

The movie was by no means perfect – the fact that she was “born” and started working the same day never stopped bothering me for instance – but it was significantly better than any other kids straight-to-DVD movie I’ve watched in a long time.  Maybe it’s not that great, and I’m just being mislead by my incredibly low expectations going in, but I would encourage my girls to watch this movie again, which is not something I expected to say when we got it.

Swaks Release Preview 20111202.0-dev Available

I’m almost ready to release a new version of swaks which includes a few new features and some bug fixes.  The last change I made involved a change in the code which reads text from the server.  All of my testing indicates that the code is right, but my available testing platforms aren’t as varied as they used to be.   If you are able, please download and test.  Feel free to share the link as much as you want, but please don’t package it yet.  If no one reports anything serious I’ll release the “real” version in a week or so.

Here are links to the script and the Changelog for this version:

LINK REMOVED – this was a development release and the changes have been incorporated in official releases. Please see the project home page at http://jetmore.org/john/code/swaks/ for the latest release.

I don’t have a pretty version of new features or bug fixes yet but the Changelog can be trawled for a decent overview.

Any testing notes or last minute requests can be dropped as a comment here if you want, but they are most useful as an email to proj-swaks@jetmore.net.

More places to hear about swaks

I’ve never been especially proactive in evangelizing swaks, but its usage number have grown to the point in the last 10 years that I think I probably am probably hurting users by not having more communication channels to receive and provide updates.  So, here’s a quick breakdown of what channels exist right now, and where I want to go in the future

Current

  • Website – http://jetmore.org/john/code/swaks
  • Update list – There’s no UI for this, but emailing updates-swaks@jetmore.net and asking to be notified of new releases will get you on the notify list.

New

Future

  • I don’t really have any desire to run a mailing list myself but there have been some requests for one (which I assume would be very, very low traffic).
  • swaks.net – I own this domain, at some point in the future I think it makes sense for the swaks distribution to move to it.
  • Trac – swaks’ “todo” list is not huge, and not especially hard to hold in my head, but I like the idea of Trac or something similar because of its ticket/commit cross reference and the timeline to help remember the history of the development.  Not sold on this being worth the effort of maintaining yet.
If there’s some specific thing you’d like to see from swaks, whether it’s a communication channel or a feature/bug, please let me know in the comments or via email (proj-swaks@jetmore.net).

Well, I Can Cross “Hang a Barn Door In My Living Room” Off My Bucket List

I’m still not 100% sure how I came to hang a barn door in my living room.  I think maybe my wife and I were playing chicken with each other.  Neither of us blinked, and now I have a barn door, which I love and had a great time making, hanging in my living room.  Woo!

Day 1: Plans, wood

The basic door plan and shopping list. This list turned out pretty well. I need to return two pieces of hardware and I used one extra 1x4.

Continue reading

Abusing a Character Display

One of the first things I bought to use with my arduino was a 2×16 character display, specifically this one from Adafruit.  Playing with it was fine, but after looking at the interface to the LiquidCrystal library I decided to see if I could abuse it by making it into a cheap-o Etch-a-Sketch.

Stage 1 of this project worked fine, and was actually a bit of fun (although it was kind of cheating – I’m supposed to be challenging myself with hardware, and this was really all just programming).  I knocked up a couple of trimmers to use as the knobs, whipped up some modulo arithmetic, and I turned my 16×2 character display into a 80×16 pixel display.

Here’s a not-great video of the result:

Next I wanted to make drawing persistent, to be able to actually draw.  Seemed simple enough – I had been building custom characters on every update, with the current x,y bit turned on, then writing that char to the correct x,y character position.  All I should have to do it maintain an array of characters.  Then on each iteration when I set the x,y position, it’s an update, not an entirely new character.  Then when I write the character out, I’ll get the entire state for the board.

Unfortunately, this exposed a pretty fundamental misunderstanding I had of the character displays.  I assumed that since I was only updating a single “character” at each loop, all the characters I wasn’t touching would just stay put.  However, when I re-create the custom character at each loop, that also updates every place on the display that was showing that “character”.  It actually looks fairly interesting as, over time, multiple characters on the screen start to come to life and start changing in sympathy with each other.  Cool, but not at all what I wanted.

This failure completely makes sense as I think about it.  Since the LiquidCrystal library only supports 8 unique custom characters I can’t make use of the whole screen just through the standard library.  It’s possible that the 8 character limitation is arbitrary and that I could raise it by mucking around in the library, but that doesn’t sound like that much fun.

There are a couple of possible next steps I could take here:

  1. Just to show the core of what I wanted to do, use the 8 custom characters I get from the LiquidCrystal library to make a 2×4 character (16×20 pixel) display.  I will probably do this and take a video of it just to have done it.  One of the original goals in this project was to just make anything that I wasn’t copying from someone else.  Ideas include a write/erase function, “status” lights, an “invert” button, a non-state-changing cursor, basically anything to take up a pin on the Arduino.  Now that I write this down and remember what my goal was, I’ll probably do this no matter what
  2. I could track down the LiquidCrystal library and understand what the root of the 8-custom-character limit is.  If it’s an arbitrary software limit, maybe raise it and recompile.  If it’s not arbitrary but due to memory, maybe make a custom version of the library in which some standard characters are missing, allowing me to use their memory space for more custom chars.  I doubt I do this anytime soon, but if I decide to play around more with Arduino libraries, this might be a fun platform to learn more about them.
  3. If the limit on the number of custom characters turned out (somehow) to be hardware based, then I could skip the LiquidCrystal library altogether and see if I could somehow force the hardware to do what I want if I give up on the need for standard characters.  I think the only way I would do this is if I actively needed to learn about the LCD chipset’s low level use for some other reason.
  4. There’s a strong possibility that I may bag everything above because I had an idea for a new project that I want to get working using my Arduino.  Since this is the most interesting thing I’ve made that I haven’t copied form someone else, I should take this opportunity to think about how I will store project information.  I’m not fond of the Arduino dev environment’s file system layout requirements and concessions I have to make to it to use SVN, but I do have this sketch in SVN.  Need to lean more about creating and storing schematics.  Can I store them with the Arduino sketch without the Arduino software complaining?  What’s the best software to use?  Right now I just want to sketch something out that I can use to recreate the circuit later, and that I can put in version control.  ASCII art would work right now, but I wonder if there’s an advantage to finding more specific software this early in my learning cycle…

Right.  Disappointed that my original idea didn’t work, but still plenty to learn in that list above.  I wonder if I can get 1 and 4 done while waiting for parts for NewProjectIdea?

UI Improvements for TestLink’s Vertical Step Layout

I have previous posts on several improvements which drastically improved my team’s ability to use TestLink:

As we began really testing in earnest, we found that the “horizontal” test case layout we had been using was limiting in several ways.  First, when the expected results was a collection of logs rather than a text description of behavior, it became a labor to find the relevant bits in the long log lines.  Second, some types of expected results would cause the results cell to take up as much horizontal space as possible, which squashed the “actions” cell.  On more than one occasion I had to copy the actions to a text file so that I could read them in a meaningful manner.

Update 2012-05-08: There is a usable-with-the-patch-command patch available that incorporates all of these changes and more. See the README at the base of the github repo for more details on what’s in that patch.

Fortunately there is also a “vertical” test case layout.  We recently switched to using this and so far it solves our problem.  Unfortunately I had to reimplement all of the items from the links above.  The diffs below are the changes I made to our files to get the desired changes.  Possible items of interest:

  • The diffs below assume that the changes from the previous blog posts have been made.  This affects the line numbers in the diffs, as well as things like the existence of the CSS file and its contents.
  • I never really liked the alternating BG color behind the steps, but it was the best solution in the horizontal view.  In the vertical view I alternated the colors in the empty gutter cells to the left of the action/result rows.  Since there’s no text in those cells, it allowed me to use darker, more contrasting colors.
Index: gui/themes/default/css/custom.css
===================================================================
--- gui/themes/default/css/custom.css   (revision 241)
+++ gui/themes/default/css/custom.css   (revision 242)
@@ -6,6 +6,14 @@
        background-color:       #CCCCCC;
 }

+.row_color_3 {
+       background-color:       #555555;
+}
+
+.row_color_4 {
+       background-color:       #AAAAAA;
+}
+
 div.c_actions, div.c_expected_results {
        font-family: 'Courier New', Courier, monospace;
 }
Index: gui/templates/testcases/inc_steps.tpl
===================================================================
--- gui/templates/testcases/inc_steps.tpl       (revision 241)
+++ gui/templates/testcases/inc_steps.tpl       (revision 242)
@@ -91,14 +91,16 @@
        {/if}
        {foreach from=$steps item=step_info}
        <tr>
-               <th width="25px"><nobr>{$inc_steps_labels.step_number}
+               <th width="25px"><nobr>
                <span class="order_info" style='display:none'>
                <input type="text" name="step_set[{$step_info.id}]" id="step_set_{$step_info.id}"
                       value="{$step_info.step_number}"
                       size="{#STEP_NUMBER_SIZE#}"
                       maxlength="{#STEP_NUMBER_MAXLEN#}">
                {include file="error_icon.tpl" field="step_number"}
-               </span>{$step_info.step_number}</nobr></th>
+               </span><span {if $edit_enabled} style="cursor:pointer;"
+        onclick="launchEditStep({$step_info.id})"{/if}
+               >{$inc_steps_labels.step_number} {$step_info.step_number}</span></nobr></th>
                <th>{$inc_steps_labels.step_actions}</th>
                {if $session['testprojectOptions']->automationEnabled}
                <th>{$inc_steps_labels.execution_type_short_descr}:
@@ -111,10 +113,8 @@
                {/if}
        </tr>
        <tr>
-               <td>&nbsp;</td>
-               <td colspan="2" {if $edit_enabled} style="cursor:pointer;"
-                   onclick="launchEditStep({$step_info.id})"{/if}
-                   style="padding: 0.5em">{$step_info.actions}</td>
+               <td class="{cycle values="row_color_3,row_color_3,row_color_3,row_color_4,row_color_4,row_color_4"}">&nbsp;</td>
+               <td colspan="2" style="padding: 0.5em"><div>{$step_info.actions}</div></td>
                {if $edit_enabled}
                <td class="clickable_icon">
                        <img style="border:none;cursor: pointer;"
@@ -133,13 +133,13 @@
                {/if}
        </tr>
        <tr>
-               <th style="background: transparent; border: none"></th>
+               <td class="{cycle values="row_color_3,row_color_3,row_color_3,row_color_4,row_color_4,row_color_4"}"></td>
                <th colspan="2">{$inc_steps_labels.expected_results}</th>
        </tr>
-       <tr {if $edit_enabled} style="cursor:pointer;"
-           onclick="launchEditStep({$step_info.id})"{/if}>
-           <td>&nbsp;</td>
-               <td colspan="2" style="padding: 0.5em 0.5em 2em 0.5em">{$step_info.expected_results}</td>
+       <tr>
+           <td class="{cycle values="row_color_3,row_color_3,row_color_3,row_color_4,row_color_4,row_color_4"}">&nbsp;</td>
+               <td colspan="2" style="padding: 0.5em 0.5em 2em 0.5em">
+                       <div>{$step_info.expected_results}</div></td>
        </tr>
        {/foreach}
 {/if}
Index: gui/templates/testcases/tcStepEdit.tpl
===================================================================
--- gui/templates/testcases/tcStepEdit.tpl      (revision 241)
+++ gui/templates/testcases/tcStepEdit.tpl      (revision 242)
@@ -223,7 +223,7 @@
   {else} {* Vertical layout *}
                {foreach from=$gui->tcaseSteps item=step_info}
                        <tr id="step_row_{$step_info.step_number}">
-                               <th width="20">{$args_labels.step_number} {$step_info.step_number}</th>
+                               <th width="20"><a href="{$hrefEditStep}{$step_info.id}">{$args_labels.step_number} {$step_info.step_number}</a></th>
                                <th>{$labels.step_actions}</th>
                                {if $session['testprojectOptions']->automationEnabled}
                                        {if $step_info.step_number == $gui->step_number}
@@ -244,24 +244,24 @@
                                {/if}
                        </tr>
                        <tr>
-                               <td>&nbsp;</td>
+                               <td class="{cycle values="row_color_3,row_color_3,row_color_3,row_color_4,row_color_4,row_color_4"}">&nbsp;</td>
                                {if $step_info.step_number == $gui->step_number}
                                        <td colspan="2">{$steps}</td>
                                {else}
-                                       <td colspan="2"><a href="{$hrefEditStep}{$step_info.id}">{$step_info.actions}</a></td>
+                                       <td colspan="2"><div>{$step_info.actions}</div></td>
                                {/if}
                        </tr>
                        <tr>
-                               <th style="background: transparent; border: none"></th>
+                               <td class="{cycle values="row_color_3,row_color_3,row_color_3,row_color_4,row_color_4,row_color_4"}"></td>
                                <th colspan="2">{$labels.expected_results}</th>
                        </tr>
                        <tr>
-                               <td>&nbsp;</td>
+                               <td class="{cycle values="row_color_3,row_color_3,row_color_3,row_color_4,row_color_4,row_color_4"}">&nbsp;</td>
                                {if $step_info.step_number == $gui->step_number}
                                        <td colspan="2">{$expected_results}</td>
                                {else}
                                        <td colspan="2" style="padding: 0.5em 0.5em 2em 0.5em">
-                                       <a href="{$hrefEditStep}{$step_info.id}">{$step_info.expected_results}</a></td>
+                                       <div>{$step_info.expected_results}</div></td>
                                {/if}
                        </tr>
                {/foreach}

The Unfortunate George Foster

I was listening to the Stuff You Missed in History Class podcast tonight titled “Who was the real Dr. Frankenstein?“.  The podcast was ok, was familiar with the popularity of “let’s shock dead things and see what happens” experiments in the early 19th century, and that the discussion of these had most likely sparked the idea of Dr. Frankenstein and his monster in Mary Shelley.

One specific detail really grabbed me.  While there was a fad, the original idea seems to have been largely conceived of by Luigi Galvani and popularized and refined as a road show by his nephew Giovanni Aldini.  I certainly don’t want to give these guys short shrift as they were clearly serious scholars.  Galvini gave his name to the process of galvanizing metals, among other achievements, and Aldini is the direct father of electro-shock therapy and the removed ancestor of the defibrillation process.  But, without quite so much academic detachment, what you basically had was a guy shocking a corpse in front of a live studio audience (don’t forget to tip your waitress!).

On January 18, 1803, George Foster was hung as the convicted murderer of his wife and youngest child.  After he was dead he was cut down and taken to the Royal College of Surgeons, where he was to be the main exhibit for Aldini’s performance that evening.  Aldini applied direct current to the face, causing muscles to clench and Foster’s left eye to open.  The show-stopper, though, was the application of the current to Foster’s rectum, resulting in convulsions in the entire body, including his arms being thrown into the air and his back arching as if he were taking a gasping breath.

Good times, good times.

After all this, the whole reason this really captured my interested was a statement made in the podcast that even if Aldini had “reanimated” Foster.  The exact words in the podcast were something like “police had a plan – if Foster had been reanimated he would have been re-executed”.

This strikes me as kind of a raw deal.  Not that I’m a big fan of murder, but, come on, being killed once should be enough.  I decided to track down this statement in the podcast and see if it had any basis in fact.

The first hit is George Foster’s wikipedia page, always a good place to start research (though a poor place to finish it, of course).  That page states that “[t]he Newgate Calendar reports that even if this had been so, he would have been re-executed since his sentence was to ‘hang until he be dead'”.  Nice.

The Newgate Calendar is two things.  First, it was a monthly summary of executions at Newgate Prison.  Secondly, it was very popular collection of stories of the various crimes committed and punishments received.  As I read it, in 1825 the parents in a family would have this book in the home to “scare straight” the kids.  It also appears to be fairly entertaining reading, in much the same way a horror movie can be entertaining.  But more on that in a minute.

I found two very good sources for the Newgate Calendar’s entry on George Foster.  The easiest to read is at a very interesting site I just found tonight called “The Ex-Classics Website“.  There is a page dedicated to George Foster’s entry.  Since I don’t know the reputation of Ex-Classics, I also found the entry on Google Books.  The Google Books entry corroborates the Ex-Classics page but is harder to read.  It’s worth it though because it provides the original layout – some context was lost in the Ex-Classics page.

Here’s the specific entry I’m curious about, the one regarding re-executing Foster (the line’s in a footnote, including the footnoted body text also for context):

[…] On the first application of the process to the face, the jaws of the deceased criminal began to quiver, and the adjoining muscles were horribly contorted, and one eye was actually opened. In the subsequent part of the process the right hand was raised and clenched, and the legs and thighs were set in motion. *[…]

* An experiment was made on a convict named Patrick Redmond, who was hanged for a street robbery, on the 24th of February, 1767, in order to bring him to life. It appeared that the sufferer had hung twenty-eight minutes when the mob rescued the body and carried it to an appointed place, where a surgeon was in attendance to try the experiment bronchotomy, which is an incision in the windpipe, and which in less than six hours produced the desired effect. A collection was made for the poor fellow, and interest made to obtain his pardon, for it will be remembered that the law says the condemned shall hang until he be dead; consequently men who, like Redmond, recovered, were liable to be again hanged up until they were dead.

This isn’t really what I was hoping for.  I imagined a court decree and armed guards around the building.  Instead we get this footnote, and here begins my real concern with the historical accuracy.  Because the popular Newgate Calendar essentially justified its existence by editorializing the crimes, this footnote basically reads to me as “Hey you kids, don’t think just because you might get resurrected that you can escape the fate that awaits you should you slip into a life of sin”.  So it appears that I have a contemporary source for the statement, but the source isn’t reliable.

I did have fun looking through this tonight even if the final stop isn’t the most satisfying.  I’ll end this with a great sentence, from George Foster’s entry in the Newgate Calendar

 [T]he cap was pulled over his eyes, when the stage falling from under him, he was launched into eternity.

Sources:

Ephemeral Bird Mosaic

Last winter something broke one of my favorite bird feeders.  I kept it, and in the spring smashed it up and made a mosaic of a bird with it.  I knew when I made it that it wouldn’t last outside.  I made no special effort to research materials, I just enjoyed smacking the thing with a hammer and gluing the pieces on a board.

I hung it from a tree in our yard and enjoyed it all summer.  When I noticed a couple of pieces falling off, I took it down, scraped the tile and glue off and threw the board back in the scrap pile.  A low effort, high enjoyment project.

I didn't take any pictures that I can find before I hung it up, but this is what it looked like

This is the day I took it down.

And all gone.

Coffee Can Jack-O-Lantern

A month or so ago I was hanging out in the garage with my daughters goofing off. I have this collection of coffee cans I can’t bring myself to get rid of, and for some reason I decided to draw a jack-o-lantern face on one. It turned out pretty well, so that evening I cut out the face with a dremel.

Looking Sharp

Looking Sharp...

No, the zippo's not upside down, the picture is.

After that I forgot about it for a while and it seemed like its only reason for existing would be to make me happy I had dug out my zippo a few days earlier.  But then I stumbled across a post about pumpkins and LEDs.  Perfect!  I took advantage of my wife’s spray paint habit (that is, she likes to spray paint stuff, not huff it) and dug up a can conveniently named “Pumpkin Orange”.  Hrmm.  I suppose it might be made to work.

I had a couple of missteps (my original attempt at highlighting the cuts did not go well), but I got the can fairly well done up.

Ugh. Starting to be able to see that mistake I made in his left eyebrow...

After a quick “throw in” test and experimenting with different colors, I decided to use a green LED for highlighting the shape and a flickering LED for ambience.  I cut a lid out of some old paneling then rigged up the LEDs to it with some screws and binder clips.

Better men than I have failed to take a good picture of a lit LED

Throw the lid on and see how it looks.

The dowel evokes a stem, yes?

Oof. That left eyebrow is looking worse and worse.

And finally a video.  This whole project really hinges on the flickering “candle” LED, it plus the green LED together make it look really good in person

All in all this was a really satisfying, relatively quick project.  My daughters loved it.  I think I’m going to give them each an appropriately sized piece of paper and let them each draw something I’ll cut out and they can customize (paint, choose lid, LED color, etc).  It also seems to have passed my wife’s crafting muster which is nice.

One unexpected thing – this has been sitting on my kitchen table for the last 24 hours or so, and it keeps catching my eye, even in daylight.  I think I’ve been so conditioned to not leaving candles or other exposed flame going that the flickering is catching my subconscious.