|
View Poll Results: how do you feel about perl jam? | |||
mmmmmm it's delicious! | 8 | 57.14% | |
uhhh, i'm not gay. (sorry, ladies) | 6 | 42.86% | |
Voters: 14. You may not vote on this poll |
|
Thread Tools | Search this Thread |
02-16-2012, 11:21 PM | #16 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
You're right. Using this shebang, your original script works:
Code:
#!/opt/perl/bin/perl -I/opt/perl/lib/perl5/5.14.1 |
02-16-2012, 11:28 PM | #17 |
Connoisseur
Posts: 58
Karma: 26
Join Date: Dec 2011
Device: K3G, KF2
|
Your way works great, but I think it's easier just moving the files like I described in my last post. Unfortunately, I still can't get my browser to run .cgi scripts; it still wants to download them, even though CGI seems to be enabled. I'll play around the the bozohttpd parameters and scour the internet to see if I can find a fix. Strangely, if I create another directory it will open it just fine. Only any directory named cgi-bin seems to cause an error on the Kindle browser. This is only a problem because bozohttpd requires the CGI directory to contain a folder named "cgi-bin" - thus, it's a circular problem.
I'm glad to be making progress though. Last edited by sjheiss; 02-16-2012 at 11:34 PM. |
02-16-2012, 11:31 PM | #18 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Well, it's up to you if you move the files or tell the script from the shebang where it can find them
The latter method has the advantage that it works for everyone without needing to modify the perl package. (Just in case you intend to distribute some scripts some day). You don't need to set the PATH at all if you set the shebang correctly in the script. Last edited by ixtab; 02-16-2012 at 11:33 PM. |
02-17-2012, 12:26 AM | #19 | |
Connoisseur
Posts: 58
Karma: 26
Join Date: Dec 2011
Device: K3G, KF2
|
Quote:
I just tried accessing the cgi-bin directory on my Windows computer: blank page. Any other directory goes to the sub-directory. Any .cgi in cgi-bin = blank page. My best guess is that I'm using incorrect parameters, but there is little documentation for bozohttpd (and I'm a newb at this stuff). |
|
02-17-2012, 12:46 AM | #20 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Ah well, I just tried it, and it works correctly.
bozohttpd itself: Code:
[root@kindle tmp]# find /mnt/us/www/ /mnt/us/www/ /mnt/us/www/cgi-bin /mnt/us/www/cgi-bin/test.pl /mnt/us/www/docroot /mnt/us/www/docroot/index.html [root@kindle tmp]# ./bozohttpd -s -X -f -b /mnt/us/www/docroot/ -c /mnt/us/www/cgi-bin/ started in daemon mode as `kindle' port `http' root `/mnt/us/www/docroot/' got request ``GET /cgi-bin/test.pl HTTP/1.1'' from host localhost.localdomain to port 80 Code:
[root@kindle tmp]# wget -O out.html http://localhost/cgi-bin/test.pl Connecting to localhost (127.0.0.1:80) out.html 100% |*******************************************************************************************************************************************************************************************| 339 --:--:-- ETA [root@kindle tmp]# cat out.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>Environment</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> </body> HTH Last edited by ixtab; 02-17-2012 at 12:48 AM. |
02-17-2012, 01:10 AM | #21 | |
Connoisseur
Posts: 58
Karma: 26
Join Date: Dec 2011
Device: K3G, KF2
|
Quote:
Although, now if I try my index program, instead of trying to download the index.cgi when you click the Submit button, it just says it can't load the page. As they say, sometimes progress is just getting a different error. Also, when I try that command in WinSCP, it crashes the program, but works on my Kindle. It's about time I start using Linux a lot, I think. Last edited by sjheiss; 02-17-2012 at 01:17 AM. |
|
02-17-2012, 01:17 AM | #22 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Carefully check the directory structure and bozohttpd arguments... The cgi-bin is NOT a subdirectory of the document root, but lies outside of it. There is also no directory listing for cgi-bin.
Both of these are on purpose, because cgi-bin commands are security-relevant. (Well, probably not so much for the Kindle, but for "real" webservers they certainly are). |
02-17-2012, 01:36 AM | #23 |
Connoisseur
Posts: 58
Karma: 26
Join Date: Dec 2011
Device: K3G, KF2
|
Code:
/mnt/us/www$ find /mnt/us/www/ /mnt/us/www/ /mnt/us/www/docroot /mnt/us/www/docroot/index.html /mnt/us/www/cgi-bin /mnt/us/www/cgi-bin/test.pl /mnt/us/www/cgi-bin/index.cgi According to ps aux the args are as follows: Code:
./bozohttpd -s -X -f -b /mnt/us/www/docroot/ -c /mnt/us/www/cgi-bin/ I have no idea. Over this weekend I'll get my Linux set up and try it on there. Maybe it's something wrong with my Kindle - I have installed many hacks and things, maybe I should reset it and start afresh. I hate to pester you much, as you must be getting tired of trying to help me by now. Last edited by sjheiss; 02-17-2012 at 01:43 AM. |
02-17-2012, 01:42 AM | #24 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Well, I can't help you any further anyway now
It works for me, and I don't see a reason why the exact same setup would not be working for you if you invoke http://<kindle>/cgi-bin/test.pl. Note that the output is an empty (blank) page, so you should check the source code... |
02-17-2012, 01:47 AM | #25 | |
Connoisseur
Posts: 58
Karma: 26
Join Date: Dec 2011
Device: K3G, KF2
|
Quote:
So, I'll get busy with doing what I described, hope for the best, and report back in due time. Thanks a lot anyway, you still did help me quite a bit. |
|
02-17-2012, 01:48 AM | #26 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
(off-topic)
I'm exclusively using Linux both at work and at home (2 PCs, 2 laptops) since 5 years and I have never regretted getting rid of Windows. In fact, I'm having difficulties to find my way around on Windows by now. Almost everything just seems unlogical to me on that OS
|
02-17-2012, 01:54 AM | #27 | |
Connoisseur
Posts: 58
Karma: 26
Join Date: Dec 2011
Device: K3G, KF2
|
Quote:
I just realized you have a Touch and I have a 3G - could that difference be the problem? From what I've read the firmwares are hardly different, but I'm not qualified to be certain. |
|
02-17-2012, 02:01 AM | #28 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Nope, the device is totally unimportant here.
The only thing that comes into play is bozohttpd and perl, and we're both using the exact same binaries. So behavior is identical, and it must be a case of PEBKAC on your side |
02-17-2012, 05:53 AM | #29 |
Groupie
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
|
What about python guys?
Any chance python being compiled for Kindle? Last edited by JustAMan; 02-17-2012 at 06:00 AM. Reason: fixing typos |
02-17-2012, 08:18 AM | #30 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
I haven't tried but I found it here:
Quote:
Last edited by PoP; 02-17-2012 at 12:52 PM. Reason: correct spelling |
|
Tags |
fbdev, kindle tools |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Perl and Regex | Alexander Turcic | Lounge | 3 | 01-25-2011 07:48 PM |
Any good Perl scripters out there? | Goshzilla | Workshop | 28 | 04-09-2010 02:55 PM |
perl for the DR800/DR1000? | Mr. X | iRex | 1 | 03-16-2010 07:47 AM |
Perl processing | alexxxm | Sony Reader | 3 | 11-26-2007 06:13 AM |
Any perl or python gurus? | jbenny | Workshop | 0 | 11-23-2007 03:27 PM |