Showing entries with tag "length".

Found 2 entries

SSH: Bad server host key: Invalid key length

Newer versions of OpenSSH have deprecated small key sizes for security reasons. We still have some older equipment that uses these types of keys that we need to access. You can work around this with:

ssh -o RSAMinSize=1024 user@domain.com
Leave A Reply

Perl: Find the longest string in an array

I need a Perl way to find the maximum string length in an array so here is a function to do that:

my @words = qw(Apple Pear Watermelon Banana Cherry);
my $max   = max_length(@words); # 10
sub max_length {
    my $max = 0;

    foreach my $item (@_) {
        my $len = length($item);
        if ($len > $max) {
            $max = $len;
        }
    }

    return $max;
}
Leave A Reply