• Stars
    star
    625
  • Rank 71,862 (Top 2 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 13 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CLI client for haste-server

Haste Client

Haste-client is a simple client for uploading data to Haste server. All you need to do is to pipe data in STDIN:

cat file | HASTE_SERVER_TOKEN=mytoken haste

And once the output makes it to the server, it will print the Haste share page URL to STDOUT.

This can be combined with pbcopy, like:

  • mac osx: cat file | haste | pbcopy
  • linux: cat file | haste | xsel

after which the contents of file will be accessible at a URL which has been copied to your pasteboard.

Installation

gem install haste

Configuration

Most of the configuration is controlled by env variables. Here is the all environment variables that you can use.

HASTE_SERVER: Haste server domain url
HASTE_SERVER_TOKEN: Github authentication token
HASTE_SHARE_SERVER: Haste share server domain url
HASTE_USER: Basic authentication user name
HASTE_PASS: Basic authentication user pass
HASTE_SSL_CERTS: SSL certs path

To add these environment variables, you should simply add them to your ~.bash_profile:

export VARIABLE="value"

Authentication

If you are using default HASTE_SERVER, you need to have an GitHub authentication token. You can get the information about authentication and how to generate token here

After you have generated your token, you should add it to your ~.bash_profile:

export HASTE_SERVER_TOKEN="mytoken"

or you can add token to your command:

cat file | HASTE_SERVER_TOKEN=mytoken haste`

If your Haste installation requires http authentication, add the following to your ~.bash_profile:

export HASTE_USER="myusername"
export HASTE_PASS="mypassword"

if you are using SSL, you will need to supply your certs path

export HASTE_SSL_CERTS="/System/Library/OpenSSL/certs"

Usage

If you supply a valid file path as an argument to the client, it will be uploaded:

# equivalent
cat file | haste
haste file

Different Haste server

By default, Haste share page will point at https://hastebin.com. If you have haste-server configured to serve bins on a separate domain, you also need to set ENV['HASTE_SHARE_SERVER'] value to that domain.

To set the value of share server, you can add the following to your ~.bash_profile:

export HASTE_SHARE_SERVER="myshareserver"

Different Haste server

By default, haste server will point at https://hastebin.com. You can change this by setting the value of ENV['HASTE_SERVER'] to the URL of your Haste server.

To set the value of server, you can add the following to your ~.bash_profile:

export HASTE_SERVER="myserver"

Use with alias

You can also use alias to make easy shortcuts if you commonly use a few hastes intermingled with each other. To do that, you'd put something like this into ~.bash_profile:

alias work_haste="HASTE_SERVER=https://something.com HASTE_SERVER_TOKEN=mytoken haste"

or

alias work_haste="HASTE_SERVER_TOKEN=mytoken haste"

After which you can use work_haste to send hastes to that server or with different tokens instead.

Use as a library

You can also use Haste as a library to upload hastes:

require 'haste'
uploader = Haste::Uploader.new
uploader.upload_raw 'this is my data' # key
uploader.upload_path '/tmp/whaaaa' # key

Contributor License Agreement

Licensed under the MIT license.

More Repositories

1

gitignore.io

Create useful .gitignore files for your project
Swift
8,174
star
2

haste-server

open source pastebin written in node.js
JavaScript
2,885
star
3

keycodes

Easy visualizer for JavaScript KeyCodes
TypeScript
2,153
star
4

chewy

High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
Ruby
1,857
star
5

webdevchecklist.com

Web Developer Checklist
HTML
1,802
star
6

gitignore

The largest collection of useful .gitignore templates
1,653
star
7

active-job-style-guide

This Background Jobs style guide is a list of best practices working with Ruby background jobs.
466
star
8

crystalball

Regression Test Selection library for your RSpec test suite
Ruby
321
star
9

granite

Business Actions architecture for Rails apps
Ruby
168
star
10

picasso

Toptal UI components library
TypeScript
121
star
11

xene

🤖 Modern library with simple API to build great conversational bots.
TypeScript
66
star
12

jvm-monitoring-agent

Monitor JVM from within, detect thread blocks and automatically save threads dump
Java
50
star
13

codeowners-checker

Check .github/CODEOWNERS consistency
Ruby
49
star
14

webpack-assets

Webpack Assets for Rails
Ruby
42
star
15

BestPracticesChromeExtension

Web Developer Checklist
JavaScript
37
star
16

component-resolver-webpack

Webpack plugin that simplifies process of components loading
JavaScript
32
star
17

chewy_example

Chewy example application
Ruby
32
star
18

test-distrib

Ruby
25
star
19

license-cop

A nifty script that fetches the licenses for all your third-party libraries
Python
24
star
20

disqus_api

Disqus API for ruby
Ruby
23
star
21

spring-commands-rubocop

RuboCop command for Spring
Ruby
19
star
22

chai-react-suite

JavaScript
16
star
23

archfiend

A basic daemon generator
Ruby
8
star
24

davinci-github-actions

Reusable Github Actions for davinci based applications
JavaScript
8
star
25

jenkins-job-trigger-action

GitHub Action for triggering Jenkins Jobs and wait build result.
Ruby
7
star
26

trixie

CLI tool to fetch secrets in development
Ruby
6
star
27

rspec-any_of

any_of/all_of argument matcher for RSpec
Ruby
5
star
28

eslint-config-toptal

Shared eslint config for Toptal projects
JavaScript
5
star
29

example_granite_application

Example application for Granite framework
Ruby
4
star
30

rack-rake_task

A simple Rack middleware that allows execution of Rake tasks via the HTTP request
Ruby
2
star
31

slack-mass-messenger

Allows the user to send personalized message to multiple Slack users so it appears on Slack as sent by the user themselves.
Python
2
star
32

topcall-release

1
star
33

tracker-api-load-tester

JavaScript
1
star
34

gitignore.io-docs

Gitignore.io documentation
1
star
35

granite-form

Form builder for granite based on ActiveData
Ruby
1
star
36

rails_commander

Programmatical (Ruby) wrapper to Rails' CLI
Ruby
1
star