Shorewall 5.2.3.5 Released!

Shorewall 5.2.3.5 is now available for download. Shorewall is a gateway/firewall configuration tool for GNU/Linux, written in Perl.

Problems Corrected:

1) A typo in the FTP documentation has been corrected.

2) The recommended mss setting when using IPSec with ipcomp
has been corrected.

3) A number of incorrect links in the manpages have been
corrected.

4) The 'bypass' option is now allowed when specifying an
NFQUEUE policy. Previously, specifying that option resulted
in an error.

5) Corrected IPv6 Address Range parsing.

Previously, such ranges were required to be of the form
[-] rather than the more standard form
[]-[]. In the snat file (and in nat actions),
the latter form was actually flagged as an error while in
other contexts, it resulted in a less obvious error being
raised.

6) The manpages have been updated to refer to https://shorewall.org rather than http://www.shorewall.org.

Call for FOSDEM 2020 Booth volunteers

This year we've got one of the high-traffic locations, on the ground floor where Free Software Foundation Europe set up last year, right next to the stairway to *all* the dev rooms. So we're looking for volunteers to come and talk about both Perl and Raku at FOSDEM 2020 in Brussels. If I haven't already talked to you, please email me at drforr [at] pobox (dot) com and give me an idea of your availability and what you'd want to do. We've made arrangements for the usual booth swag, and will have pamphlets to hand out and books to sell on both Raku and Perl.

Again, if you're able to give us a hand or know someone that can, send me email at drforr [at] pobox (dot) com and give me an idea of when you're available and how much you can help out.

Perl Weekly Challenge 043: Olympic Rings and Self-Descriptive Numbers

Olympic Rings

There are 5 rings in the Olympic Logo [as shown below]. They are colour coded as in Blue, Black, Red, Yellow and Green. We have allocated some numbers to these rings as below: Blue: 8, Yellow: 7, Green: 5, Red: 9. The Black ring is empty currently. You are given the numbers 1, 2, 3, 4 and 6. Write a script to place these numbers in the rings so that the sum of numbers in each ring is exactly 11.

My first idea was to go over all the possible permutation of the numbers and report those that satisfy the sum condition. I chose Math::Combinatorics as the module to handle the permutations.

Create PDF using Perl/PDF::API2

I wrote a practical and detailed description of Perl's PDF::API2.

It turns out that PDF::API2 is a library for performing necessary and sufficient PDF operations.

Create PDF using Perl/PDF::API2

Paws XXXXVIII (Way too many 'I' s)

Well I think it is a first here in the Paws patrol. I spent the day plunging away with CloudFront and I have no new Paws issues but I did learn and important practical lesson about using CloudFront.

I got stuck on the 'UpdateCloudFrontOriginAccessIdentity' call.

It seemed simple enough


$s3->UpdateCloudFrontOriginAccessIdentity(
    CloudFrontOriginAccessIdentityConfig => {
        CallerReference => 'Some text here',
        Comment         => 'Mr Pooppy buthole did this',
  },
  Id=> 'E3D5Y5RWA05QO1',
);

but I kept running into this error;

The request failed because it didn't meet the preconditions in one or more request-header fields.

Ok what is that?

A Date with CPAN, Update #3: Golden Jubilee

[This is an addendum post to a series.  You may want to begin at the beginning.  The last update was update #2.

IMPORTANT NOTE! When I provide you links to code on GitHub, I’m giving you links to particular commits.  This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post.  Just be aware that the latest version of the code may be very different.]


In case you missed my talk on Date::Easy from a couple years back, I’ll sum it up for you: dates are hard, y’all.

No more rhyming and I k-means it!

"... anybody wanna peanut?" - Fezzik, TPB

When last we saw our heroes, they had just applied PDL::Stats::Kmeans to a CSV file of car data with no thought regarding their own well-being.

In today's episode, we see them slice through data to identify clusters of cars, only to find they know less than they did before!

Read on, true believers!

Perl Weekly Challenge 42: Octal Numbers and Balanced Parentheses

These are some answers to the Week 42 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a couple of days (January 12, 2020). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.

Challenge # 1: Octal Number System

Write a script to print decimal number 0 to 50 in Octal Number System.

For example:

Decimal 0 = Octal 0
Decimal 1 = Octal 1
Decimal 2 = Octal 2
[ ... ]

For this task, I’ll start with Raku, because it is so easy in Raku.

Octal Number System in Raku

Raku has a base method to convert a number into a string representation in any base between 2 and 36.

Paws XXXXVII (What about the tests????)

I decided I might as well get busy with CloudFront and at least get most of my real world scripts written.

At the moment I am getting 400 errors such as 'InvalidArgument' or 'InvalidOrigin' on the Delete and Create actions as I do not have the proper config on the AWS end for the Creates and for the Deletes as I do not have anything on my AWS account to delete.

Reading though the API documentation is seems there is quite the procedure to actually do some of the actions, for example to invoke the DeleteStreamingDistribution action you have to follow a six pre-steps all of which must pass. So I guess I can forget a quick run on this API

So the plan is to get all the real world scripts written up and then go though the full CRUD actions for each and get them working with a good generated test case for each.

Modern functions in a post-modern language

The new _modern function variants in Time::Local have come up a few times lately. I have some thoughts on them, but presenting my position dispassionately enough to be persuasive demands an essay of unfortunate length… so let’s get on with it.

Let me lead with the positive: it is a problem with the traditional functions that they would sometimes add 1900 to the year and sometimes a different value and sometimes nothing. This heuristic in the interface is bad. Doing something about it is a good idea.

Let me also lay out some simple statements of fact: Perl ships with gmtime and localtime functions which return a datetime represented as a list of numbers. Time::Local supplies inverse functions which take such a list and return the Unix epoch time that corresponds to that datetime. The Perl functions, among other things, return the year as the number of years since 1900. A correct inverse of the core functions would therefore simply add 1900 to the year passed.

The traditional Time::Local functions do not fully do this: they only do it if the year number is just big enough but not too big.

My Y2020 Bug

For reasons that must have been clear at the time, I once wrote a test in terms of epoch time, and wanted it to run on systems that did not use January 1 1970 as the epoch. So I loaded Time::Local and added timegm( 0, 0, 0, 1, 0, 70 ) to the desired epoch.

This morning I got a CPAN testers report failure. It seems that if you give timegm() a year in the range 0-99 it assumes it is within 50 years of the current year, so my test suddenly thought the epoch was 2070.

In this case, the obvious response is to specify a four-digit year.

Maybe a better response is to ditch timegm() and timelocal() completely in favor of timegm_modern() and timelocal_modern(). These require Time::Local version 1.27, released June 2019. According to its metadata it works back to Perl 5.6, though so far I have only verified it back to Perl 5.8.1.

With thanks to Dave Rolsky for the *_modern() variants, and to Chris Williams (BINGOS), who uncovered this in one of his CPAN tester systems.

CPAN Testers Rule!

Class, Role And Attribute Accessor in Raku

Quite ingenious title I used here, but it's precise. This story starts with the following case:

role R {
    method a { 666 }
}
class C does R {
    has $.a = 42;
}
say C.new.a;


What would you expect this to print?

For those with basic or no knowledge in Raku I'd like to explain that a public attribute gets an automatic accessor method. So, when one does $obj.attribute it's actually a method call.

There could be some disagreement among devs wether the code should output 42 or 666. Though Raku states it explicitly that things defined by class have priority over role's declared ones. Hence, we expect 42 here.

Period, this post is over, everybody is free to go? Alas, this issue says that the code above outputs 666! Oops... What's going on here?

Perl Weekly Challenge 41: Attractive Numbers and Leonardo Numbers

These are some answers to the Week 41 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a couple of days (January 5, 2020). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.

Challenge # 1: Attractive Numbers

Write a script to display attractive number between 1 and 50.

A number is an attractive number if the number of its prime factors is also prime number.

The number 20 is an attractive number, whose prime factors are 2, 2 and 5. The total prime factors is 3 which is also a prime number.

First comment: we’re obviously interested only with proper prime factors, i.e. prime factors of a number other than 1 and the number itself.

Annual Report - 2019

Annual Report - 2019


2019 Resolution

At the start of the year 2019, I made new year resolution that I will submit at least 50 Pull Request each month in the year 2019. It wasn't easy but I was able to hold on to my resolution with the help of many CPAN authors. In the year 2020, I am going to take little easy and revert back to one Pull Request a day each month.


Perl Weekly Challenge

The main attraction of the year was "Perl Weekly Challenge" started on 25th March 2019. It is platform for Perl and Raku fan to share the knowledge. As of now, we have successfully completed 9 months of weekly challenge. As of today, we have 140 active members.


Perl Weekly Challenge Club

Communication at the 36c3 Perl and Raku Assembly

The Chaos Communication Congress is the hugest convention and festival for hackers on the continent. Its part 5-9 track lecture conference, part massive parallel soldering and other workshops, part dance party and part carneval. I liked especially the one guy, just walking around while making music on it's novation circuit - but there was so much going on - he was hardly noticeable. Because it was gigantismic. When even a small self made booth for baking dough (one of several dozens food stands) sells over a ton (literally > 1000 kg), serving > 13000 people, it earned its name: waffle operation center (WAP). But that's the spirit and humor around here.

Pull Request Club 2019 Report

CPAN Pull Request Challenge used to match CPAN maintainers to contributors. Contributors would sign up to receive monthly assignments. The goal was to submit at least one pull request. It was fun, but it came to an end at the end of 2018.

I wanted this challenge to go on, so I created Pull Request Club. It has been a whole year since it started, so here’s the annual report with some insights.

New features

  • While Pull Request Club took its basics from CPAN-PRC, I wanted to make it more self-served. Users can take various actions such as signing up or skipping an assignment with a few clicks.
  • Users sign up to the site with their GitHub accounts. This lets them add their repositories to the assignment pool without hassle.
  • Users can see both their “assignment history” and “assignee history”.

Numbers

Perl Weekly Challenge 040: Multiple Arrays & Sort SubList

Multiple Arrays

You are given two or more arrays. Write a script to display values of each list at a given index.

For example:

Array 1: [ I L O V E Y O U ]
Array 2: [ 2 4 0 3 2 0 1 9 ]
Array 3: [ ! ? £ $ % ^ & * ]

We expect the following output:

I 2 !
L 4 ?
O 0 £
V 3 $
E 2 %
Y 0 ^
O 1 &
U 9 *

The pound sign is not part of the standard ASCII, so we’ll need to properly encode it. The use utf8; clause tells perl that the script itself contains UTF-8 encoded characters, the binmode function sets the encoding for the given filehandle, i.e. standard output.

22nd German Perl Workshop 2020 in Erlangen from 4th to 6th March 2020

The German Perl Workshop is an Open Source conference for everyone, organized by community of the Perl Programming Language and its sister language Raku yearly in Germany. The 2020 edition will be from Wednesday, March 4th, 09:00 to Friday, March 6th, 16:00 in Erlangen.

Most of the talks will be held in German, German talks will have English slides at least. English talks are welcome as well.

The website already is open for talk submissions, so if you want to present something in addition to attending, please submit a proposal!

berrybrew, the Perlbrew for Windows 1.30 released

Merry Christmas fellow Perlers!

I have been working tirelessly on the newest version of berrybrew, and thought there's no better day to release it.

It brings significant new features:

New Features

  • Added a UI, runs out of the System Tray, allows installing, removing and switching Perls using a button
  • Added new associate command, allowing berrybrew to manage .pl file associations
  • Added berrybrew-refresh command, to be run after switching perls. No more having to re-open command line windows
  • If a newer point release of a major version is introduced, we now seamlessly integrate installed previous point-releases into the Perls available
  • Configuration options are now based in the Windows Registry
  • Added new options command, allows changing configuration options at runtime
  • We now supply a bb command, which is simply a short-hand form for berrybrew
  • Greatly enhanced the self-extracting installer
  • Much more precise handling of the PATH environment variable
  • More graceful handling of exceptions
  • Added info command which displays various internal directory path information
  • Added new hidden/developer commands

UI

Merry Christmas & Happy New Year




From the team of "Perl Weekly Challenge", we wish you all
Merry Christmas & Happy New Year

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.