Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-05-2010, 01:01 AM   #1
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
Kindle Terminal app (sort of)

One way to run a shell on a kindle is to use the browser as the user interface, and a server side process that forks the shells and talks to the browser.

There are several such options around. Ajaxterm is one that seemed reasonably simple and well designed, though the original version had the server implemented in Python (so a bit too heavyweight for the Kindle).

At http://info.iet.unipi.it/~luigi/kindle/ you can find a rewrite of AjaxTerm which is suitable for operation on the Kindle (but not only there). The server side has been completely rewritten in C (single source file, approx 900 lines), and the client side is only about 400 lines of javascript and no external framework or libraries.

Consider the current version as a proof of concept, but it is already in reasonable shape and shouldn't take much work to add the missing features.

cheers
luigi
lrizzo is offline   Reply With Quote
Old 11-05-2010, 10:35 AM   #2
Polvo
Enthusiast
Polvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshesPolvo can read faster than his screen refreshes
 
Posts: 45
Karma: 14412
Join Date: Oct 2010
Location: Spain
Device: Kindle 3 - 3G
Good work Luigi. Have you seen Neftaly's hack? It it the beginning of a bookmarklet manager for the k3 browser. It runs a BusyBox server to do some of its magic though http://www.mobileread.com/forums/sho...d.php?t=101705
Polvo is offline   Reply With Quote
Old 11-06-2010, 05:23 PM   #3
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
Hi. Is there way how to login with private key? I have dropbear in "K3_WIFI" mode and password for root is unknown. Or how to get root password without changing it?
centaurian is offline   Reply With Quote
Old 11-06-2010, 06:26 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,878
Karma: 4492229
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@centaurian: Yes, check the latest usbnet README & badbob001's post.
NiLuJe is offline   Reply With Quote
Old 11-06-2010, 07:58 PM   #5
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
Yes, with Putty and WinSCP it works great over Wifi with private key. Problem is how to use this tool and have usbnet with Wifi option enabled. Any idea how to do that without changing root password? I actually have last usbnet (28).

Possible solutions:
1/ change root password and login with that (that is not really what I want)
2/ find right root password (impossible?)
3/ reprogram AjaxTerm to login with private key
4/ reprogram dropbear to allow login from localhost without checking password
5/ set K3_WIFI="false" (that is not really what I want)
6/ some other way :-)

Last edited by centaurian; 11-06-2010 at 08:03 PM.
centaurian is offline   Reply With Quote
Old 11-06-2010, 09:31 PM   #6
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,878
Karma: 4492229
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@centaurian: Oh, you mean a passwordless login *on the Kindle* via the aforementioned AjaxTerm?

In that case, if it currently does require the root password, err, yeah, sorry, since I don't use it, I can't say much more than what you already thought about .

I'd go with switching the root password, because tweaking usbnet to make dropbear allow passwordless logins over WiFi is a *very bad* idea .

Bear in mind, I haven't tried this: but why would you ssh to localhost in the first place? Doesn't AjaxTerm already drops you in a local root shell?
NiLuJe is offline   Reply With Quote
Old 11-07-2010, 03:47 AM   #7
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
Quote:
Originally Posted by NiLuJe View Post
@centaurian: Oh, you mean a passwordless login *on the Kindle* via the aforementioned AjaxTerm?
Yes. It's exactly what I want to.

Quote:
Originally Posted by NiLuJe View Post
In that case, if it currently does require the root password, err, yeah, sorry, since I don't use it, I can't say much more than what you already thought about .

I'd go with switching the root password, because tweaking usbnet to make dropbear allow passwordless logins over WiFi is a *very bad* idea .
I agree. Open acces via WIFI is not good on public wifi:-). I asked to It's posible to allow passwordless logins only via localhost.

Something like:
if (ipaddr='127.0.0.1')
do_not_check;
else
check;

I have another idea:
6/Use launchpad for switch dropbear config and run ajaxterm. On second run of script kill ajaxterm and switch config back to allow WIFI mode. (Restarting dropbear to apply changed config is needed :-))

Quote:
Originally Posted by NiLuJe View Post
Bear in mind, I haven't tried this: but why would you ssh to localhost in the first place? Doesn't AjaxTerm already drops you in a local root shell?
AjaxTerm seems to use ssh to localhost - it need login to access it.

Last edited by centaurian; 11-07-2010 at 03:54 AM.
centaurian is offline   Reply With Quote
Old 11-07-2010, 07:35 AM   #8
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,878
Karma: 4492229
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@centaurian: Huh.

Will patch dropbear to bypass auth when connecting from localhost in the next USBNetwork release.
NiLuJe is offline   Reply With Quote
Old 11-07-2010, 07:39 AM   #9
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
That will by fine. Thank you. ;-)
centaurian is offline   Reply With Quote
Old 11-07-2010, 08:01 AM   #10
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,878
Karma: 4492229
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@centaurian: Done. Given the fact that I probably won't be able to release it properly for a few days, here's the updated dropbear binary. (Just overwrite the one in usbnet/bin with this one, and restart sshd [by switching usbnet off/on]).

It'll also be useful to check that my patch indeed works as intended, and that I didn't break anything . (ie. still auth properly over wifi when not connecting from localhost ^^)

Last edited by NiLuJe; 11-07-2010 at 11:24 AM.
NiLuJe is offline   Reply With Quote
Old 11-07-2010, 09:16 AM   #11
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
I tested it. From WIFI it still needs key file, from localhost not (by "ssh localhost" - that good). But AjaxTerm still refuses me to connect with "Login Incorrect". So I am looking at AjaxTerm sources, how it really works...

Edit:
I was wrong. It don't use ssh.

Last edited by centaurian; 11-07-2010 at 09:49 AM.
centaurian is offline   Reply With Quote
Old 11-07-2010, 09:47 AM   #12
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
Ajaxterm does not use ssh, just calls login.
I have put up an updated version which lets you just drop into a shell by running the server side as
myts --cmd sh

(or whatever other command you want to run)

http://info.iet.unipi.it/~luigi/kind...m-20101107.tgz

I have not had time to test the kindle binary, it works on the host though
so hopefully it should work there too.

cheers
luigi
lrizzo is offline   Reply With Quote
Old 11-07-2010, 10:23 AM   #13
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
Now it works :-).


I made run script for launchpad. On first run it runs AjaxTerm from /mnt/us/local/terminal/ directory. On second run it kills it.

Run it with:
Code:
/mnt/us/local/terminal/terminal.sh > /dev/null
Attached Files
File Type: zip terminal.zip (307 Bytes, 348 views)
centaurian is offline   Reply With Quote
Old 11-07-2010, 11:11 AM   #14
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
i believe it would be good to keep a web server always on (hopefully it doesn't consume too much power) from which we could enable/disable/modify the various features (usbnetwork, launchpad configurations etc.).
lrizzo is offline   Reply With Quote
Old 11-07-2010, 11:23 AM   #15
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,878
Karma: 4492229
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@lrizzo/centaurian: Okay, good to know .

FYI, the login applet of the busybox binary shipped with usbnetwork will skip password auth and drop you in a full root login shell.
NiLuJe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle, Calibre, Author sort gdaydigger Calibre 5 03-11-2014 08:21 PM
Kindle app for iPad appears in the App Store pilotbob News 46 04-06-2010 08:25 PM
kindle app? is it possible to design a app to full support PDF? lili1989 Amazon Kindle 12 02-05-2010 05:29 PM
Author Sort & Kindle seagull Calibre 0 12-25-2009 12:42 PM
How does kindle sort pictures? princeofegypt Amazon Kindle 1 04-24-2009 04:54 PM


All times are GMT -4. The time now is 01:45 AM.


MobileRead.com is a privately owned, operated and funded community.