This is a little easier than dealing with the card protocols directly, if it works for your use case (and for other readers who may want to use the card's RNG, it's directly usable in scripts etc):
Code:
echo "scd random 128" | gpg-connect-agent
This sends a command via stdin to gpg-connect-agent, which sends it to your currently running gpg-agent, which in turn sends "random 128" to scdaemon, which should, as I understand the
scdaemon command protocol, ask your card to generate 128 bytes and return it to you. You should see your Neo's button flicker every time you run this command. Remove/reinsert your card or run gpg --card-status (or both) if it complains about the card not being connected.
Granted the output isn't exactly clean (it spits out response characters like "OK" along with the entropy sample). I believe it should be possible to have it output this in the GnuPG "machine readable" format (the one used by libgpgme and enabled by gpg's --with-colons option), but it doesn't seem to work as an option to gpg-connect-agent.
Even so, the output of that scd command should be predictable, a script or program could pretty easily account for it (awk could trim it too, but I'm not so good with awk
)