Shlomi Fish  committed 26a9f1b

Add entry about countdown, GNU parallel, etc.

  • Participants
  • Parent commits 2968e5c

Comments (0)

Files changed (1)


+<div class="entry" id="three_command_line_utilities">
+<ul class="info">
+<li><b>Date:</b> 14-11-2012</li>
+<li class="tags">cpan, perl, command, line, cli, bash, gnu, parallel, sleep</li>
+<h1>Three Command-Line Utilities</h1>
+So, November is
+<a href="">NaNoWriMo</a> (“National Novel Writing Month”), and I was hoping to get some serious
+writing done (instead of coding), but I kept being distracted with coding
+and random writing in various Internet forums. Well, hopefully this blog
+post will compensate a little for that.
+In this post, I’d like to cover three command-line utilities - two of them
+new and were written by me, and one of them somewhat older, but also written
+in Perl.
+The first utility is
+<a href="">GNU Parallel</a>, which
+allows one to run several command-line jobs in parallel, using forking and/or
+ssh remote logins. I used it to speed up some processing I've been doing on
+my computer. For more information and some examples of usage, see
+<a href="">my
+post about it to the linux-elitists mailing list</a>, and also read
+<a href="">Thomas
+Sattler’s response</a> which provides some further insights.
+The second utility is
+<a href="">countdown</a>, which is
+similar to the UNIX command-line sleep command, but displays the remaining
+time on the console. I wrote a prototype for it in Perl 6, only to discover it
+consumed far too many resources. The second prototype, as a Perl 5 program
+consumed close to zero resources of my computer. Yesterday, I converted it to
+a modulino (a Perl application implemented as a module) and uploaded
+several versions to the CPAN.
+The third utility is something I have placed in my
+<tt>~/.bashrc</tt> file in order to implement reminders when the shell
+starts. The code for it is:
+if [ -s "$reminder_file" ] ; then
+    perl -Mstrict -Mwarnings -MTerm::ANSIColor -E 'my $x = colored("===", "bold red"); say "$x Reminders $x"'
+    cat "$reminder_file"
+    rm "$reminder_file"
+I wrote it because I wasn't prompted in time by Thunderbird+Lightning
+due to a strange bug, and because I had to ditch KOrganizer because it
+consumed too many resources here. This displays the Reminders whenever you
+start a new shell, which happens quite often with me, so it's OK. I use
+cron jobs to append stuff into "$reminder_file", and the Perl code displays
+a header in colour.
+That’s it for today.
+<a href="">App-Countdown</a> is one
+step closer for the count-up (pun intended) towards the coveted 100
+distributions under “SHLOMIF” on CPAN, so that's another plus.