<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Grant McLean</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/grant_mclean/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/grant_mclean/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/grant_mclean//1542</id>
    <updated>2012-10-22T06:19:54Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>Map of CPAN - The Movie</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/grant_mclean/2012/10/map-of-cpan-the-movie.html" />
    <id>tag:blogs.perl.org,2012:/users/grant_mclean//1542.3981</id>

    <published>2012-10-22T06:10:57Z</published>
    <updated>2012-10-22T06:19:54Z</updated>

    <summary>If you&apos;ve visited the Map of CPAN more than once, you&apos;ll notice that it has changed quite significantly over time. Coloured namespace areas expand as new distributions are uploaded and this expansion pushes other namespaces around - producing a kind...</summary>
    <author>
        <name>Grant McLean</name>
        
    </author>
    
    <category term="cpanmapanimation" label="cpan map animation" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/grant_mclean/">
        <![CDATA[<p><img alt="poster.png" src="http://blogs.perl.org/users/grant_mclean/2012/10/22/poster.png" width="304" height="445" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" />If you've visited the <a href="http://mapofcpan.org/">Map of CPAN</a> more than once, you'll notice that it has changed quite significantly over time. Coloured namespace areas expand as new distributions are uploaded and this expansion pushes other namespaces around - producing a kind of continental drift.</p>

<p>I thought it might be interesting to assemble a stop-motion animation of these changes. The result is: <a href="http://vimeo.com/grantm/map-of-cpan">Map of CPAN – The Movie</a>.</p>

<p>As with the static map, the colours don't really have any meaning beyond grouping together modules that share a namespace. The colours have even less meaning in the animation since I've used a static namespace-to-colour mapping which doesn't change as the areas move.</p>

<p>If you look closely you'll see little dark blue squares flashing by. Each flash represents the upload of a <strong>new</strong> distribution (i.e.: not a new release of an existing distribution).</p>]]>
        
    </content>
</entry>

<entry>
    <title>Idle alerts with bcvi</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/grant_mclean/2012/09/idle-alerts-with-bcvi.html" />
    <id>tag:blogs.perl.org,2012:/users/grant_mclean//1542.3864</id>

    <published>2012-09-22T05:20:23Z</published>
    <updated>2012-09-22T05:55:45Z</updated>

    <summary>In case you haven&apos;t met it before, bcvi is a crazy backwards tool (written in Perl of course) that lets you type commands on a server to make things happen on your workstation. I&apos;ve just released an update to the...</summary>
    <author>
        <name>Grant McLean</name>
        
    </author>
    
    <category term="perlsshbcvinotifications" label="perl ssh bcvi notifications" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/grant_mclean/">
        <![CDATA[<p>In case you haven't met it before, <a href="http://sshmenu.sourceforge.net/articles/bcvi/">bcvi</a> is a crazy backwards tool (written in Perl of course) that lets you type commands on a server to make things happen on your workstation.  I've just released an update to the notifications plugin so I thought I'd blog about it here.</p>

<p>Here's a simple example to illustrate what the notifications plugin does.  Imagine you've SSH'd into a server to kick off some long running command and you'd like to be notified when the command finishes. In this example, I'm running a database restore:</p>

<pre><code>$ pg_restore -d acmecrm crm.pgdump; bnotify 'DB is restored!'
</code></pre>

<p>When the pg_restore completes, the <code>bnotify</code> command will be run. Bnotify is an alias for bcvi which will send a message back to your workstation to pop up a desktop notification.</p>

<p>The new feature is that bnotify now accepts a <code>--idle</code> option to send you a notification when the TTY is idle.  The reason I wanted this is that I'm currently doing a bunch of server upgrades and although the upgrade process mostly runs unattended, I do get prompted for questions at intervals.  Here's how I use the new feature:</p>

<pre><code>$ bnotify --idle
Starting background process to monitor /dev/pts/0 for 20 second idle period
Kill monitor with: bnotify --kill
$ sudo apt-get dist-upgrade
[sudo] password for grant: 
Reading package lists... Done
Building dependency tree       
The following NEW packages will be installed:
...
</code></pre>

<p>I will then leave the upgrade running and switch to do something in another window (or desktop).  Some time later, the upgrade process will either complete or will pause to ask me how I'd like to deal with a possible conflict with a new version of a config file that wants to replace one I've modified.  Either way, bnotify will notice that there's been no output on the terminal for some amount of time (default 20 seconds) and will signal my workstation to alert me with a message: "Notification from [servername]. Terminal is idle".</p>

<p>In my case, the workstation end of the notifications process is handled by <a href="https://metacpan.org/module/Desktop::Notify">Desktop::Notify</a> - which works on Linux desktops (e.g. Gnome2/3, XFCE, KDE probably). But you could replace that with something that talked to Growl on a Mac.</p>

<p>Links:</p>

<ul>
<li><a href="https://metacpan.org/module/App::BCVI">App::BCVI</a></li>
<li><a href="https://metacpan.org/module/App::BCVI::NotifyClient">App::BCVI::NotifyClient</a></li>
<li><a href="https://metacpan.org/module/App::BCVI::NotifyDesktop">App::BCVI::NotifyDesktop</a></li>
</ul>
]]>
        

    </content>
</entry>

</feed>
