Tag Archives: random

rig: The random identity generator

I find rig terrifically amusing. I can’t tell you why; I just do.


I can’t wait for the next website that wants me to supply a name and address, probably while trapping me inside a lightbox effect, just to get an e-mail address or a 10 percent-off coupon.

The home page description is marvelously terse and you can learn everything there is to know about rig in a matter of minutes.

You can stick with male or female names, and demand a certain quantity beforehand. I’m not sure why the phone numbers are redacted, but that’s easy to barge through.

It’s a shame that rig, by default, only seems to handle addresses from America, but perhaps a quick look through /usr/share/rig/(whatever).idx will yield some ideas to get around that. Ideally, I’d love it if rig worked like polygen, and let you mold your own address rules.

No matter. rig is good for name generation, address generation and even city location. What you do with it is your business. :mrgreen:

pwgen: Making it up as you go

I like password generators. I don’t know why. I think they’re fun to watch in action, and they’re good to keep around even if there’s not much I really do with them.

Here’s pwgen, which I find amusing at the least.


pwgen might remind you of otp, which was mentioned last month. It has similar output and does much the same thing.

On the other hand, pwgen can wrangle passwords in a way that satisfies some constraints. For example, if a site requires you use a symbol (which I find incredibly annoying), pwgen can inject them. Same for capitalized letters or numbers.

It can also yank out certain characters, like vowels, thereby reducing the risk of accidentally creating a password that sounds “naughty” in English. 😳 Of course, for all you know, whatever is left could be a majestically foul utterance in another language. 🙄

I’ve noticed (because I played with pwgen so much 🙄 ) that the sequence of flags is important. For example:

kmandla@lv-r1fz6: ~$ pwgen -A -B -s -1

is different from

kmandla@lv-r1fz6: ~$ pwgen -s -A -B -1

and if you try you’ll see that the first one, in spite of the -A flag, will produce passwords with capital letters, probably because the -s came after. The second on the other hand, will pull them out before they hit the screen.

I have pass installed, so pwgen came along for free. You can use pwgen independently of pass though, which is only to be expected. 😉

mcookie: Mmm, cookies!

No, not really. mcookie will not spit a cookie out of your CD tray. Nice thought though.


mcookie does, however, spit out a random hex string of a predetermined length — which in and of itself might not enthuse you.

But we’ve seen some script-fu in the past that has had clever and practical application, and mcookie could conceivably substitute for that.

And considering that it’s part of the venerable util-linux array, it’s 99 and 44/100 percent likely to be present in your distro by default, predictable in its behavior, and maintained by people in the know.

So let’s review: Ubiquitous, reliable, up-to-date. That has all the makings for a good program.

Want to put it to use, beyond “generating a 128-bit random hexadecimal number for use with the X authority system?” Here’s a weak little idea:

let value=$(echo 0x$(mcookie | head -c2)) && echo $value

It’s a thumbsucker, but it spits out a random decimal value converted from the first two hex digits of mcookie‘s output. Nothing earth-shattering there, but hopefully shows a little of mcookie’s versatility. Mmm, cookies. :mrgreen: