Dave Page

August 17, 2008

EXIFutils to the rescue

Filed under: Computers — Tags: , , — dave @ 1:13 pm

Bette teaches kindergarten. She takes pictures, and as the computer consultant, I have to upload them to the Walgreens website. So I use iTag to review them and add the IPTC keyword tag “printme” to the ones she wants printed. How to convert to Walgreens?

It’s not pretty. I use the wonderful EXIFUtils to extract a list:

S:\pix>exiflist /o l -f file-name,ip-keyword . | grep printme | sort
VVKG_20080811_144431.jpg,Kindergarten; garden; sunflower; printme
VVKG_20080812_155541.jpg,Kindergarten; garden; sunflower; printme
...

Sort it for ease of picking. Grep to filter out the ones with printme. Simple.

Until you start with Walgreens. You can either work with their ActiveX uploader, which truncates the last part of the filename, or add one at a time via a Browse button and the standard file-open dialog, which is slow.

Needed: upload a list, or allow multiple selections in the browse box. Or a new print vendor with a location 1/2 mile away. Still cheaper than printing them on a printer.

Also, I could use ThumbsPlus – you can do queries on a folder based on a keyword, then move those into a temporary folder, then upload the temp folder. Might even be easier.

Walgreens photo processing
EXIFUtils
ThumbsPlus


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Creative Commons License

July 20, 2008

KeePass Merge

Filed under: Computers, Software — Tags: , , , , , , , — dave @ 2:16 pm

I use KeePass to track hundreds of passwords, securely.

I also use Replicator to synchronize the files between my USB flash drive, home and work PCs. Sometimes it gets confused, mostly when I make changes at both ends. Replicator realizes this and stops. It creates a copy of the file, renames it password~1.kdb and replicates the two copies.

How to tell what changed? Cool tools like WinMerge only detect differences of binary files, not what changed. Especially for an encrypted file.

I export each file to an xml file, say password.kdb.xml and password~1.kdb.xml. I uncheck the top two - encode \n and eliminate backup items. Who cares? I include all fields below.

WARNING: these files now have ALL your passwords in cleartext. DELETE them when done — preferably a DOD delete.

Each record has a GUID — so no matter what change you make to the record, the GUID remains the same. So the way to check is to sort the XML by GUID and then compare the two with a diff tool.

I wrote an XSL stylesheet to sort them:


------keepass-exp-sortbyguid.xsl----------
<xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” version=”1.0″>
  <xsl:template match=”pwlist”>
    <xsl:apply-templates>
      <xsl:sort select=”uuid”/>
    </xsl:apply-templates>
  </xsl:template>
  <xsl:template match=”*”>
    <xsl:copy>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

I use the msxsl transformer cuz its easy on windows. Use your own, or send me a script for cygwin tools.

iconv is required to convert the output of the XSL transform from UTF-8 into ISO-8859-1 or else bad things happen down the chain.

Here is the batch file to drive them:

------keepass-export-xml-sorter-converter.bat----------
setlocal
rem take the xml output of keepass export, sort them by UUID,
rem export to new file for comparison. CLEARTEXT!!!

set ICONV_HOME=c:\Program Files\GnuWin32\bin
msxsl password~1.kdb.xml keepass-exp-sortbyguid.xsl | “%ICONV_HOME%\iconv”
  -f UTF-16 -t ISO-8859-1 | tidy -xml -i -wrap 99999 > password~1.kdb.sort.xml
msxsl password.kdb.xml keepass-exp-sortbyguid.xsl | “%ICONV_HOME%\iconv” -f UTF-16
 &nbsp-t ISO-8859-1 | tidy -xml -i -wrap 99999 > password.kdb.sort.xml

endlocal

Now it is trivial to compare the two with WinMerge and identify the differences — everything lines up!

I had a problem this last time with characters that do not convert — typographic quotes and em dashes (ala Word Auto-Correcting). If you see
09063 Flaming Moeiconv: x: cannot convert
check the line for the goofy chars.

This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Creative Commons License

March 6, 2008

clip.exe

Filed under: Software — Tags: , , , , , , , — dave @ 2:14 pm

I wrote a utility called clip many years ago — you pipe output from a DOS program into it and it puts it on the clipboard. Then you can paste it somewhere.

e.g. dir > clip

I found a link to Copy Command Line Output to Windows Clipboard Directly. Turns out Microsoft had the same idea and put a clip.exe into Windows 2003 and Vista. He links to a site, but not trusting them, I checked out a local Windows 2003 install, and yes, there it was!

The MD5 is B265B924104C248FB94C3B6D7E8D4050, CRC (zip) is 0C7584A7 — just as shipped from the great god Microsoft. I would use a local copy, if you have one, but it looks safe enough.

Powered by WordPress