[Perth-pm] Using perl?

James Bromberger james at rcpt.to
Sun Oct 24 22:37:22 PDT 2010


Neil, you asked "On a similar note, what do you use Perl for?".... here
goes....

Well more recent ones of mine were to generate the internal staff
directory to HTML by traversing the corporate Active Directory users OU.
I did this as a stand alone CGI, and under MediaWiki, and then also
remoddled this to create the Snom (www.snom.com) VoIP hardphone
directory (Snom handsets, very good).

Another is the /*MySQL Query Cache Top*/, kind of like Mytop, which is
kind of like top(1). It shows you performance of your MySQL query cache:
http://www.james.rcpt.to/svn/trunk/MySQLQueryCacheTop/mysqlquerycachetop.pl

I also have an Apache module that logs access to 3rd normal form, which
I call /*Log3NF*/, in MySQL:
http://www.james.rcpt.to/svn/trunk/Log3NFHandler/

I have done a bunch of Nagios tests, including:
* A very thorough MySQL replication check (available at
http://www.james.rcpt.to/svn/trunk/nagios/check_mysql_replication/check_mysql_replication.pl,
and I think its on Nagios exchange)
* A check for Bonded (teamed) interfaces under Linux to ensure that, if
you lose one link but your bond stays up, you get alerted to this!
http://www.james.rcpt.to/svn/trunk/nagios/check_bonding/check_bonding.pl

I wrote (and published to CPAN) two packages:
* /*WWW::IndexParser*/ (also in Debian as libwww-indexparser-perl) that
fetches a URL, and tries to parse it for items in the return HTML -
hence, making sense of the Auto Index pages (folders/directories) to
make iterating published content easier
* /*Net::Dynect::REST*/ (I spoke of a few weeks back) which implements
the REST API to the DNS service provider Dynect.

  James


On 25/10/2010 12:12, Neil Hunt wrote:
>
>
> On 25 October 2010 11:34, Peter Hallam <perth.pm
> <http://perth.pm>@inatick.com <http://inatick.com>> wrote:
>
>     On Mon, 25 Oct, 08:58 +0800 James Bromberger wrote:
>
>     There's a couple of orders of magnitude difference here, something
>     worth considering.
>
>     I've also looked at Neil's regex, which is slightly faster by
>     about 2%, and I've also looked at the tr// method, which is slower
>     by about 10%
>
>     Finally, if you want a concise (but slow) piece of code, I came up
>     with:
>
>     $url =~ s|([^:]+://[^/]+(:\d+)?/?)?(.*)?$|\L$1\E$3|;
>
>     Regards,
>     Peter.
>     _______________________________________________
>     Perth-pm mailing list
>     Perth-pm at pm.org <mailto:Perth-pm at pm.org>
>     http://mail.pm.org/mailman/listinfo/perth-pm
>
>
> "My regex" was taken from a website after I did a search.  I'm
> dreadful at regular expressions, and would never claim it.
>
> On a similar note, what do you use Perl for?
> I do everything I can in it, and say to many of my clients:
> "I'd rather code something in Perl in 20 minutes that do something
> manually in 15 minutes".
>
> My best achievement in Perl was automating a user creation system for
> a company I used to work for (with the help of Sun One Identity
> Synchronisation Server for Windows).
>
> Essentially a script was run which extracted all new users from the
> payroll system, then sent a list of new accounts to AD, created those
> accounts, created email accounts, assigned them to user groups (and
> mailing lists), and then dropped into Unix and created proper accounts
> for Unix purposes, as well as Oracle identities.  This was all based
> on a new person's job title (Customer Care Consultant, Credit
> Consultant, etc).  In the end it was about 400 lines of code in
> production, and around 5 times that in development.  Good times! 
> Alas, the company no longer exists, and I never got a copy of it when
> I was made redundant...
>
> Neil
>
>
> -- 
> Neil Hunt
> Senior Consultant
> HuntCorp Enterprises
> Phone: 0412 474 140
>
>
> _______________________________________________
> Perth-pm mailing list
> Perth-pm at pm.org
> http://mail.pm.org/mailman/listinfo/perth-pm


-- 
*James Bromberger*
Aus Mobile: +61 422 166 708
Email: james /_AT_/ rcpt.to, Web: www.james.rcpt.to
<http://www.james.rcpt.to/>
MSN: james/_AT_/rcpt.to, AIM: JamesEBromberger, Skype: james.bromberger
(/_AT_/ -> @)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/perth-pm/attachments/20101025/ee7b35a9/attachment.html>


More information about the Perth-pm mailing list