Giter VIP home page Giter VIP logo

lemonade's Introduction

Lemonade

remote...lemote...lemode......Lemonade!!! 🍋 🍋

Lemonade is a remote utility tool. (copy, paste and open browser) over TCP.

Build Status

Maintainers wanted

See lemonade-command#25

Installation

go get -d github.com/lemonade-command/lemonade
cd $GOPATH/src/github.com/lemonade-command/lemonade/
make install

Or download from latest release

Example of use

Example

For example, you use a Linux as a virtual machine on Windows host. You connect to Linux by SSH client(e.g. PuTTY). When you want to copy text of a file on Linux to Windows, what do you do? One solution is doing cat file.txt and drag displayed text. But this answer is NOT elegant! Because your hand leaves from the keyboard to use the mouse.

Another solution is using the Lemonade. You input cat file.txt | lemonade copy. Then, lemonade copies text of the file to clipboard of the Windows!

In addition to the above, lemonade supports pasting and opening URL.

Usage

Usage: lemonade [options]... SUB_COMMAND [arg]
Sub Commands:
  open [URL]                  Open URL by browser
  copy [text]                 Copy text.
  paste                       Paste text.
  server                      Start lemonade server.

Options:
  --port=2489                 TCP port number
  --line-ending               Convert Line Ending(CR/CRLF)
  --allow="0.0.0.0/0,::/0"    Allow IP Range                [Server only]
  --host="localhost"          Destination hostname          [Client only]
  --no-fallback-messages      Do not show fallback messages [Client only]
  --trans-loopback=true       Translate loopback address    [open subcommand only]
  --trans-localfile=true      Translate local file path     [open subcommand only]
  --help                      Show this message

On server (in the above, Windows)

$ lemonade server

Client (in the above, Linux)

# You want to copy a text
$ cat file.txt | lemonade copy

# You want to paste a text from the clipboard of Windows
$ lemonade paste

# You want to open an URL to a browser on Windows.
$ lemonade open 'http://google.com'

Configuration

You can override command line options by configuration file. There is configuration file at ~/.config/lemonade.toml.

Server

port = 1234
allow = '192.168.0.0/24'
line-ending = 'crlf'
  • port is a listening port of TCP.
  • allow is a comma separated list of a allowed IP address(with CIDR block).

Client

port = 1234
host = '192.168.x.x'
trans-loopback = true
trans-localfile = true
line-ending = 'crlf'
  • port is a port of server.
  • host is a hostname of server.
  • trans-loopback is a flag of translation loopback address.
  • trans-localfile is a flag of translation localfile.

Detail of trans-loopback and trans-localfile are described Advanced Usage.

Advanced Usage

trans-loopback

Default: true

This option works with open command only.

If this option is true, lemonade translates loopback address to address of client.

For example, you input lemonade open 'http://127.0.0.1:8000'. If this option is false, server receives loopback address. But this isn't expected. Because, at server, loopback address is server itself.

If this option is true, server receives IP address of client. So, server can open URL!

trans-localfile

Default: true

This option works with open command only.

If this option is true, lemonade translates path of local file to address of client.

For example, you input lemonade open ./file.txt. If this option is false, server receives ./file.txt. But this isn't expected. Because, at server, ./file.txt doesn't exist.

If this option is true, server receives IP address of client. And client serve the local file. So, server can open the local file!

line-ending

Default: "" (NONE)

This options works with copy and paste command only.

If this option is lf or crlf, lemonade converts the line ending of text to the specified.

Alias

You can use lemonade as a xdg-open, pbcopy and pbpaste.

For example.

$ ln -s /path/to/lemonade /usr/bin/xdg-open
$ xdg-open  'http://example.com' # Same as lemonade open 'http://example.com'

Secure TCP Connection

Lemonade doesn't provide encryption and authorization. However we can use SSH Port forwarding for the purpose.

lemonade server

$ lemonade server -allow 127.0.0.1 &
$ ssh -R 2489:127.0.0.1:2489 user@host

See:

Links

lemonade's People

Contributors

jsvisa avatar lambdalisue avatar magicmark avatar mattn avatar pocke avatar raa0121 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.