wgetpaste default to gists06 May 2015 • Leave Comments
- wgetpaste is tool to conveniently paste your text and code snippet online around. However, it defaults to bpaste which relatively weak compared to gist. In this post, I will configure wgetpaste to use gist instead.
$ wgetpaste -h
This command will show the basic command options.
$ wgetpaste -S
This will list free service supported by wgetpaste.
Services supported: (case sensitive): Name: | Url: =============|================= *bpaste | https://bpaste.net/ ca | http://pastebin.ca/ codepad | http://codepad.org/ dpaste | http://dpaste.com/ lugons | https://paste.lugons.org/ poundpython | http://paste.pound-python.org/ gists | https://api.github.com/gists
The default service is bpaste with a * ahead.
Now we need to change it to gists.
# ect /etc/wgetpaste.d/gists.conf DEFAULT_SERVICE="gists"
wgetpaste supports many other options,
Run wgetpaste -S again to verify configuration.
$ wgetpaste ~/Documents/test-file
Up to now, wgetpaste will paste text and code snippet as anonymous gist.github.com.
anonymous gist cannot be searched later on.
- wgetpaste to GitHub account.
- Go to GitHub settings and find Personal access tokens.
- Choose Generate new token and set the token description to wgetpaste.
- Change token right to gist only.
- Edit /etc/wgetpaste.d/gists.conf:
# /etc/wgetpaste.d/gists.conf HEADER_gists="Authorization: token 1234abc56789..."
Test again wgetpaste ~/Documents/test-file.
Now each wgetpaste execution will paste contents to GitHub acount, which enables search, edit, comment etc. later on.
Actually since gist supports markdown, we can use gist as a pure text blog.
- If once for a while, you don't want to expose your GitHub account on the Internet, you could add
-goption to generate bpaste service. You can also use
-g -s giststo generate anonymous gist.
-goption tells wgetpaste to ignore configurations.