On Linux and random numbers

By Mark Gibbs, Network World |  Software Add a new comment

Look, I hate to bring this up, but there's something we need to discuss: Why haven't I heard from you recently? (No, not you, you've been in touch. It's this guy over here … ) Really, is it too much to ask that you put pen to paper … oh, all right, fingers to keyboard … and tell me what's on your mind?

Anyway, this week two things are on my mind. First, if you do anything even remotely serious with Linux then you'll be well aware of just how much documentation there is for the system. If that's the case then I'll bet you've probably thought "why doesn't someone produce a honking great thick book that summarizes more or less everything I might need to know about Linux?" If you have then your wish has been granted.

Linux in a Nutshell, 6th Edition just been launched to a clamoring world by O'Reilly and at 917 pages including index it beats the heck out of resorting to the "man" command. My one complaint (you may well relate to this) is that my eyes aren't what they used to be and the font size the book is set in is at my limit of resolution without glasses. As I can't see well enough to find my glasses, this is a problem. All you whippersnappers will be fine. This book is a great resource. A 5 out of 5.

Next random stuff. By which I mean really random because there are lots of IT problems where real random input is required (not to be confused with the random input you get from senior management).

I needed to find a way to generate a randomized sequence that consisted of all of the numbers from 1 to 75 with no repeats. Moreover, I wanted to be able to generate the list online for another online process to consume and, so far, I have found only one Web site that does anything like that: Random.org.

This site is run by Dr. Mads Haahr, a lecturer in the School of Computer Science and Statistics at Trinity College, Dublin, Ireland.

What's really cool about this service is that the random numbers it produces are truly random: The service uses multiple radio receivers that sample atmospheric noise on different frequencies as a source of random data. This is important as there are other online random number generators that use pseudo-random number generators (software algorithms that approximate random sequences) but for real scientific purposes these are of little use.

While I'm on the subject of random number sources, check out Lavarand, which describes itself as "a cryptographically sound random number generator of the highest quality".

Lavarand not only includes some really good discussions on the topic of randomness but also provides open source random number generating software and instructions on how to create a random source device called a "Lavacan" using a USB Webcam and some plastic pipe. I must make one of these. My office seems oddly unequipped without one.

So where was I? Oh yes … Random.org offers a sequence generator that almost does what I need but only offers two types of output: Plain text and HTML. Now what I needed was an XML formatted output and so I thought I could run the Random.org output through a Yahoo Pipe (which I discussed and reformat the output.

Unfortunately Yahoo Pipes won't take data from sources that have a robot exclusion file file to prohibit access … which, of course, is exactly how Random.org is configured! Hummm. What to do?

Use a proxy! Ah, but all of the public proxies I could find have a robot exclusion file so I had to set up my own proxy on my own server. I used PHProxy and enabled "hot linking" (this allows Web sites to access the proxy).

After that, it was easy. I created a Yahoo pipe to access the proxy, extract the random sequence from the Web page generated by Random.org, break the sequence into separate numbers, strip out unneeded tags and create an RSS feed. If you want a copy of the Yahoo pipe configuration, drop me a note.

    Add a comment

    Post a comment using one of these accounts
    Or join now
    At least 6 characters

    Note: Comment will appear soon after you have activated your account.
    Obscene/spam comments will be removed and accounts suspended.
    The information you submit is subject to our Privacy Policy and Terms of Service.

    ITworld LIVE

    SoftwareWhite Papers & Webcasts

    White Paper

    Best Practices Guide: Microsoft Exchange 2010 on VMware

    This guide provides best practice guidelines for deploying Exchange Server 2010 on vSphere.

    White Paper

    Free Trial: vRanger, the Powerful VMware Recovery Solution

    When disaster strikes, don't waste hours and dollars recovering critical data. vRanger delivers blazing-fast speed and granular recovery for your VMware applications and data. Get your free trial today.

    White Paper

    Executive Guide to Business and Software Requirements

    This paper is designed as an executive briefing on the issues surrounding business and software requirements. It features a wealth of statistics and tactics to help you get requirements right, and includes a tear-out single page summary.

    White Paper

    How to Launch a Successful IT Automation Initiative

    Corporations across all industries are under increasing pressure to cut costs and work more efficiently. In the race to meet both of these requirements, many organizations turn to technology, often purchasing and installing disparate pieces of software in hopes of achieving efficiencies not afforded by manual systems.

    White Paper

    Why Corporations Need to Automate IT Systems Management

    With corporate budgets being slashed and leaders expecting more out of their employees, companies are forced to do more with less, yet are still expected to provide the highest quality experience to customers. This is pushing them to make better use of their IT assets without breaking the budget. Companies are under more pressure than ever, thanks to data management regulations; increasingly complex security threats; and growing demand from management and end users for 24/7 uptime and high performance. These hurdles require a strategic investment in technologies that boost efficiency, save money and position IT as an integral part of the entire firm's operations. IT systems management is helping corporations fill these gaps.

    See more White Papers | Webcasts

    Ask a question

    Ask a Question