Get started with Roland, a random selection tool for the command line

Get help making hard choices with Roland, the seventh in our series on open source tools that will make you more productive in 2019.
176 readers like this.
Using open source tools to play Dungeons and Dragons

Peaches&Cream on Flickr, CC BY 2.0

There seems to be a mad rush at the beginning of every year to find ways to be more productive. New Year's resolutions, the itch to start the year off right, and of course, an "out with the old, in with the new" attitude all contribute to this. And the usual round of recommendations is heavily biased towards closed source and proprietary software. It doesn't have to be that way.

Here's the seventh of my picks for 19 new (or new-to-you) open source tools to help you be more productive in 2019.


By the time the workday has ended, often the only thing I want to think about is hitting the couch and playing the video game of the week. But even though my professional obligations stop at the end of the workday, I still have to manage my household. Laundry, pet care, making sure my teenager has what he needs, and most important: deciding what to make for dinner.

Like many people, I often suffer from decision fatigue, and I make less-than-healthy choices for dinner based on speed, ease of preparation, and (quite frankly) whatever causes me the least stress.



Roland makes planning my meals much easier. Roland is a Perl application designed for tabletop role-playing games. It picks randomly from a list of items, such as monsters and hirelings. In essence, Roland does the same thing at the command line that a game master does when rolling physical dice to look up things in a table from the Game Master's Big Book of Bad Things to Do to Players.

With minor modifications, Roland can do so much more. For example, just by adding a table, I can enable Roland to help me choose what to cook for dinner.

The first step is installing Roland and all its dependencies.

git clone
cpan install Getopt::Long::Descriptive Moose \
   namespace::autoclean List:AllUtils Games::Dice \
   Sort::ByExample Data::Bucketeer Text::Autoformat \
cd oland

Next, I create a YAML document named dinner and enter all our meal options.

type: list
pick: 1
 - "frozen pizza"
 - "chipotle black beans"
 - "huevos rancheros"
 - "nachos"
 - "pork roast"
 - "15 bean soup"
 - "roast chicken"
 - "pot roast"
 - "grilled cheese sandwiches"

Running the command bin/roland dinner will read the file and pick one of the options.


Roland choosing a week's meals with one command

I like to plan for the week ahead so I can shop for all my ingredients in advance. The pick command determines how many items from the list to chose, and right now, the pick option is set to 1. If I want to plan a full week's dinner menu, I can just change pick: 1 to pick: 7 and it will give me a week's worth of dinners. You can also use the -m command line option to manually enter the choices.


Roland manual entry

You can also do fun things with Roland, like adding a file named 8ball with some classic phrases.


Playing 8 ball with Roland

You can create all kinds of files to help with common decisions that seem so stressful after a long day of work. And even if you don't use it for that, you can still use it to decide which devious trap to set up for tonight's game.

What to read next
User profile image.
Kevin Sonney is a technology professional, media producer, and podcaster. A Linux Sysadmin and Open Source advocate, Kevin has over 25 years in the IT industry, with over 15 years in Open Source. He currently works as an SRE at elastic.


What about the good old fortune command?

It was part of BSD games and has been included in virtual all linux distros. Adding your private fortune database is pretty trivial, no more complex than a YML file: your fortunes are (multi)lines of text separated by a % line, and you need to add a .dat file with the command
strfile -c % dinner dinner.dat
after which the command
fortune dinner
achieves essentially the same.

On ubuntu
sudo apt install fortunes
and you can view some samples in /usr/share/games/fortunes
some of which are great fun.

This is, without any doubt, an application that fills out a much-needed gap in the Linux world.

Great little article. Made everyone in my office laugh especially when someone spotted the inevitable "git clone ... Roland.git". Glad that a namesake of mine helps you plan your meals! Hope Roland McGrath (see glibc) knows about this...

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.