Git Product home page Git Product logo

tmux-lan-deploy's Introduction

tmux-lan-deploy

A template workspace to work with a shared codebase and terminal across different machines in LAN through nested tmux sessions.

Use case

You're really tired and you have:

  • Two or more ssh-ready machines in LAN
  • That need to run some platform-specific code
  • Which may or may not be distributed across different packages or repos
  • Which may or may not need to be developed in a joint setup

Hence, here is a single workspace:

  • Shared in a mount point via sshfs
  • In which you can implement your automation scripts
  • That call code arbitrarily distributed
  • That can run at the same time in different machines

Dependencies

Assuming all your machines can already connect among them via ssh, you may need the following additional packages.

Host machine:

$ apt install sshfs openssh-sftp-server \
              ncat tmux tmuxinator            

Client machines:

$ apt install sshfs openssh-sftp-server 
$ apt install tmux tmuxinator            # optional, only for nested sessions

Setting up

From the provided boilerplate, adjust the tmuxinator.yml and ssh.config files to your liking.

  • Tune tmuxinator.yml to connect tmux panes to your devices: ssh -F ssh.config [email protected]
  • Tune ssh.config to define networking behavior for each desired connection.
    • Ajust target IP addresses
    • Assign arbitrary unique ports to enable reverse-calling sshfs
    • Specify the shared dir on the host and its mount path on clients

On clients, ensure the mount path exists as an empty directory.

Find a ssh.config file overview for a single connection here.

Quickstart

Run ./tmuxinator.yml to start the parent tmux session that will get everything moving. Its prefix key has been changed to ^A so that any client can use the default, see and modify the repo's tmux.conf file as you like.

After you're logged in the remotes, try sweet commands like ls or touch f to verify that your files are indeed being shared.

Be very careful and mind the following:

  • Mount point could be left unmounted, keep an eye on warnings if any
  • Mount point is read/write for all clients
  • Weird stuff can happen when layering tmux
  • Do not put more than one finger in the power plug

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.