Coder Social home page Coder Social logo

wrax's Introduction

wrax

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠙⠓⠢⢤⣀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⡄⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢀⡄⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣾⡇⢠⡠⢤⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀
⠀⠀⠀⡀⣿⡇⢿⣃⠀⠀⠈⠙⠒⠢⠤⠄⠄⠒⠒⠚⠃⠀⠀⣀⠄⢸⠀⠀⠀⠀
⠀⠀⢠⠀⣿⠇⠄⠙⠓⠲⣤⣀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣼⠏⠁⠀⠀⢧⠀⠀⠀
⠀⠀⢸⡷⠻⡗⠀⠀⣀⣠⣤⣤⣽⣿⣿⣿⣿⣿⣶⣶⣦⣤⣄⡀⠀⠀⢀⡇⠀⠀
⠀⠀⠨⠂⠶⣷⣿⣿⣿⣿⣿⣿⣿⣿⢹⣿⡟⢻⣿⣿⣿⣿⣿⣿⣿⣦⢀⡇⠀⠀
⠀⠠⣴⠀⣼⣿⣿⣿⣿⣿⡡⢿⣿⠇⣾⡟⡀⠸⣿⡹⣿⡏⠛⣿⣿⣿⡆⢧⠀⠀      `wrax` is a simple file wrapper
⠀⠠⠇⣼⣿⣿⣿⣿⢿⣿⡿⠿⣋⣾⠟⠁⢣⣷⡈⢿⣌⠳⣴⡿⢃⣿⣿⡌⢣⠀       which enables ssh superpowers
⠀⠂⢠⣿⣿⣿⣷⡟⠶⠶⠖⠚⠋⠉⠀⠀⠘⠛⠃⠀⠉⠓⠒⠒⣫⣿⣿⣧⠀⢳
⠀⢠⣾⣿⣿⣿⢿⣿⣷⣶⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⠟⠋⣿⣟⣷⠀⠈
⠀⣾⢻⠛⣿⣿⣆⠙⢄⠘⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣹⣿⠷⢡⣿⠋⠉⠀⠀
⠂⠿⣿⣶⣿⣿⣿⣄⠀⠙⢼⣷⡀⠀⠀⡆⠀⠈⡆⠀⢠⢻⠁⢠⣻⡿⠁⠀⠀⠀
⠤⠀⠀⠹⢿⣿⣿⣿⣧⣄⠀⢹⣷⡄⣀⣵⣶⡶⠷⠶⣴⡟⡰⢫⣿⡇⠀⠀⠀⠄
⠈⢀⣤⣤⣼⣿⣿⣿⣿⣿⡄⠈⣿⣷⣿⠋⠁⠀⠀⠀⠀⢻⡁⣸⣿⡁⠀⠀⠀⠀
⣿⣯⡀⠀⠉⠛⠿⢿⣿⣿⣿⡄⢹⣿⣿⣀⠀⠀⣀⣤⣀⠘⣿⣿⠟⠀⠀⠀⠀⠀
⣿⣿⣆⣀⡀⠀⡰⣿⡈⣿⣿⣿⣼⣿⣿⣷⣾⡿⠿⠿⣿⣷⣿⣷⠀⠀⣴⣿⣿⣿
⠉⢾⣿⣛⣭⡍⡿⢁⡇⣿⣿⣿⣿⣿⣿⣿⣿⡟⡁⢉⣻⣿⣿⡏⠀⠀⠉⠉⢉⣿
⠀⠈⢽⣿⡽⠖⢀⣿⡧⢻⣿⣿⣿⣿⣿⣿⣿⣃⡀⠀⣈⣿⣿⡇⠀⠀⠀⠀⣾⡟

About

wrax is a simple file wrapper, converting a single file to a string that can be consumed by stdin. The author's primary use case is to pair it with ssh to create a KISS remote automation/management tool. For example:

for host in master1 worker1 worker2; do
  wrcmd examples/autoupdate.sh | wrsudo | ssh -J juser@jumphost user@${host}
done

Will run the idempotent script examples/autoupdate.sh as root on the hosts: master1 worker1 worker2, which are only accessable through the jumphost.

Installation

install.sh will install wrcmd, wrcp & wrsudo to BINDIR, by default ~/bin, if you would like to install it elsewhere, set BINDIR to your desired path.

curl -sfL https://raw.githubusercontent.com/dxlr8r/wrax/main/install.sh | BINDIR="$HOME/bin" sh -

If BINDIR is located in a directory in which you lack write access, run as sudo.

curl -sfL https://raw.githubusercontent.com/dxlr8r/wrax/main/install.sh | BINDIR=/usr/local/bin sudo sh -

Commands

wrcmd

wrcmd file

Description: converts file to a string/heredoc, and executing the string using the binary supplied in the file's shebang.

wrcp

Only recommended to transfer smaller files (~1MB or less).

wrcp file dest

Description: converts file to a string/heredoc, and copies it to dest.

wrsudo

Requires passwordless sudo escalation.

wrsudo

Description: wraps stdin in a sudo heredoc.

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.