You are not logged in.

#1 2007-12-31 12:28:58

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Pastebin CLI script :)

I know there are TONS of packages out there that does the same thing but this one is SMALL.. very small..

I did NOT make this script. I modified it abit

Original script: http://www.stgraber.org/category/pastebinit/

Modified script:
http://archlinux.pastebin.com/f21b95071
http://pastebin.ca/840026
http://pastebin.com/f36c406e3
http://sashi.pastebin.com/f9ce653e   
http://dpaste.com/29504/

Make sure you chmod +x it!

Pastebin's supported:
http://archlinux.pastebin.com
http://pastebin.com
http://userhere.pastebin.com
http://pastebin.ca
http://dpaste.com

If you want another pastebin to be added just PM or request one in this topic.

Usage:  ./fileyounamedit filehere [url]URL is OPTIONAL
EG: ./pastebin /etc/X11/xorg.conf
With the URL option: ./pastebin /etc/X11 one of the supported pastebin's here (make sure to include http:// and no ending slash(/) )

Last edited by xxsashixx (2007-12-31 12:30:53)

Offline

#2 2007-12-31 12:41:12

sense
Member
From: Bangalore, India
Registered: 2007-10-24
Posts: 12
Website

Re: Pastebin CLI script :)

wow cool script. Hmm, Is there a script to upload screen shots to imageshack or similar websites? That will be good:D


There is no reason

Offline

#3 2007-12-31 12:42:27

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Re: Pastebin CLI script :)

you just asked this! lol

Offline

#4 2007-12-31 12:55:05

sense
Member
From: Bangalore, India
Registered: 2007-10-24
Posts: 12
Website

Re: Pastebin CLI script :)

thanks!! cool


There is no reason

Offline

#5 2007-12-31 15:42:34

delphiki
Member
Registered: 2007-11-17
Posts: 66
Website

Re: Pastebin CLI script :)

Awesome! These are really convenient, thanks! 8) - cool

Offline

#6 2008-01-01 09:25:34

onearm
Member
From: Anywhere but here
Registered: 2006-07-06
Posts: 359
Website

Re: Pastebin CLI script :)

sense wrote:

wow cool script. Hmm, Is there a script to upload screen shots to imageshack or similar websites? That will be good:D

Not a script but there is a firefox extension that does exactly this.


To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github

Offline

#7 2008-01-01 09:47:43

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: Pastebin CLI script :)

ahh so this was it..i presume why u wanted an "alias within a script" was for the URLs? So we only type that alias instead of the URL to make it shorter? Like arch, ca, paste, sashi? Well, just variables and case'd do it, or simply have an alias for those in your shell config/profile smile Anyway this is definitely something simple yet useful, thanks.


I need real, proper pen and paper for this.

Offline

#8 2008-01-01 13:33:32

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Pastebin CLI script :)

Definitely worth an AUR package, so it does not end up forgotten in the forums.


Mortuus in anima, curam gero cutis

Offline

#9 2008-01-01 16:30:29

crouse
Arch Linux f@h Team Member
From: Iowa - USA
Registered: 2006-08-19
Posts: 907
Website

Re: Pastebin CLI script :)

How about for the "official" arch pastebin (so we can fill it with something besides the spam)  http://pastebin.archlinux.org  wink

Offline

#10 2008-01-02 08:43:22

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Re: Pastebin CLI script :)

crouse thats the default one it goes to

Last edited by xxsashixx (2008-01-02 08:45:05)

Offline

#11 2008-01-03 03:44:50

dir
Member
From: dotph
Registered: 2007-10-10
Posts: 20

Re: Pastebin CLI script :)

sense wrote:

wow cool script. Hmm, Is there a script to upload screen shots to imageshack or similar websites? That will be good:D

Here:

#!/bin/bash
# 
#   imageshack_upload.sh 
#  
#   Copyright (c) 2007 by enki <enki@crocobox.org>
#  
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
# 
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#  
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
#   USA.
#
#   Changelog :
#   * 2006/10/22 -    Updated to support files with space . 
#                  Changes proposed by slubman(http://www.slubman.net)
#   * 2006/10/22 -    First version

myver='0.2'
CURL=$(which curl)



TMPFILE=$(mktemp /tmp/imageshack.XXXXXXXXXX) || exit 1

cleanup() {
        rm -rf $TMPFILE
        [ "$1" ] && exit $1
}

usage() {
    echo "imageshack_upload $myver"
    echo "usage: $0 <root>"
    echo
    echo "This script allow you to send image to htpp://www.imageshack.us"
    echo "in command line"
    echo
    echo "example: imageshack_upload.sh `pwd`/myimage.png" 
    echo
}

if [ $# -lt 1 ]; then
    usage
    rm -rf $TMPFILE
    exit 1
fi

if [ "$1" = "-h" -o "$1" = "--help" ]; then
    usage
    rm -rf $TMPFILE
    exit 0
fi


img="$1"

if ! [ -f "$img" ]; then
    echo "Error: file don't exist"
    exit 1
fi

$CURL -H Expect: -F fileupload="@${img}" -F xml=yes http://www.imageshack.us/index.php > $TMPFILE

echo "Url of image on imageshack:"
echo $(cat $TMPFILE | grep -E "<image_link>(.*)</image_link>" | sed 's|<image_link>\(.*\)</image_link>|\1|')

cleanup

Offline

#12 2008-01-03 04:28:41

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Pastebin CLI script :)

xxsashixx wrote:

crouse thats the default one it goes to

No, it doesn't.

http://pastebin.archlinux.org/
vs,
http://archlinux.pastebin.com/

Last edited by byte (2008-01-03 04:29:43)


1000

Offline

#13 2008-01-03 04:30:25

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Re: Pastebin CLI script :)

my bad.. smile lemme edit it so it goes default to .org then XD

*Edit*
Here you go:
http://archlinux.pastebin.org/13998
http://archlinux.pastebin.com/f1ca2d026
http://pastebin.com/f42cf588f

Last edited by xxsashixx (2008-01-03 04:36:10)

Offline

#14 2008-01-03 05:54:15

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Pastebin CLI script :)

GRAH!

pastebin.....................archlinux..................org

edit: okay, you probably didn't see my 2nd edit above, sorry.

Last edited by byte (2008-01-03 05:55:42)


1000

Offline

#15 2008-01-03 06:06:05

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Offline

#16 2008-01-03 15:11:16

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Pastebin CLI script :)

Does this only work on files? Or could one use it to toss pastebin the output of a terminal command?

Offline

#17 2008-01-03 15:23:53

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: Pastebin CLI script :)

pipe the output to a file smile


I need real, proper pen and paper for this.

Offline

#18 2008-01-08 22:50:59

surreal
Member
Registered: 2006-07-09
Posts: 6

Re: Pastebin CLI script :)

this might be a bit ot. but ompload here: http://omploader.org/vYTc0 does images and text to omploader

Offline

#19 2009-01-27 22:34:06

lylefan100
Member
Registered: 2009-01-21
Posts: 2

Re: Pastebin CLI script :)

surreal wrote:

this might be a bit ot. but ompload here: http://omploader.org/vYTc0 does images and text to omploader

http://aur.archlinux.org/packages.php?ID=19390
http://aur.archlinux.org/packages.php?ID=22754

Offline

#20 2009-01-28 01:52:32

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Re: Pastebin CLI script :)

Awesome script.

Thanks alot


"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

#21 2009-01-28 03:08:10

elmer_42
Member
From: /na/usa/ca
Registered: 2008-10-11
Posts: 427

Re: Pastebin CLI script :)

sense wrote:

Is there a script to upload screen shots to imageshack or similar websites?

I know this is a bit off topic, but I made a short script to upload to my favorite image site, kimag.es:

# kup.sh -- Script to upload to kimag.es. Usage: kup.sh picture.png
curl -# -F userfile=@$1 http://kimag.es/index.php?action=upload|grep http://arch.kimag.es/share|cut -c112-150

[ lamy + pilot ] [ arch64 | wmii ] [ ati + amd ]

Offline

Board footer

Powered by FluxBB