Pastebin διάμεσου Κονσόλας

Ανώνυμος (χωρίς επαλήθευση) | Κυρ, 01/13/2008 - 23:22 | 5'

pastebin  διάμεσου Κονσόλας 

Πολλές φορές για να είμαστε πιο παραγωγικοί στη δουλεία σας  θέλετε να κάνετέ επικόλληση  διαφόρων  ειδών αρχείων κείμενου σε  διάφορα  pastebin   sites   ώστε  να μπορούν και άλλοι να βοηθήσουν στην επίλυσή του προβλήματος σας....

μερικά τέτοια site   είναι :

www.pastebin.com

www.pastebin.ca

www.rafb.net

το  script  αυτό σας βοηθάει να  το κάνετέ μέσω    κονσόλας  χωρίς την παρέμβαση του mouse  σας.

όπως :


agiofws@celeron3~

$cat bouleutes-lists.txt | paste -n Agiofws

Your paste can be seen here: http://rafb.net/p/Z300KP70.html

το scriptaki  είναι :


#!/bin/bash

# A Script that automates pasting to pastebin(s)..

# Thanks to ed-209 for this wonderful idea.. you can see his version

# which is located at http://www.alpadesign.com/shpost .. :>

#

# Author: floyd_n_milan

# Date: 08th November 2006

# Comments: Added features to the original script by zer0python

#

# Changelog:

# 08/11/06: Removed an unnecessary [ and added timeout to curl

#

# Usage: shpost.sh [-n nick] [-t type] [-s service] [-d description]

# [-f source] [-h|--help|help]

############################################################ ##########

function showusage

{

cat 1>&2 << EOF

nopaste: Automatic posting to pastebin(s).

Usage:

$0 [-n nick] [-t type] [-s service] [-d description] [-f source] [-h|--help|help]

Default nick is randomized.

type is one of the following:

'C89', 'C', 'C++', 'C#'

'Java', 'Pascal', 'Perl'

'PHP', 'PL/I', 'Python'

'Ruby', 'SQL', 'VB'

'Plain Text'

BE SURE TO USE THE QUOTES FOR AT LEAST 'Plain Text'

Default is Plain Text.

service can be one of the following:

rafb - http://rafb.net/post

sh - http://sh.nu/p/

Default is rafb.

Description must be quoted (''), if more than one word.

Default source is read from the keyboard. :-)

-h or --help or help shows this usage summery.

Mail comments, suggestions, bugs etc to

[email protected]

EOF

}

nick=''

lang=''

service=''

desc=''

input=''

url=''

if grep help <<<'$@'; then

showusage

exit 0

elif [[ ! $1 ]]; then

input='$(</dev/stdin)'

nick='shpostuser${$}'

lang='Plain Text'

service='rafb'

desc='shpost Post'

fi

while getopts ':n:t:s:d:f:h' opt; do

case $opt in

n )

nick='${OPTARG:=nopasteuser$$}'

;;

t )

lang='${OPTARG:='Plain Text'}'

;;

s )

service='${OPTARG:=rafb}'

;;

d )

desc='${OPTARG:='shpost Post'}'

;;

f )

input='$(<'${OPTARG:=/dev/stdin}')'

;;

h )

showusage

exit 0;;

? )

showusage

exit 64 #E_WRONGARGS (What's that?)

esac

done

input='${input:='$(</dev/stdin)'}'

nick='${nick:='shpostuser${$}'}'

lang='${lang:='Plain Text'}'

service='${service:='rafb'}'

desc='${desc:='shpost Post'}'

if [[ $service = rafb ]]; then

url=$(

curl -i --connect-timeout 10

-F 'lang=$lang'

-F 'nick=$nick'

-F 'desc=$desc'

-F 'cvt_tabs=2'

-F 'text=$input'

http://rafb.net/paste/paste.php 2>/dev/null | grep -i location)

echo 'Your paste can be seen here: ${url:10}'

#echo 'Your paste can be seen here: http://rafb.net${url:10}'

exit 0

elif [[ $service = sh ]]; then

curl --connect-timeout 10 -F 'code=$input' -F 'poster=$nick' http://sh.nu/p/

exit 0

fi

exit 0

σώστε το αρχείο 

και κάνετέ  το  εκτελέσιμό 

chmod +x <όνομα.αρχείου>

και εκτελέστε το


$cat bouleutes-lists.txt | ./paste -n Agiofws

Your paste can be seen here: http://rafb.net/p/t6zTT142.html

 

Agiofws2007-7-5 14:57:19

Φόρουμ
Δώσε αστέρια!

MO: (ψήφοι: 0)