Author |
Message |
smokey01

Joined: 30 Dec 2006 Posts: 2681 Location: South Australia
|
Posted: Sun 10 Nov 2013, 09:09 Post subject:
Vortex Subject description: Drag & Drop upload script |
|
Due to some interest in our little Vortex application CatDude and I have made it available.
Basically you can configure it to upload files to a server simply by dragging and dropping the file onto the script which sits on the desktop.
In xfce you place the script in a folder and drop the files on the script. It doesn't work if the script is on the desktop.
This file is required. Compile instructions in the script.
ftp://ftp.ncftp.com/ncftp/ncftp-3.2.5-src.tar.bz2
Description |
Drag & Drop File Uploader
|

Download |
Filename |
vortex-1.0.tar.gz |
Filesize |
764 Bytes |
Downloaded |
329 Time(s) |
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
smokey01

Joined: 30 Dec 2006 Posts: 2681 Location: South Australia
|
Posted: Thu 14 Nov 2013, 07:08 Post subject:
|
|
I notice there have been 17 downloads of the Vortex.
How about a bit of feedback.
Did it work?
Did it meet your requirements?
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8670 Location: qld
|
Posted: Thu 14 Nov 2013, 07:32 Post subject:
|
|
I'm download #18
Feedback : like the name [ ]
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
Sylvander
Joined: 15 Dec 2008 Posts: 4327 Location: West Lothian, Scotland, UK
|
Posted: Thu 14 Nov 2013, 09:40 Post subject:
|
|
Regarding the use of the idea of a "Vortex":
Robert Burns wrote about it in the late 1700's.
Find HERE....
QUOTE
"...thorough-paced selfishness is always the work of time. Indeed, in a
little time, we generally grow so attentive to ourselves and so
regardless of others that I have often in poetic frenzy looked on this
world as one vast ocean, occupied and commoved by innumerable vortices,
each whirling round its centre. These vortices are the children of men.
The great design and, if I may say so, merit of each particular vortex
consists in how widely it can extend the influence of its circle, and
how much floating trash it can suck in and absorb."
I guess the "trash" means "things...
i.e. Money, possessions, power, influence, etc.
|
Back to top
|
|
 |
smokey01

Joined: 30 Dec 2006 Posts: 2681 Location: South Australia
|
Posted: Thu 14 Nov 2013, 17:57 Post subject:
|
|
Sylvander you need to take a bit more water with it
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
Sylvander
Joined: 15 Dec 2008 Posts: 4327 Location: West Lothian, Scotland, UK
|
Posted: Thu 14 Nov 2013, 18:10 Post subject:
|
|
smokey01 wrote: | Sylvander you need to take a bit more water with it  |
not sure I understand what you mean.
Must I be innebriated to quote such ideas?
Doesn't the idea still apply today?
Does not the top few percent claim ownership of nearly ALL of the worlds' resources today?
Haven't the few been accumulation "things" throughout history?
Does the name "vortex" have unfortunate connotations?
|
Back to top
|
|
 |
smokey01

Joined: 30 Dec 2006 Posts: 2681 Location: South Australia
|
Posted: Thu 14 Nov 2013, 18:37 Post subject:
|
|
Take some water with your scotch.
We called it the Vortex, you know, like a whirlpool. Drop a file on it and it get sucks up into the cloud/your storage.
CatDude has made a portable version of it so it will work from anywhere you place it, like /mnt/home, so you don't have to install it in every distro.
Just drag and drop the script onto the desktop then drag and drop files onto the script, job done.
Cheers
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8670 Location: qld
|
Posted: Thu 14 Nov 2013, 18:38 Post subject:
|
|
Smokey and CatDude,
I'm pretty sure you could achieve the same result using just curl.
I once wrote a script that took a screen snapshot of a certain website with a cron job, had it cropped (used netpbm tools iirc), then uploaded the resulting image to my website, all done with curl. It was totally automated. I'll dig around for the script, pretty sure it's on my usb hdd.
EDIT: found it
Code: | #!/bin/bash
#takes a screeny of webage, crops and uploads
#designed to be set as a cron job
#TODO, encrypt/decrypt config file otf
# depends +curl, +xwd, +netpbm
#[+pnmcut (in ubuntu and debian maybe change to "pamcut")]
#you can make @ config file in /etc/catchrc for vars
#eg
#GETSNAPURL="" #the url where you want to get screeny
#CROPLEFT=277 #x position of top left image
#CROPTOP=356 #y position of top left image
#x2=1004 #x size of image
#y2=809 #y size of image
#SAVEPATH="" #where to store image
#IMAGE="" #pre image name
#NEWIMAGE="" #final image name
#curl args
#USER="" #user
#PASS="" #password
#UPURL="" # url [of server]
#PORT="" # port
[ ! $DISPLAY ] && echo "error: no X" && exit
#read config
[ ! -f /etc/catchrc ] && echo "error: no config" && exit || . /etc/catchrc
$DEFAULTBROWSER $GETSNAPURL &
sleep 20
xwd -root | xwdtopnm | pnmtopng > capture.png
IMAGE=capture.png
NEWIMAGE=ladder.png
Xwin=$(( $x2 - $CROPLEFT)) Ywin=$(( $y2 - $CROPTOP))
pngtopnm $IMAGE \
| pamcut -left=${CROPLEFT} \
-top=${CROPTOP} \
-height=$Ywin \
-width=$Xwin | \
pnmtopng > $HOME/my-documents/$NEWIMAGE
curl -m 300 -o /var/webtrsfr.log -T $SAVEPATH/$NEWIMAGE \
ftp://${USER}:${PASS}@${UPURL}:$PORT/
killall $DEFAULTBROWSER
|
The image part is irrelevant but the curl part should work exactly (well close enough) to your ncftp routine. A config could be a good idea too and possibly encrypting the password with something simple like base64 so it isn't in plain text.
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 917
|
Posted: Thu 14 Nov 2013, 19:31 Post subject:
|
|
Smokey and CatDude,
I see 01micko found his code just as I was posting this but here's the general form I've used.
Code: | curl -u user:pass -T myfile.txt ftp://ftp.testserver.com/dir
|
Cheers,
s
|
Back to top
|
|
 |
smokey01

Joined: 30 Dec 2006 Posts: 2681 Location: South Australia
|
Posted: Fri 15 Nov 2013, 15:52 Post subject:
|
|
It's also possible to hide the password by compiling the script.
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
smokey01

Joined: 30 Dec 2006 Posts: 2681 Location: South Australia
|
Posted: Sun 17 Nov 2013, 01:43 Post subject:
|
|
Catdude has rewritten the vortex script to use cURL instead of ncFTPput.
This removes the requirement to use additional binaries, as most, if not all Puppy's come with cURL included. This of course makes the package considerably smaller.
Neither CatDude or I realised cURL could upload files. Thanks to 01micko and seaside for enlightening us.
Enjoy.
Description |
cURL version of Vortex
|

Download |
Filename |
vortex-1.1.tar.gz |
Filesize |
802 Bytes |
Downloaded |
302 Time(s) |
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 917
|
Posted: Mon 18 Nov 2013, 15:42 Post subject:
|
|
Nicely done with homegrown vegetables .
If anyone is interested in encrypting their log on information, here's some code to insert at the beginning of Vortex.
The first time it's run, it prompts for a username and password which is then encrypted and saved to the file $HOME/upload/.eid.
The next run prompts for a password and then uploads the file.
Code: | # First run creates encrypted username password in hidden file
# $HOME/upload/.eid
# Next run asks for password and if ok calls upload_script
# passing parameters $USER $PASS
pass_dialog() {
PASSWD=`Xdialog --stdout --password --inputbox "Enter Password:" 10 30 Password Password `
[ $? != 0 ] && exit
userpass=(`echo "$PASSWD"|openssl des3 -in "$EID" -d -pass stdin`)
EXIT_CODE=$?
if [ $EXIT_CODE != 0 ];then
Xdialog --msgbox "Password Error - Try Again" 0 0
pass_dialog
fi
}
export -f pass_dialog
export EID=$HOME/upload/.eid
if [ ! -f "$EID" ] ; then # create user and password
mkdir -p $HOME/upload
userpass=` Xdialog --stdout --separator " " --password --2inputsbox "Enter Username and Password:" 20 40 Username Username Password Password `
[ $? != 0 ] && exit
Auserpass=($userpass)
PASS=${Auserpass[1]}
openssl des3 -out "$EID" -pass pass:"$PASS"<<<"$userpass"
exec "$0"
else # open password dialog
pass_dialog
USER=${userpass[0]}
PASS=${userpass[1]}
fi
##USER="username"
##PASS="password" |
Be sure to comment or remove the two lines
Quote: | USER="username"
PASS="password" | in Vortex
Cheers,
s
|
Back to top
|
|
 |
smokey01

Joined: 30 Dec 2006 Posts: 2681 Location: South Australia
|
Posted: Mon 18 Nov 2013, 17:25 Post subject:
|
|
Very nice seaside.
Some time ago I discovered a nice little script compiler, see here:
http://linux.softpedia.com/get/System/Shells/shc-18503.shtml
This allows you to compile the script so the passwords are hidden.
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
|