Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
On Raspberry Pis, I personally like to use the system Perl and the system package manager to install Perl modules. This may not always give you the latest versions, but things install much faster because nothing needs to be compiled and tested. (Update: In other words, try sudo apt-get install libnet-ssleay-perl.)

Thanks for your response, haukex. I'm not quite sure what you mean with reference to the "system package manager." I find no GUI equivalent of Ubuntu's "synaptic package manager." I prefer to get things done on the command line with *nix. (My windows preference is the opposite, but I prefer not to use Windows.) I wonder if you mean something like dpkg. As it is, I used

sudo apt-get install libnet-ssleay-perl

, and then I was unstuck. Would this be an instance of using the "system package manager," as you mean it?

Update: After fighting with the same install on my droplet, I realize there were other headers that needed to be installed by the system:

sudo apt install zlib1g zlib1g-dev

The droplet had the former but not the latter, and it seems to make a difference.

It's also usually not recommended to use sudo cpan to install modules to the system Perl - use the system's package manager to install packages to the system Perl, or build your own copy of Perl (e.g. perlbrew) to install modules using a CPAN client there. Or, if using the system Perl, use something like local::lib to install modules to your home directory, so the system Perl's libraries are not affected. On Raspberry Pis, one of the first things I do is sudo apt-get install build-essential cpanminus liblocal-lib-perl perl-doc and perl -Mlocal::lib >>~/.profile - see my notes on setting up RPis. (Update: I use local::lib on RPis for those few modules that aren't available in the package repositories or where the version in the system repositories is too old.)

I think that's really solid advise for an rpi. I proceeded as you outline, forsaking sudo cpan, and with the addition of this command:

cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

cpanm has generally worked very well for my needs. I do have a sticky wicket, where I can't get cpanm to find dependencies:

$ ls requires1.pm $ cpanm --verbose --installdeps . cpanm (App::cpanminus) 1.7044 on perl 5.028001 built for arm-linux-gnu +eabihf-thread-multi-64int ... --> Working on . Entering /home/pi/Documents/curate/req Configuring /home/pi/Documents/curate/req ... N/A ! Configuring . failed. See /home/pi/.cpanm/work/1647208802.16932/buil +d.log for details. Expiring 16 work directories. $ cat requires1.pm package requires1.pm; requires 'AnyEvent::AIO' => '1.1'; requires 'Async::Interrupt' => '1.24'; requires 'Cookie::Baker::XS' => '0.09'; requires 'Device::Firmata' => '0.65'; requires 'Device::SerialPort' => '1.04'; requires 'Device::WebIO' => '0.022'; requires 'Device::WebIO::Dancer' => '0.004'; requires 'Device::WebIO::Firmata' => '0.002'; requires 'Device::WebIO::RaspberryPi' => '0.900'; requires 'DBD::SQLite' => '1.58'; requires 'DBI' => '1.641'; requires 'Guard' => '1.023'; requires 'GPS::NMEA' => '0.17'; requires 'Math::Round' => '0.07'; requires 'RPi::WiringPi' => '2.3628'; requires 'RPi::Pin' => '2.3606'; requires 'Plack::Handler::Twiggy' => '0.1025'; requires 'Starman' => '0.4014'; requires 'Time::HiRes' => '1.9758'; requires 'WWW::Form::UrlEncoded::XS' => '0.25'; 1; $

I couldn't get cpanm to find modules in typical perl .pl scripts, so I herded the requires into a barebones module in its own directory. I don't know how to serve it up any better than that.(?)

On Raspberry Pis, one of the first things I do is sudo apt-get install build-essential cpanminus liblocal-lib-perl perl-doc and perl -Mlocal::lib >>~/.profile - see my notes on setting up RPis. (Update: I use local::lib on RPis for those few modules that aren't available in the package repositories or where the version in the system repositories is too old.)

Your link for setting up rpi's has proved very useful indeed, giving me much more on my plate to come up to speed on. I'm happy to report that I think I have my first fail2ban implementation:

$ sudo fail2ban-client status sshd Status for the jail: sshd |- Filter | |- Currently failed: 0 | |- Total failed: 0 | `- File list: /var/log/auth.log `- Actions |- Currently banned: 0 |- Total banned: 0 `- Banned IP list: $

Regarding section 5,

Crontab to broadcast RPi's address and name

What is the purpose of doing this? Would this cause you to be indexed by search engines, or is it all within 50 yards (meters for bliako)?

crontab -e @reboot hostname | socat -s - UDP-DATAGRAM:255.255.255.255:12340,broad +cast 2>/dev/null * * * hostname | socat -s - UDP-DATAGRAM:255.255.255 +.255:12340,broadcast 2>/dev/null

Can you break this up into parts? I've used crontab once, so that syntax with all the asterisks is familiar. I read that

socat -s

runs it in sloppy mode, and I understand the syntax for sending stderr to the bitbucket.

2>/dev/null

I haven't cottoned onto it yet, even fiddling with  udplisten.pl

I have run:

$ sudo ufw allow in 12340/udp Rule added Rule added (v6) $

, and was astonished to get somewhere in the debugger with it:

$ pwd /home/pi/Documents/curate/req $ ls 1.udplisten.pl requires1.pm $ perl -d 1.udplisten.pl -e '/HELLO xyZ129/' Loading DB routines from perl5db.pl version 1.53 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(1.udplisten.pl:77): $Getopt::Std::STANDARD_HELP_VERSION = 1; DB<1> b 86 + DB<2> c + main::(1.udplisten.pl:86): my $RXSZ = $opts{b}//1024; DB<2> p $EXPR + /HELLO xyZ129/ DB<3> c + 192.168.red.acted Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. DB<3> + DB<3> save 1.udp.txt + commands saved in 1.udp.txt DB<4> q + $

, with another terminal, doing:

echo "HELLO xyZ129" | socat - UDP-DATAGRAM:255.255.255.255:12340,broad +cast
If you still want to try installing Net::SSLeay yourself, you can also use the apt command to get most programs' build dependencies; in this case, try sudo apt-get build-dep libnet-ssleay-perl.
sudo apt-get build-dep libnet-ssleay-perl

I used this with my droplet in the cloud.

In general, I would recommend cpanm over the default CPAN client. Its --verbose option will show you the whole build process, giving you the exact error messages when stuff fails.

I sure like cpanm too when I finally get the thing kickstarted.

cpanm Term::ReadKey

I always need to do this, too.

Again, thanks for your comments. Gruss aus Amiland,


In reply to Re^2: CPAN 2.29 stuck with Net::SSLeay by Aldebaran
in thread CPAN 2.29 stuck with Net::SSLeahy by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-26 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found