Friday, October 12, 2007

Tip for the day: GEEK DECODER RING

Ever want to sneek some not quite politically correct witticism or other thought past the "non-technical"? Or maybe you just want to un[en|de]code bits, hex or uu text (boring, but more practical).

Here's some simple perl code you can use for a geek/nerd/dweeb "decoder ring":

ENCODE INTO BITS, HEX, UU:

perl -ne'$b=unpack("b*",$_);@l=$b=~/.{0,56}/g;
print(join("\n",@l))' <
Tron rules!
RM

Just change the "b*" to "h*"
for hexidecimal or "u*" for
uuencoding.

DECODE FROM BITS, HEX, UU:

perl -ne'chomp;$a.=pack"b*",$_;END{print"\n$a\n\n"}'<
00101010010011101111011001110110000001000100111010101110
00110110101001101100111010000100
RM

I include my favorite messages that I otherwise might not write out in clear text in my signature file along with the decoder code. It's enough to scare away most. But, I've found those technically superior types get more of a kick out of "decoding" (cut and paste to UNIX/LINUX
command line) the message during their more productive moments. ;-)

No comments: