wgetpaste

From Gentoo Wiki
Jump to: navigation, search

Resources

wgetpaste is a command-line interface to various online pastebin services.

Installation

Install app-text/wgetpaste:

root #emerge --ask app-text/wgetpaste

Usage

Run the following command to create a paste of the system's Xorg configuration:

user $wgetpaste /etc/X11/xorg.conf

To create a paste of xorg.conf using the tiny URL service use the -u option:

user $wgetpaste -u /etc/X11/xorg.conf

To set a language for syntax highlighting use the -l option:

user $wgetpaste -l Bash /etc/bash/bashrc

Use the -L option to list all available languages, which depends on selected paste service:

user $wgetpaste -L

To paste the entire output of a command, use the -c option. Remember to quote the command:

user $wgetpaste -c 'emerge -vp musique'

Service selection

To list available pastebin services use the -S option:

user $wgetpaste -S
Services supported: (case sensitive):
   Name:    | Url:
   =========|=================
    bpaste  | https://bpaste.net/
    codepad | http://codepad.org/
   *dpaste  | http://dpaste.com/
    gists   | https://api.github.com/gists

Select an alternate service by adding the -s option.

user $wgetpaste -s codepad file.txt

Github gists

The gists service requires a valid API token. Generate it on the Github website and paste it into a config snippet:

FILE ~/.wgetpaste.d/gists.conf
HEADER_gists="Authorization: token abcdef..."

You can also set whether your gist is public or private by setting the PUBLIC_gists variable in your config file, or on the command-line thus:

user $PUBLIC_gists=false wgetpaste -s gists <path-to-file>
Important
'PUBLIC_gists' must be set to true or false only or it will report an error!