The linked XKCD's are #225
"Open Source" and #239
"Blagofaire" (the one with Cory Doctorow in a hot-air-balloon). Stallman-with-a-katana also shows up in the five-part arc #341-345
"1337". (I don't know if there were others?)
https://xkcd.com/341/
I'm inferring the real-life katana was a joke based on #225 (and maybe Randall Munroe wrote it in again in reference to the real-life object).