<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Hmm...</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>For a below par round, all of these could be shortened considerably with a minor use of alias :-) Or is that cheating?</span></div><div><br></div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">Brent<br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr
 size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Donovan Jones <lug@gamma.net.nz><br> <b><span style="font-weight: bold;">To:</span></b> Brent Wood <pcreso@pcreso.com>; Wellington Linux Users Group <wellylug@lists.wellylug.org.nz> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, February 13, 2014 9:37 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [wellylug] If you are stuck for ideas for a lightning talk session<br> </font> </div> <div class="y_msg_container"><br><div id="yiv6914461809"><div><div dir="ltr">I cant resist a bit of golf:<div><br clear="none"></div><div>dpkg --get-selections | awk '{print $1}' | sort -R | head -1<br clear="none"></div><div><br clear="none"></div><div>Donovan</div></div><div class="yiv6914461809gmail_extra"><br clear="none"><br clear="none"><div class="yiv6914461809gmail_quote">
On Thu, Feb 13, 2014 at 6:23 AM, Brent Wood <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:pcreso@pcreso.com" target="_blank" href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</a>></span> wrote:<br clear="none"><blockquote class="yiv6914461809gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="yiv6914461809yqt9420848589" id="yiv6914461809yqt87925"><div><div style="font-size:12pt;font-family:arial, helvetica, sans-serif;"><div><span>And a wellylug equivalent to the perlmongers solution by Grant for selecting a random package on a Debian based Linux system:-)<br clear="none"></span></div>
<div><br clear="none"></div><div>dpkg --get-selections | tail -n `rand -M \`dpkg --get-selections | wc -l\`` | head -1</div><div><br clear="none"></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial, helvetica, sans-serif;">
I figured you should be able to do this with common Linux commands, without resorting to a programming or scripting language.</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial, helvetica, sans-serif;">
This is one way...<br clear="none"></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial, helvetica, sans-serif;"><br clear="none"></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial, helvetica, sans-serif;">
If I thought about it a bit more I figure awk could probably do this a bit more elegantly, if not even more arcanely!.<br clear="none"></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial, helvetica, sans-serif;">
<br clear="none"></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial, helvetica, sans-serif;"><br clear="none"></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial, helvetica, sans-serif;">
Brent<br clear="none"></div>  <div style="font-family:arial, helvetica, sans-serif;font-size:12pt;"> <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Grant McLean <<a rel="nofollow" shape="rect" ymailto="mailto:grant@mclean.net.nz" target="_blank" href="mailto:grant@mclean.net.nz">grant@mclean.net.nz</a>><br clear="none">
 <b><span style="font-weight:bold;">To:</span></b> <a rel="nofollow" shape="rect" ymailto="mailto:wellylug@lists.wellylug.org.nz" target="_blank" href="mailto:wellylug@lists.wellylug.org.nz">wellylug@lists.wellylug.org.nz</a> <br clear="none"> <b><span style="font-weight:bold;">Sent:</span></b> Wednesday, February 12, 2014 3:50 PM<br clear="none">
 <b><span style="font-weight:bold;">Subject:</span></b> Re: [wellylug] If you are stuck for ideas for a lightning talk session<br clear="none"> </font> </div><div><div class="yiv6914461809h5"> <div><br clear="none">Presumably the WellyLUG session on Monday will take a relaxed approach<br clear="none">
to the five minute time limit (as the Perl Mongers did last night) so<br clear="none">the dire warnings in that page can be ignored.<br clear="none"><br clear="none">Also, I'm guessing that people with slides will either bring their own<br clear="none">
laptop or put them on a web page.  Bringing PDF/OpenOffice/HTML files on<br clear="none">a USB stick could also work.<br clear="none"><br clear="none">The suggestion on our page that people might randomly select a Perl<br clear="none">
module to talk about could be adapted to "randomly select an OS<br clear="none">package".  For example on a debian-based distro, this 1-liner will<br clear="none">randomly select one of the packages you have installed:<br clear="none">
<br clear="none">  dpkg --get-selections | \<br clear="none">      perl -E '@p = map { s/\s.*//r } <>; say $p[rand(+@p)]'<br clear="none"><br clear="none">See you Monday.<br clear="none"><br clear="none">Cheers<br clear="none">
Grant<br clear="none"><br clear="none"><div><br clear="none">On Wed, 2014-02-12 at 15:14 +1300, Hugh Davenport wrote:<br clear="none">> Graciously stolen from Wellington Perl Mongers, who had a<br clear="none">> lightning session last night.<br clear="none">
> <br clear="none">> <a rel="nofollow" shape="rect" target="_blank" href="http://wellington.pm.org/lightning_talks.html">http://wellington.pm.org/lightning_talks.html</a><br clear="none">> <br clear="none">> I shall add this to the WellyLUG page at some point.<br clear="none">
> <br clear="none">> Let me know if you get a spark of ideas for a talk next monday!<br clear="none">> <br clear="none">> Cheers,<br clear="none">> <br clear="none">> Hugh<br clear="none">> <br clear="none">
> <br clear="none"><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">Wellington Linux Users Group Mailing List: <a rel="nofollow" shape="rect" ymailto="mailto:wellylug@lists.wellylug.org.nz" target="_blank" href="mailto:wellylug@lists.wellylug.org.nz">wellylug@lists.wellylug.org.nz</a><br clear="none">
To Leave:  <a rel="nofollow" shape="rect" target="_blank" href="http://lists.wellylug.org.nz/mailman/listinfo/wellylug">http://lists.wellylug.org.nz/mailman/listinfo/wellylug</a><br clear="none"></div><br clear="none"><br clear="none"></div> </div></div></div>
 </div>  </div></div></div><br clear="none"><br clear="none">
--<br clear="none">
Wellington Linux Users Group Mailing List: <a rel="nofollow" shape="rect" ymailto="mailto:wellylug@lists.wellylug.org.nz" target="_blank" href="mailto:wellylug@lists.wellylug.org.nz">wellylug@lists.wellylug.org.nz</a><br clear="none">
To Leave:  <a rel="nofollow" shape="rect" target="_blank" href="http://lists.wellylug.org.nz/mailman/listinfo/wellylug">http://lists.wellylug.org.nz/mailman/listinfo/wellylug</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br><br></div> </div> </div>  </div></body></html>