spawn process in win XP - tcl

I am trying to create a automated ftp log in script in Expect/TCL.
This is my script
spawn ftp 100.100.100.1
expect ".*:"
send "username"
expect ".*:"
send "password"
expect ".*>"
I get an error in Windows XP saying , it encountered an error and needs to close .
But same thing work on a windows 2000 .
Can anyone guide me .

Have you tried to launch your script with wish instead of tclsh? It might make a different.
Reference: http://wiki.tcl.tk/3548

Related

Headless Chrome command line - set timeout

I'm trying to print pdf from Gmail with headless chrome in command line.
I cannot install pupeteer or another tool with the computer that script will run on, due to unability to install anything.
For simple gsuite pages such as https://myaccount.google.com/, my script runs perfectly.
For more complex ones such as gmail, the output PDF I get shows a partially loaded page:
output PDF
I'm already using the --run-all-compositor-stages-before-draw option which should wait for the page to resolve before printing.
I've tried to add --virtual-time-budget=10000 just before --run-all-compositor-stages-before-draw, however if I ask for more than 2000 milliseconds the command runs for ever without producing the output pdf.
See my code so far below (which I put in a .bat file)
Does anyone have encountered that issue ? Any lead on how to solve it ? Any ways to first load the page, then have a timeout command, then print to pdf ?
I couldn't find a solution so far on the web.
Thanks :)
Ps: english isn't my primary language, please excuse any mistake
#set outputFile=C:\Users\MyUserName\Temp\testPDFprintChromeheadless\test.pdf
#set chromeDirectory=C:\Program Files (x86)\Google\Chrome\Application
#set url=https://mail.google.com/mail/
#set userData=C:\Users\MyUserName\AppData\Local\Google\Chrome\User Data
#set profile=MyChromeProfile
#set useragentChrome="Mozilla/5.0 (X11\\; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.50 Safari/537.36"
#cd "%chromeDirectory%"
chrome.exe --headless --disable-gpu --profile-directory="%profile%" --user-data-dir="%userData%" --user-agent=%useragentChrome% --run-all-compositor-stages-before-draw --print-to-pdf="%outputFile%" --print-to-pdf-no-header "%url%"
pause
Edit :
Here are the logs I get.
AccÞs refusÚ means Accès refusé which is french for Access denied.
I don't have administrator rights on this computer, thus not able to write within the Chrome directory, that could explain this access denied.
[0820/101506.995:ERROR:cache_util_win.cc(20)] Unable to move the cache: AccÞs refusÚ. (0x5)
[0820/101506.996:ERROR:cache_util.cc(144)] Unable to move cache folder C:\Users\MyUserName\AppData\Local\Google\Chrome\User Data\Default\GPUCache to C:\Users\MyUserName\AppData\Local\Google\Chrome\User Data\Default\old_GPUCache_000
[0820/101506.997:ERROR:disk_cache.cc(184)] Unable to create cache
[0820/101506.997:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
[0820/101509.033:ERROR:cache_util_win.cc(20)] Unable to move the cache: AccÞs refusÚ. (0x5)
[0820/101509.034:ERROR:cache_util.cc(144)] Unable to move cache folder C:\Users\MyUserName\AppData\Local\Google\Chrome\User Data\Default\Cache to C:\Users\MyUserName\AppData\Local\Google\Chrome\User Data\Default\old_Cache_000
[0820/101509.035:ERROR:disk_cache.cc(184)] Unable to create cache
[0820/101510.020:ERROR:service_worker_storage.cc(1899)] Failed to delete the database: Database IO error
[0820/101513.168:INFO:CONSOLE(1763)] "Deprecated API for given entry type.", source: https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.fr.YnGL5qwRpj4.O/am=rvxfykdgoP_swM-GUSAcAAM5SAABYIUsYuW09wdKmv8BAwAGoG_F8GAQrnkAdJzCuAQAAAAAAAAAAAAAAAAAAADsAisGAQ/d=1/exm=b/ed=1/im=1/dg=0/br=1/wt=1/rs=AHGWq9AzRZEBJ1Ek7NOabODYvaA7PPmCUQ/cb=loaded_1/m=a (1763)
[0820/101519.465:INFO:headless_shell.cc(648)] Written to file C:\Users\MyUserName\Temp\testPDFprintChromeheadless\test.pdf.

React Native Login with Mysql database using fetch. getting : Network request failed error

so i'm trying to follow this tutorial for Registration : https://reactnativecode.com/react-native-user-registration-example-tutorial/#comment-878
i’m using WampServer on Windows 10. I did as mentioned.
I created a folder called “/react” under “C:\wamp64\www\react” and put the two .php files there .
when i put “localhost/react” in my browser i can see the .php files .
i changed the URL to : ‘http://localhost/react/user_registration.php’
But i’m still getting that error .. i’m not sure what i’m doing wrong here
This happens simply because react-native consider localhost as an URL but it doesn't have a domain :
Solution
On Windows =>
Run [Ctrl] + R
Then type : "cmd", press enter
write "ipconfig" then press enter
a list of IP configurations will show, copy the IP address besides "IPv4 Address", it's under "Ethernet adapter VirtualBox Host-Only Network #2:", it starts with 192.168.xxx.x
on MAC =>
http://osxdaily.com/2010/11/21/find-ip-address-mac/
You will now need to replace the URL with this IP Address
you will have this at the end : ‘http://192.168.xxx.x/react/user_registration.php’
as you've seen, i have replaced localhost to the ip address taken from the CMD [i.e IPV4 Address]
You can also use only free hosting website like Awardspace, 000Webhost to test your app on a real device. Use your local server or this ip address, you can't fetch the data from real device
Hope this will help you!
Franz

TCL + Expect Windows 8 64-bit

I want to use TCL with Expect at my Windows 8 64-bit OS
I've installed 32-bit version of TCL from ActiveState, installed Expect via teacup, and use 32-bit version of plink (cause native Windows Telnet client doesnt work).
Testing scripts actully work, but they print no output to console, just run silently.
Here is example
package require Expect
log_user 1
spawn plink -telnet -P 2001 10.10.10.100
send "conf t\r"
send "hostname yyyy\r"
send "int loo100\r"
send "int loo101\r"
send "int loo102\r"
send "exit\r"
If i run it directly from shell command by command i receive just some number after spawn. Please, look at screenshot.
What is the problem ?
Tnkx

Need help in Downloading postman rest client for chrome

I am trying to download postman rest client for chrome,from the following sites
Chrome web store
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm
http://www.getpostman.com/
I am getting following error in a pop up :
An error has occurred ,Network - failed - with reload and close buttons.
My System configurations : Windows 7 , Service Pack , 64 Bit OS , 3 GB RAM .
I have tried multiple times to download it. But i am getting same error pop up each time.
can anyone please help me in sorting this out. Thank you.

MySQL driver segfaulting under mod_perl - where to look for issue

I have a webapp that segfaults when the database in restarted and it tries to use the old connections. Running it under gdb --args apache -X leads to the following output:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212868928 (LWP 16098)]
0xb7471c20 in mysql_send_query () from /usr/lib/libmysqlclient.so.15
I've checked that the drivers and database are all up to date (DBD::mysql 4.0008, MySQL 5.0.32-Debian_7etch6-log).
Annoyingly I can't reproduce this with a trivial script:
use DBI;
use Test::More tests => 2;
my $dbh = DBI->connect( "dbi:mysql:test", 'root' );
sub test_db {
my ($number) = $dbh->selectrow_array("select 1 ");
return $number;
}
is test_db, 1, "connected to db";
warn "restart db now";
getc;
is test_db, 1, "connected to db";
Which gives the following:
ok 1 - connected to db
restart db now at dbd-mysql-test.pl line 23.
DBD::mysql::db selectrow_array failed: MySQL server has gone away at dbd-mysql-test.pl line 17.
not ok 2 - connected to db
# Failed test 'connected to db'
# at dbd-mysql-test.pl line 26.
# got: undef
# expected: '1'
This behaves correctly, telling me why the request failed.
What stumps me is that it is segfaulting, which it shouldn't do. As it only appears to happen when the whole app is running (which uses DBIx::Class) it is hard to reduce it to a test case.
Where should I start to look to debug this? Has anyone else seen this?
UPDATE: further prodding showed that it being under mod_perl was a red herring. Having reduced it to a simple test script I've now posted to the DBI mailing list. Thanks for your answers.
What this probably means is that there's a difference between your mod_perl environment and the one you were testing via your script. Some things to check:
Was your mod_perl compiled with the same version of Perl
Are the #INC's the same for both
Are you using threads in your mod_perl setup? I don't believe DBD::mysql is completely thread-safe.
I've seen this problem, but I'm not sure it had the same cause as yours. Are you by chance using a certain module for sending mails (forgot the name, sorry) from your application? When we had the problem in a project, after days of debugging we found that this mail module was doing strange things with open file descriptors, then forked off another process which called the console tool sendmail, which again did strange things with file descriptors. I guess one of the file descriptors it messed around with was the connection to the database, but I'm still not sure about that. The problem disappeared when we switched to another module for sending mails. Maybe it's worth a look for you too.
If you're getting a segfault, do you have a core file greated? If not, check ulimit -c. If that returns 0, your system won't create core files and you'll have to change that. If you do have a core file, you can use gdb or similar tools to debug it. It's not particularly fun, but it's possible. The start of the command will look something like:
gbd /usr/bin/httpd core
There are plenty of tutorials for debugging core files scattered about the Web.
Update: Just found a reference for ensuring you get core dumps from mod_perl. That should help.
This is a known problem in old DBD::mysql. Upgrade it (4.008 is not up to date).
There's a simple test script attached to https://rt.cpan.org/Public/Bug/Display.html?id=37027
that will trigger this bug.