Final Solutions – Naatak

The play ‘Final Solutions‘ (trailer, pictures, more pictures), centers on Hindu-Muslim conflict in India, from partition to the current day. The play is presented by Naatak, a group of Indian theater enthusiasts here in the San Francisco Bay Area. The curtain raiser article in Indian Express gives much more background.

“OK – that’s very interesting, Pat, but what has it got to do with OpenSSO, identity, or anything I come here to read?” Well, OpenSSO development manager Ajay Sondhi appears in the play – in fact, you can just catch a glimpse of him at 0:29 in the trailer; Ajay is on the far left, with the yellow mask. If Ajay is involved, it’s clearly going to be good, so hop along to the Cubberley Theatre in Palo Alto – the last performance is this Friday, October 17th. Oh yeah, Ajay’s daughter, Kriti, has a lead role, but I don’t think she’s even filed a bug on OpenSSO, let alone committed code, so we’re wandering a little too far off topic with that information

Batch File to Delete Duplicate MP3s

Sharing this since it was pretty useful to me…

I noticed recently that I had a huge amount of duplicate files in my MP3 library. I think what had happened was that, on an iTunes upgrade, I’d rebuilt my iTunes index with iTunes set to ‘Copy files to library’. The result was thousands of files with names like “01 I Can’t Explain 1.mp3”, where iTunes had copied “01 I Can’t Explain.mp3” into the same directory, but had to rename the file.

So… What to do… Well, after seeing that the duplicate files were bit-for-bit identical to the original, but for the ” 1″ at the end of the filename, I realized I could write a simple batch file (my home PC runs Windows XP), that would find the duplicates, compare them with the originals to check that they were actually identical, then delete them:


@echo off
for /r "f:\my music\" %%I in (*.mp3) do (
if exist "%%~dpnI 1.mp3" (
echo Testing "%%~dpnI.mp3" against "%%~dpnI 1.mp3"
fc "%%~dpnI.mp3" "%%~dpnI 1.mp3" > nul
if not errorlevel 1 (
echo Match! Deleting "%%~dpnI 1.mp3"
del "%%~dpnI 1.mp3"
) else (
echo Found a non-match! "%%~dpnI.mp3" "%%~dpnI 1.mp3"
)
)
)

To be honest, it took me about an hour to figure out the right syntax for everything. I did try to neaten things up by assigning the "%%~dpnI 1.mp3" thing to a variable dupe, but gave up when I discovered that, in batch file land, variables are assigned when the line is read, not when it is executed (see this useful article for more explanation). To smarten up my batch file, not only did I have to use a strange !dupe! syntax (‘delayed variable expansion’), but I had to run it with cmd /v:on /c deldupes. In the end, I decided not to bother.

I hate batch files.

Making a Difference in a Sustainable Way

Kiva - loans that change lives

Prompted by James’ post, I just joined Kiva – a microfinance clearing house connecting individual lenders in developed countries (or indeed anywhere) with entrepreneurs from impoverished communities around the world. These are people who want to change their lives, but have little or no access to capital from traditional sources such as banks and credit cards. It’s a great concept – as it’s repaid, you can relend the money to other borrowers again and again and again.

OWASP Bay Area Meeting – June 25th 2008

Prompted by James, I signed up a little while ago to the OWASP Bay Area chapter, keen to learn more about application security, both in hardening OpenSSO and Access Manager and in how those projects/products can contribute to securing applications. Well, whaddya know, the next meeting is a half day Application Security Summit at the Microsoft facility in Mountain View next Wednesday, when I’ll be out of town. Keen as I am to attend OWASP, I think the Jazoon folks would be a little upset if I didn’t show up for my session on OpenSSO, so I’ll have to be content with encouraging folks in the Bay Area to attend – all the details are here and, apparently, space is limited, so if you’re interested, sign up now!