Various utilities

Hi Folks

Over the years I've collected various lists of utilities which, for some reason, caught my eye. And now, having plenty of time (note: jealousy is a curse) I've simplified my collection of lists and browser bookmarks...

o aescrypt:
- Encrypt
- http://www.aescrypt.com/

o atop:
- Monitor processes

o Basecamp etc:
- Collaborate remotely
- http://37signals.com/
- Basecamp, Backpack, Campfire, Highrise

o Compression comparison:
- http://www.maximumcompression.com/index.html
- Huge list of compression programs: http://www.maximumcompression.com/programs.php

o dstat:
- Monitor processes
- dstat --tcp

o Firestarter:
- Filewall
- http://www.fs-security.com/

o free:
- Monitor memory
- free -m

o GnuPG
- Encrypt
- http://gnupg.org/

o Help:
- http://www.debian-administration.org/article/How_to_find_out_which_process_is_listening_upon_a_port
- http://www.debian-administration.org/articles/178

o htop:
- Monitor processes

o ifconfig:
- Monitor network
- sudo ifconfig -a

o ifdata:
- Monitor network:
- Part of moreutils
- http://kitenet.net/~joey/code/moreutils/

o iftop:
- Monitor network

o iotop:
- Monitor I/O

o ip:
- Monitor network

o iptables:
- Filewall
- Cheat sheet: http://blog.oddeven.info/iptables-cheat-sheet/

A module version of perlbug

I want a cpanbug that's like perlbug. I don't have time to do this myself, but I've often wanted it. A long time ago, I wrote about the module equivalent for perlbug. Essentially, you say something like this:

% cpanbug Some::Module

It collects a lot of information, just like perlbug, and then sends it to the right place, which might not be rt.cpan.org. For instance, it might be Github.

That might be easier now with the improvements to the META spec and the MetaCPAN API.

YAPC::NA 2012 Call For Presenters Now Open!

We are now accepting talk proposals for YAPC::NA 2012

We’re of course interested in anything Perl-related you want to talk about. However, we have two areas we’re definitely interested in:

First, we’re looking for talks on Perl in the Wild. These talks are about businesses and individuals who have done great things with Perl. Perhaps you’ve automated your house with Perl, or built the latest and greatest web app. Or maybe you’re controlling Arduino boards to build robots with Perl. Maybe you’ve got amazing case studies in high-end performance with Perl. Or maybe, you’ve built a boring little app in Perl that has enabled your business to make millions of dollars. You could be building a great video game in Perl, or perhaps a social network to take down Facebook and Twitter.  Whatever it is that you’ve built or are building, we want to hear about it.

Perl and Parsing 11: Are all Perl programs parseable?

Before going further in this series, I want to touch on a question I have so far avoided: Are all Perl programs parseable?

Most languages do not pose this question. It was Adam Kennedy, in creating PPI, who first ran up against it. Adam conjectured that in fact Perl parsing may be undecidable. While in the planning stages for Marpa, I found Adam's conjecture and turned it into a formal proof.

Being the first to formalize this result, I took the initial heat over it, and now I get the credit. The dust has pretty much settled, and to my mild surprise, the result has proved of interest to the academic community. The initial revulsion at the idea of undecidable parsing has subsided, even to the extent that others now want to get into the act. I read on Wikipedia that LISP parsing is also undecidable. So all the cool kids seem to be doing it.

Data-Mining a Diagnosis in the ICU

Data-mining has found its way into hospital Intensive Care Units (ICUs):

I confess unease upon reflecting on Predictive Medical Technologies monitoring software, as the phrase "secret sauce" leads me to think of trade secrets – and trade secrets are in opposition to the tradition of open research. The only defense I can come up with is that their "secret sauce" might be in how quickly they process the information (as a process that takes 2 weeks to process 8 hours of results would be useless except as a proof-of-concept). On the other hand, it sounds like the IBM/UOIT collaboration should result in standard, open research results.

Pretty cool stuff all around, though.

Querying ElasticSearch from VIM

I'm using ElasticSearch quite a bit and finally decided to make it easy to debug. I now write JSON queries with a .es extension. And have this in my .vim/filetype.vim file:

autocmd! BufRead,BufNewFile *.es      setfiletype elasticsearch

In .vim/ftplugin/elasticsearch.vim I've just added a very minimal setup for ElasticSearch:

if exists("b:did_elastic_search_ftplugin")                                                                                                                                       
  finish                                                                                                                                                                         
endif                                                                                                                                                                            
let b:did_elastic_search_ftplugin = 1                                                                                                                                            

set syntax=json                                                                                                                                                                  
noremap ,r   :!json_check %<cr> 

Happy New Year!

Welcome to 2012. You made it! Can you believe it? I can't believe it either, the way you partied last night. Have you no shame?

Well it's time to make a New Year's resolution. You're coming to YAPC::NA 2012 in Madison, WI on June 13-15. 

While you're at it, have your spouse or significant other make the resolution with you. Bring them to the YAPC::NA 2012 Spouses Program.

Corelist and Perlbrew - 2 Perl command line tools for remote Perl work

As a Perl developer who works remotely sometimes, there are Quality Assurance measures and sanity checks I must make before releasing code to clients. The two that come up most predominantly are:
  • Will this script run under the Perl version available to the customer?
  • What Modules can I use for the work?
Will this script run under the Perl version available to the customer?
Why is this question relevant? Well, as a Perl enthusiast, I keep relatively up to date on my Perl versions.
tyler@inspiron:~$ perl -v 
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi

I have found that Perl 5.8.x is the most common distribution available on all servers I have worked with. So, how to make sure the code I write will not break on a 5.8.x Interpreter?

after5detroit.com

A few weeks ago I was asked if I'd be interested in re-making the after5detroit.com website. The interface had already been mocked up in Adobe Illustrator and the front-end/back-end design and architecture was still available for the taking. I of course took the gig. I was looking for an excuse to work on something new anyway.

Mojolicious::Lite, DBIx::Class and the Dojo Toolkit are my tools for this endeavor. I've been working with them for the past couple of years now and enjoy every minute of it (usually).

Sadly this is a paying gig so I can't share the code with any of you. But if I can pull something reusable out of it I'll see what I can do.

More to follow, I've got 6 weeks...

Tidying up my old CPAN code

I've just decided to spend a couple of hours tidying up my CPAN projects - surprising how little you can get done in an evening if you let things slip.. on the plus side, I've made a start and cleaned things up a bit :

  • Autodia page on my personal site now updated to point to latest version on metacpan, and files to svn trunk
  • Several bugs marked resolved, and updated, spam delete in rt.cpan.org
  • Emailed Smylers about consolidating the various GraphViz::DBI forks on cpan using some shared co-maint and github (anyone else interested give me a buzz)
  • Tidied up Graphviz::SQL and Math::Curve::Hilbert a bit and put them in github.

My Plan is to mark any bugs older than 5 years or for very old version of my cpan modules as stalled or won't fix and then get on top of what's left - all my CPAN modules are being moved into github too.

No code written this evening, but definitely useful time spent.

YAPC::NA Has A Mailing List

Did you know that YAPC::NA has a mailing list? Neither did I until a couple days ago. Starting now, I'll be cross posting our news items to the mailing list, in case that is your preferred way to receive news about YAPC::NA 2012.

Test::DBIx::Class

Today, I tried to test a freshly created DB schema using Test::DBIx::Class. Scanning through the documentation was impossible -- it knows far too many options to get captured within a few minutes. But carefully reading the brilliant manual is worth the time spent. Test::DBIx::Class has a lot of options and test-functions tailored especially to the needs of DB-testing.

My primitive schema knows 3 tables: Sensors, Measures and AlarmConditions. Inside my t/ directory, I needed to create only one supplementary file to allow the tests to get coded: a config file t/etc/schema.pl

{
    schema_class => 'Statistics::EasySchema',
    force_drop_table => 1,
    resultsets => [ qw(AlarmCondition Measure Sensor) ],
    connect_info => ['DBI:Pg:dbname=statistics_test', 'user', 'secret'],
}

Batch-Printing on Command-line via Print-Driver

Situation
  1. You have: a PDF containing about 10.000 pages.
  2. You need: a file that can be sent to your printer (Postscript, PCL, whatever)
Condition
batch-command, no manual interaction with Acrobat

Possible solutions:
Ghostscript
gswin64 -sDEVICE=pswrite -res300 -sPAPERSIZE=a4 -dBATCH -dNOPAUSE -sOutputFile=C:/temp/new.ps input.pdf
A very good solution for PDFs of "normal" count of pages. A conversion of 10.000 pages may last one hour or more depending on the complexity of PDF file

pdftops.exe from foolabs ( http://foolabs.com/xpdf/)

Mo supports chained accessors

with the help of ingydotnet++ valuable suggestions, Mo now has the option to chain accessors:

package ChainedAccessors;
use Mo qw/chain/;

has 'first'  => (chain => 1);
has 'second' => (chain => 1);


package main;

$f = ChainedAccessors->new;

$f->first(1)->second(2);

$f->first;  # 1
$f->second; # 2

thanks also for the feedback in response to my previous blog post

If you like doing unusual things when you visit a new place, one...



If you like doing unusual things when you visit a new place, one of the things you should definitely check out while you’re in Madison for YAPC::NA 2012 is the National Mustard Museum

On the bottom floor they have an archive of the history of mustard. You’ll be amazed by all the things you didn’t know about mustard. In addition, they even have jars of actual mustard dating back to over 100 years.

On the top floor they have the most amazing selection of mustards for purchase you have ever seen, literally hundreds of types of mustards. And best of all, you can sample any mustard in the store whether you intend to buy or not.

You will have to take a bus, a cab, or drive though, because the National Mustard Museum is about 6 miles from the YAPC facilities. It’s worth the effort. This is a possible destination for the Spouses Program.

Pagination has become kids play with Dancer ...

I published my first blog on 29th Sep'2011 about how Dancer and Rose::DB can be used together to build a web app in no time. Here is the link to that blog, if you have missed it.

I have been thinking of improving on that and first thing that came to my mind is how about adding pagination feature while displaying the items. There are many gems available on CPAN to help you in pagination. However I was looking for something that is easy to plug in with my Dancer web app. In my research I came across an example doing exactly what I was looking, although I find it incomplete by Alexis Sukrieh. Here is the link to that code.

I grabbed the idea from the above example and incorporated into my Dancer web app that I wrote as a part of my first blog. Here is the link to the code, in case you are looking for.

I am going to add this to my public github repository very soon.

Perl and Parsing 10: "Use" the Easier Way

In the previous post in this series, I described the way the Traditional Perl Parser (TPP) parses Perl's use statement. This post will describe an IMHO attractive alternative approach, using my own Marpa::XS. Marpa::XS has a prototype Perl parser as part of its test suite.

The TPP Way

If that previous post is not fresh in your mind, it may be useful at this point to look back at it. Summarizing, the TPP uses the "Ruby Slippers" method: It first simplifies the grammar so that, while convenient for the parser, the grammar falls short of describing the actual language. The lexer then fakes the input to the parser so that the parser's "wishful thinking" comes true.

In the TPP, the parser requires all use statements take this form:

use_statement ::= USE WORD WORD LIST

Here the WORD's may be either versions or names of modules -- the semantics looks at the internal representations to sort this out once the parsing is finished.

The Marpa::Perl Way

Request for Difficult Differential Equations

Firstly I would like to mention that I have just released version 0.06 of Math::GSLx::ODEIV2. For those of you who aren’t familiar with it (most of you I’m sure) this module represents a Perl-ish interface to the new GSL ordinary differential equation solver.

The major improvement of this version of my Perl module is the handling the Jacobian of the ode system. This allows the use all of the step functions in the original C library. In fact, other than one small feature that I would like to add (specifying quantity specific error limits), the module is just about feature complete.

This is a shot of the Gale VendeBerg Auditorium in the Pyle...



This is a shot of the Gale VendeBerg Auditorium in the Pyle Center. It will be used for many of the talks at YAPC::NA 2012.

Some pretty printing options for variables

Recently I needed something with the same functionality of Data::Dumper but prettier printing for dealing with nested structures. First stop Metacpan. I type in 'Data::Dumper' and the auto complete dropdown lists some suggestions and I try a few. Ovid's Data::Dumper::Names gives me the names of variables I pass in by reference. With Data::Dumper you would see this

$VAR2 = [ 
          [ 
            'plain', 
            'white' 
          ]
        ];
Now with Data::Dumper::Names it looks like this:

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.