Commented SQL, Named Parameters, and PHP’s PDO module

I can’t include code in this post because I don’t own it, but I think I can discuss the concept, which I found really interesting.

A coworker had the idea to extend the PDO prepare() method to aid in debugging. I’m not sure if he implemented something he found on the net or it was an original idea, but I really like the results. It prepends, to every query executed, an SQL comment (ala “/* comment */“) including the username of the logged in user and the URL of the current request. This usually makes no difference, but if you’re in a really tough spot in debugging you can turn on mysql general_log, run the session that is having problems, and easily see every query that the was executed on behalf of the user having problems.

Continue reading

Swaks IPv6 Support – Initial Draft

I’ve put together an initial attempt at IPv6 support in swaks. If this sort of thing interests you, please take a look at what I have so far and let me know what you think.

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.

There is no documentation included yet, but the only real change to the documentation is the addition of the -4 and -6 options to force IPv4 or IPv6. There are a few unrelated tweaks since the last release, but nothing that needs documentation at this point.

Continue reading

TestLink 1.9.3 API Documentation

I have not been able to find any up-to-date documentation on the TestLink XMLRPC API online. The best I could find was phpdoc output from 1.8.x located at http://www.teamst.org/_tldoc/1.8/phpdoc_api/. The actual content of that page was pretty helpful, just out of date. Today I returned to trying to work with the API and decided to figure out how to generate the same document format for the 1.9.3 code. I’m placing it online in case anyone else had the same issue I did.

Continue reading

Why Hardware Gotta Make Me Love It So Hard?

Often when working on an electronics project I experience a problem that takes me way too long to debug. I don’t mind iterative debugging, it’s where I’m partially hanging my hat these days professionally, but it’s painful how often my lack of experience leads me up a dead end. The last time I got so angry I felt the need to write a post about it was an hour lost to software debugging when I had just crossed a couple of wires.

Continue reading

About The Name Swaks…

I began developing the tool that would become “swaks” on December 19, 2001.  The initial version was mostly just an adapted version of the sendpage my coworker Jamie Hill had written for simple SNPP transactions.  At that time the tool was called “vmail”, which meant something like visual- or visualize-mail.

On November 11, 2003, I posted a link to vmail on the exim-users mailing list.  I received lots of constructive responses, including one note that the name vmail was very generic, and also in use by another project (I wish I could remember who noted that, but I can’t find it in the mailing list archives).

Continue reading

Fun For Young and Old

One of my goals for the 2011/2012 Christmas break was having fun stuff to do with my daughters to cut down on the boredom and minimize slack-jawed TV watching.  While planning this out I stumbled across the Wayne and Layne kits, and the Blinky POV kit looked really nice.  It looked like a great kit to use to teach my daughter Mary (5) how to solder – it didn’t have too many components, it looked like it would be fun to play with when it’s finished, and I’m really, really intrigued by the “hold it up to the screen” programming method.

Right before I ordered the kit my Mom contacted me and asked for gift ideas for the girls. I immediately suggested this kit for Mary and sent my Mom the link to the project.  She said it looked like a great gift for Mary (which I expected) and she also said she really liked the idea of the Tactile Metronome kit (which I did not expect). I couldn’t pass that up, so I bought both kits.

Continue reading

Little Siege Engines and Little Girls

Last March I followed a link to the “Trebuchette” project on Kickstarter – “the snap-together, desktop trebuchet”.  I hadn’t used Kickstarter before but the Trebuchette project comtained more than enough awesomeness potential and I backed the project.  I had a slight disconnect after the project closed funding because I hadn’t really grasped that there would be a non-trivial delay between funding and shipping.  However, the frequent, informative posts from the project owners actual gave me a great deal of pleasure to read as they worked through the realities of building a physical-goods business.

The Trebuchette kits arrived right after Thanksgiving.  Since Christmas break was right around the corner I decided to put the kits on a shelf and wait until the second week of break when my daughters would be bored out of their skulls.  This plan sort of worked – they did ultimately enjoy them, but I made the mistake of telling them what the kit was when I got it and I had to fend off requests to put them together early every couple of days for a month.

Continue reading

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)