Vortex

Configuration wizards, scanners, remote desktop, etc.
Post Reply
Message
Author
User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

Vortex

#1 Post by smokey01 »

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
Attachments
vortex-1.0.tar.gz
Drag & Drop File Uploader
(764 Bytes) Downloaded 440 times

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#2 Post by smokey01 »

I notice there have been 17 downloads of the Vortex.

How about a bit of feedback.

Did it work?
Did it meet your requirements?

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#3 Post by 01micko »

I'm download #18

Feedback : like the name [ :P ]
Puppy Linux Blog - contact me for access

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#4 Post by Sylvander »

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.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#5 Post by smokey01 »

Sylvander you need to take a bit more water with it :wink:

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#6 Post by Sylvander »

smokey01 wrote:Sylvander you need to take a bit more water with it :wink:
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?

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#7 Post by smokey01 »

Take some water with your scotch. :lol:

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

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#8 Post by 01micko »

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: Select all

#!/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

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#9 Post by seaside »

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: Select all

 curl -u user:pass -T myfile.txt ftp://ftp.testserver.com/dir
Cheers,
s

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#10 Post by smokey01 »

It's also possible to hide the password by compiling the script.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#11 Post by smokey01 »

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.
Attachments
vortex-1.1.tar.gz
cURL version of Vortex
(802 Bytes) Downloaded 379 times

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#12 Post by seaside »

Nicely done with homegrown vegetables .:D

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: Select all

# 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
USER="username"
PASS="password"
in Vortex

Cheers,
s

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#13 Post by smokey01 »

Very nice seaside.

Some time ago I discovered a nice little script compiler, see here:
http://linux.softpedia.com/get/System/S ... 8503.shtml

This allows you to compile the script so the passwords are hidden.

Post Reply