Reply
Thread Tools
Posts: 17 | Thanked: 25 times | Joined on Jan 2009
#11
Thanks for this great tool!

A few examples here or in the wiki would be nice. At the moment I fail to upload anything by ftp. Help is appreciated. I will try further.

DerYo-->
 
Posts: 19 | Thanked: 3 times | Joined on Jun 2010 @ New Jersey, USA
#12
I think a wiki page would be a good idea.

DerYo - I think it would be difficult to get ftp to work with this unless your ftp server does not require authentication. From what I remember, ftp expects interactive authentication, which this would not support. You may be able to point this plugin to a shell script that contains a "here" document. Google "ftp here script" for help with that.

An easier way is to use scp. Kulve's blog post from 3/2/10 describes the syntax. You would need ssh access to your server, though. You would also need to set up ssh key pairs on your server.

I tried this out today and all worked well.
 
Posts: 543 | Thanked: 180 times | Joined on Aug 2009 @ Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
#13
Originally Posted by nathanbibb View Post
I think a wiki page would be a good idea.

DerYo - I think it would be difficult to get ftp to work with this unless your ftp server does not require authentication. From what I remember, ftp expects interactive authentication, which this would not support. You may be able to point this plugin to a shell script that contains a "here" document. Google "ftp here script" for help with that.

An easier way is to use scp. Kulve's blog post from 3/2/10 describes the syntax. You would need ssh access to your server, though. You would also need to set up ssh key pairs on your server.

I tried this out today and all worked well.
FTP can be used this way. Using something like lftp or some other such tool works fine.
__________________
For any repos or anything else I might have working on my N900 see:
http://wiki.maemo.org/User:Ruskie
A quick list of what I have in the repos
zsh|xmms2|fcron|gtar|gcoreutils
 
thp's Avatar
Posts: 1,362 | Thanked: 4,006 times | Joined on Sep 2007 @ Vienna, Austria
#14
Originally Posted by nathanbibb View Post
DerYo - I think it would be difficult to get ftp to work with this unless your ftp server does not require authentication. From what I remember, ftp expects interactive authentication, which this would not support.
You can add your username and password to the ~/.netrc file. Google 'netrc ftp' to find out how. This allows for passwordless FTP uploads.

Different variants are possible (the link is in German, but it should give you pointers to tool names and commands for further research):

http://sysadminscorner.uherbst.de/da...nsfer/ftp.html
 
Posts: 17 | Thanked: 25 times | Joined on Jan 2009
#15
Finally I did it!

I used lftp from this post.

After that with the help of a tutorial on lftp I finally managed to get this working command line:

Code:
lftp -c open -e "put %s -o %s" ftp://username:password@my.server.name/sub/dir/
Thanks for the tip with lftp. I still don't really understand that command line (why the heck this -e "..."-thing right in the middle?) but it works fine.

The benefits of working with lftp is that it's robust. If there is no permanent error, it tries uploading the file until it's really done. It will resume or restart when the connection is lost etc.

DerYo-->

Last edited by deryo; 06-17-2011 at 02:43 PM.
 

The Following User Says Thank You to deryo For This Useful Post:
Posts: 72 | Thanked: 53 times | Joined on Jan 2012 @ Berlin, Germany
#16
Hi, thanks for the great plugin! I wanted to create my own plugin for sharing pics in my custom blog software and with this I just need to write a simple script!

It would be really nice to be able to report the progress via stdout, for example, this script should show an advance of 10% each second:

Code:
#!/bin/sh
for i in `seq 0.0 0.1 1.0`
do
    sleep 1
    echo $i
done
If I have some time I will implement it myself, but I'm not familiar with sharing plug-ins and glib (which I saw you use to spawn the process).

I've been investigating a little and I think I'll have to use g_spawn_async_with_pipes() + g_shell_parse_argv() and a glib event loop (or there is one already?) instead of the simpler g_spawn_command_line_sync() in use now.

My idea is to just read the stdout pipe line by line and try to convert each line to a float and if the conversion succeeded, just call sharing_transfer_set_progress() with the new value.

What do you think?
 
Posts: 59 | Thanked: 66 times | Joined on May 2007
#17
The g_spawn_async_with_pipes() + g_shell_parse_argv() sounds about right.

I'm not sure what you mean with the glib event loop? It's used there normally and you probably don't need to explicitly do anything with it.

You probably need to use g_child_watch_add() to track when the child is done (exited) and continue the parent's work then.

Also the part about reading the child's stdout and updating the progress sounds right.

It's been awhile since I touched this (or glib even) so I might be forgetting something here
 

The Following User Says Thank You to kulve For This Useful Post:
Posts: 72 | Thanked: 53 times | Joined on Jan 2012 @ Berlin, Germany
#18
Originally Posted by kulve View Post
The g_spawn_async_with_pipes() + g_shell_parse_argv() sounds about right.

I'm not sure what you mean with the glib event loop? It's used there normally and you probably don't need to explicitly do anything with it.
OK, that was the question, I didn't know if the plug-in already had a loop or not, I didn't took a very deep look at it .

Originally Posted by kulve View Post
You probably need to use g_child_watch_add() to track when the child is done (exited) and continue the parent's work then.
Yes, yes.

Originally Posted by kulve View Post
Also the part about reading the child's stdout and updating the progress sounds right.

It's been awhile since I touched this (or glib even) so I might be forgetting something here
Cool! I just finished my sharing script and is working great! (reporting the progress via stdout and all So my next task when I have some free time would be trying to read that from the plug-in as I described here.

I never did any devel for maemo and the arm, is there any tutorial you would recommend to get started on having a working tool chain to build and test this?

Thanks!
 

The Following User Says Thank You to llucax For This Useful Post:
Posts: 59 | Thanked: 66 times | Joined on May 2007
#19
Originally Posted by llucax View Post
I never did any devel for maemo and the arm, is there any tutorial you would recommend to get started on having a working tool chain to build and test this?
Not really. I've always installed SB from tarballs as I don't want "apt-get upgrade" to mess my scratchbox. The installation script can download everything and install to any prefix with some path option. That's what I've used. This documentation seems to be close to it at least:

http://wiki.maemo.org/Documentation/...ased_Installer
 
Posts: 59 | Thanked: 66 times | Joined on May 2007
#20
A bit off-topic as this concers N9(50), not N900 but I finally managed to get the first version of the sharing plugin working for Harmattan:

http://projects.developer.nokia.com/cmdshare
 

The Following 2 Users Say Thank You to kulve For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT -4. The time now is 06:30 PM.