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:
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.
Over at Sun Developer Network today, Sidharth Mishra talks to Marina Sum about Security for Web Services. It’s an interesting, high-level discussion, covering both the motivations for securing Web services and some of the standards and technology in the area. In particular, there’s a useful explanation of the role of the Security Token Service (STS) in brokering trust between Web service consumers and providers.
Get yourself a nice cup of tea (or, if you must, coffee ) and give it a read.
I’ve blogged before on OpenSSO Extensions – useful modules that do not fit into the OpenSSO ‘core’. Among the various categories of extension are ‘authentication modules’ – one of the most common customizations for OpenSSO and Access Manager. An authentication module supports a particular mechanism for collecting and verifying a user’s credentials – common mechanisms that are supported out-of-the-box include username/password against LDAP, client certificates (encompassing browser certs and smartcards) and Windows Desktop SSO (aka SPNEGO, aka Kerberos).
Of course, technology refuses to stand still, and new authentication mechanisms are constantly being developed and deployed – new biometrics, hardware tokens, even whole new authentication protocols. Over the past few months, we’ve seen a clutch of new authentication modules in OpenSSO, so it’s time to take a look at what’s new…
The Hitachi Finger Vein Biometric module (README), developed by Yasushi Iwakata, interfaces with a infra-red based reader to use the unique patterns of veins in each user’s finger as a credential. Yasushi recently left Sun, but continues as an external contributor to OpenSSO.
Strictly speaking, Wajih Ahmed‘s RSA Access Manager authentication module is located in the ‘core’ OpenSSO area, but it’s an authentication module just the same. It allows you to integrate OpenSSO (or, of course, Access Manager) with, uh, RSA Access Manager (formerly known as ClearTrust) for co-existence, either permanently or as an initial phase in a migration. Again, there’s a README to get you started.
So, three very different authentication modules. Maybe you have an idea for a fourth?
Prompted by James’ post, I just joinedKiva – 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.