Net::SSH2::Simple failed after update to Windows10 - perl

there
On Net::SSH2::Simple,
It has been no longer connected by ssh after update Windows7 to Windows10.
With following error.
Net::SSH2::net_ss_timeout: invalid object Net::SSH2::Simple=SCALAR(0x3f5c218) at C:/Strawberry/perl/vendor/lib/Net/SSH2.pm line 111.
at C:/Strawberry/perl/vendor/lib/Net/SSH2.pm line 111.
Net::SSH2::connect(Net::SSH2::Simple=SCALAR(0x3f5c218), "xxxx.com", 22) called at C:/tool/eclipse_classic/workspace/test/work14.pl line 98
(in cleanup) Net::SSH2::net_ss_DESTROY: invalid object Net::SSH2::Simple=SCALAR(0x3f5c218) at C:/tool/eclipse_oxygen/eclipse/workspace/.metadata/.plugins/org.epic.debug/perl5db.pl line 4211.
My code are
use Net::SSH2::Simple;
$ssh2 = Net::SSH2::Simple->new();
$ssh2->connect( 'xxxx.com', 22 ) ;
$ssh2->auth_password( 'username', 'passwd' );
Error comes up at "$ssh2->connect" line.
But
This code works fine by using Net::SSH2.
Only Net::SSH2::Simple doesn't work.
To xxxx.com connection is fine. and no username,password mistakes found.
How can I fix that.
Windows10 64bit
Strawberry Perl 5.30.1.1 (64bit)
Eclipse Oxygen
EPIC 0.77
Thanks

Net::SSH2::Simple 0.01 was released Dec 13 2009. At that time Net::SSH2 was at 0.28 (2009-10-24), it is now at 0.70 (2019-3-17).
I got Net::SSH2::Simple to work on Windows10 64bit / Strawberry Perl 5.30.0.1 (64bit) by installing the earlier version 0.58 (2015-12-20) of Net::SSH2 using
cpan install SALVA/Net-SSH2-0.58.tar.gz
Version 0.59_20 (2016-05-11) gives the 'net_ss_timeout: invalid object' error . The change log for version 0.59_01 has this warning
** WARNING: this release includes lots of changes, some
visible, most internal. Regressions are expected. Also,
it introduces some minor backward incompatible changes -
but in those cases, the old behavior was broken or insane
anyway.

Related

Booting xv6 with qemu

I am trying to boot xv6 with qemu but whenever I run make qemu , I am getting the following error
usertests.c: In function ‘sbrktest’:
usertests.c:1461:13: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
1461 | *lastaddr = 99;
| ~~~~~~~~~~^~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: usertests.o] Error 1
Running make qemu-nox resulted in same error.I am using Kubuntu 21.10 operating system.here is a way around but I am looking for a solution if anyone finds out.
Maybe it would help:
Delete "_usertests" & "usertests.c" from makefile and try make clean - > make -> make qemu
I fix this problem just now, don't use the higher version ubuntu. I make qemu-nox success in 18.04 ubuntu operation system.

Perl 5.8.8 support with Catalyst

Facing below issue when execute catalyst server script.
Couldn't load class (Catalyst::Script::Server) because: "ensure_class_loaded" is not exported by the Catalyst::Utils module
Can't continue after import errors at /opt/madhan/lib/perl5/Catalyst/ScriptRole.pm line 7.
BEGIN failed--compilation aborted at /opt/madhan/lib/perl5/Catalyst/ScriptRole.pm line 7.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Module/Runtime.pm line 313.
Compilation failed in require at /opt/madhan/lib/perl5/Catalyst/ScriptRunner.pm line 13.
Catalyst::ScriptRunner::find_script_class("Catalyst::ScriptRunner", "testsite", "Server") called at /opt/madhan/lib/perl5/Catalyst/ScriptRunner.pm line 42
Catalyst::ScriptRunner::run("Catalyst::ScriptRunner", "testsite", "Server") called at /opt/madhan/testsite/script/testsite_server.pl line 8
Will the perl 5.8.8 support Catalyst MVC?
This is a bug in Catalyst. There was some type-checking code in Catalyst::ScriptRole (since 2012!) which was completely broken, but the brokenness was only visible in particular circumstances — namely, if a script provided a loader_class to Catalyst::ScriptRole that wasn't already a loaded class (likely no one ever has), or if the system has a very old version of UNIVERSAL.pm such as that shipped with perl 5.8. It's this second case that you're running into.
I've pushed a patch to Catalyst-Runtime to resolve this problem; hopefully it will be released soon it's included in Catalyst-Runtime 5.90115.

Perl CGI::Validate install / usage fails

I have installed the Perl CGI::Validate module via cpan. I had to force the install due to an error in installation - I get the same error when I try to use the module at all (unsurprisingly).
Can't use an undefined value as an ARRAY reference at /usr/local/share/perl5/CGI/Validate.pm" line 216., referer: ...
Is this a bug with the Validate module? For reference - line 216 (and the following few lines) of Validate.pm:
unless (scalar #{ $form{$field} } or $fields{$field}{optional}) {
$Blank{$field} = qq(Required field "$field" contains no data);
next;
}
Anything obvious?
the build work only in this enviroments :
Windows (32bit) Perl 5.10
Linux (32bit) Perl 5.10
on other Enviroments the build fail , eg win64bit linux64bit MacOsx with Perl Ver 5.8 , 5.12 . 5.14, 5.16 , 5.18 , 5.20 , 5.22
this may be due to the droped support to the CGI package
look at this page for more detail
http://code.activestate.com/ppm/CGI-Validate/

trouble installing MozRepl

I've been trying to install WWW::Mechanize::Firefox through CPAN and I am having trouble installing the dependency MozRepl. The installation goes through but the tests all fail, and when I force install it and run my perl script, I run into an error
Failed to connect to , at /Library/Perl/5.12/MozRepl/RemoteObject.pm line 467.
SO I uninstalled MozRepl and looked at the tests I get the following errors in the log:
# Failed test at t/10-plugin-repl-enter.t line 11.
Can't locate object method "repl_enter" via package "MozRepl" at t/10-plugin-repl-enter.t line 12.
...
# Failed test at t/20-plugin-json.t line 16.
Can't locate object method "json" via package "MozRepl" at t/20-plugin-json.t line 17.
# Failed test at t/19-plugin-repl-util-doc_for.t line 14.
Can't locate object method "repl_doc_for" via package "MozRepl" at t/19-plugin-repl-util-doc_for.t line 16.
# Failed test at t/18-plugin-repl-util-help_url_for.t line 14.
Can't locate object method "repl_help_url" via package "MozRepl" at t/18-plugin-repl-util-help_url_for.t line 16.
etc..
I am running on Mac OSX 10.8.4, 4 GB Ram 2.5 Ghz, Perl version 5.12. Does anybody have any idea what is causing these errors?
UPDATE:
i reinstalled mozrepl, and now I get this error when i run my script:
Failed to connect to , problem connecting to "localhost", port 4242: Connection refused at /Users/thui/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/MozRepl/Client.pm line 144
This works for me with perl 5.10 or later, latest Firefox (26 as of writing) and Mozrepl from github.
At command propmpt:
(1) Download MozRepl and build the XPI file (Firefox extension):
git clone git://github.com/bard/mozrepl
cd mozrepl
zip -r ../mozrepl.zip *
cd ..
mv mozrepl.zip mozrepl.xpi
(2) Install the extension in Firefox via about:addons [Install from file].
In Firefox:
(3) Menu->Tools->Mozrepl->Activate On Startup
(4) Menu->Tools->Mozrepl->Start
At command propmpt:
(5) which firefox
Make sure the firefox executable (or your OS's wrapper script) is in $PATH - you should get some output!
(6) cpanm WWW::Mechanize::Firefox
(7) Test it!
At this point, if CPANminus reports no errors then WWW::Mechanize::Firefox should be working. The first example from the synopsis is a good test:
#!/usr/bin/perl
use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();
$mech->get('http://google.com');
That assumes MozRepl is listening on port 4242 (check in Menu->Tools->Mozrepl->Change Port). You can also change the port from the perl side; see options for ->new().
(8) cpanm HTML::Display::Common
I found that bcat.pl from the examples required this module, but it wasn't installed as a dependency.

Cannot run magic functions in ipython terminal

I am using Enthought's Canopy environment on a 64 bit Linux OS. Everything works fine in the Ipython console which is attached with the editor. But when I ipython in the terminal and try to use magic functions, I get the following error.
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-3-29a4050aa687> in <module>()
----> 1 get_ipython().show_usage()
/home/shahensha/Development/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in show_usage(self)
2931 def show_usage(self):
2932 """Show a usage message"""
-> 2933 page.page(IPython.core.usage.interactive_usage)
2934
2935 def extract_input_lines(self, range_str, raw=False):
/home/shahensha/Development/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/lib/python2.7/site-packages/IPython/core/page.pyc in page(strng, start, screen_lines, pager_cmd)
188 if screen_lines <= 0:
189 try:
--> 190 screen_lines += _detect_screen_size(screen_lines_def)
191 except (TypeError, UnsupportedOperation):
192 print(str_toprint, file=io.stdout)
/home/shahensha/Development/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/lib/python2.7/site-packages/IPython/core/page.pyc in _detect_screen_size(screen_lines_def)
112 # Proceed with curses initialization
113 try:
--> 114 scr = curses.initscr()
115 except AttributeError:
116 # Curses on Solaris may not be complete, so we can't use it there
/home/shahensha/Development/Canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/lib/python2.7/curses/__init__.pyc in initscr()
31 # instead of calling exit() in error cases.
32 setupterm(term=_os.environ.get("TERM", "unknown"),
---> 33 fd=_sys.__stdout__.fileno())
34 stdscr = _curses.initscr()
35 for key, value in _curses.__dict__.items():
error: setupterm: could not find terminfo database
So, I installed a bare bones iPython shell which is not the one provided by Canopy and tried the same magic functions in there and it works fine.
Have I done something wrong with the installation? Please help
Thanks a lot
shahensha
This is not a solution, but just an observation. My desktop is MacOS-X and I connect to a Centos machine to run Enthought Canopy both 64 bit. I get the same error message as OP if I ssh from iterm2, but not if I use the Terminal app.
I am not sure what the underlying reason is, but may be someone can verify if a similar situation is true for linux. Interestingly I can use either iterm2 or Terminal on the local canopy without any issues.
Update:
I just noticed that the TERM environment variable in iterm2 was set to "xterm" while the Terminal app was showing "xterm-256color". Issuing the command export TERM="xterm-256color" before running the Canopy ipython in terminal solves the issue for me in iterm2.
Problem reproduction:
$ python -c 'import curses; curses.setupterm()'
Traceback (most recent call last):
File "<string>", line 1, in <module>
_curses.error: setupterm: could not find terminfo database
This irc log gave me the idea that this error was to do with libncursesw.
My Canopy version is 1.0.3.1262.rh5-x86_64. I have installed it to ~/src/canopy.
In ~/src/canopy/appdata/canopy-1.0.3.1262.rh5-x86_64/lib we can see that my canopy install has libncursesw.so.5.7.
My machine (Debian Wheezy 64bit) has libncursesw.so.5.9 (in /lib/x86_64-linux-gnu/libncursesw.so.5.9). I made canopy use this. You can toggle the problem on / off by using LD_PRELOAD and pointing at the .so file.
Solution
Replace libncurses.so.5.7 with libncurses.so.5.9:
CANOPYDIR=$HOME/src/canopy
CANOPYLIBS=$CANOPYDIR/appdata/canopy-1.0.3.1262.rh5-x86_64/lib/
SYSTEMLIBS=/lib/x86_64-linux-gnu
cp $SYSTEMLIBS/libncurses.so.5.9 $CANOPYLIBS
ln -sf $CANOPYLIBS/libncurses.so.5.9 $CANOPYLIBS/libncurses.so.5
It appears that Canopy User Python is not your default. See this article:
https://support.enthought.com/entries/23646538-Make-Canopy-s-Python-be-your-default-Python-i-e-on-the-PATH-
Update: Not true here -- instead, see batu's workaround answer.