A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Fix debian/ubuntu gpg error when updating package sources


When updating the Debian based system, apt-get may display an error message like:

W: GPG error: ftp://ftp.debian.org/ testing Release:       
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 010908312D230C5F      

W: There is no public key available for the following key IDs:      
010908312D230C5F

The same problem in Synaptic package manager appears as:

W: Failed to fetch http://http.us.debian.org/debian/dists/sid/InRelease  
W: Failed to fetch http://http.us.debian.org/debian/dists/sid/Release.gpg

Unable to connect to http.us.debian.org:http: [IP: 128.30.2.36 80]

This is a feature of the apt-get system that guarantees the authenticity of servers for updating Debian.

Simply type the following commands, taking care to replace the number below with that of the key that was displayed in the error message:
gpg --keyserver pgpkeys.mit.edu --recv-key  010908312D230C5F      
gpg -a --export 010908312D230C5F | sudo apt-key add -

Copy+pasted from here

HTML::FormHandler example

package My::Form;

extends 'HTML::FormHandler';

has_field "age" (
    label => "Type",
    required => 0,
    type => 'Integer',
);

____________________________________________________________

package My::Handler;

my $form = My::Form->new;

if ($form->validated) {

    # validate form
    $form->process( params => $c->req->query_params );
    my @errors = $form->errors;
    alert("Error: $_") foreach @errors;

    my $age = $form->field('age')->value;
    $logger->info("User entered age $age");

    # build page
    $c->stash->{age} = $age;
}