Git Product home page Git Product logo

barn's Introduction

Barn

Barn is a tool to mirror your local directory on a remote machine.

demo

asciicast

Prerequisite

Make sure the remote machine's kernel has enabled CONFIG_FUSE_FS. This is the only dependency, no others!

Usage

  1. Start server on the remote machine:
# barn server

By default, it will select a unused port to listen on. Of course you could specify the port with --port option:

# barn server --port=xxx
  1. Connect to the server from your local machine:
# barn client --remote=<remote machine's ip address> --port=<the listenning port>
  1. Once the initialization is done between server and client, you should see the mirror directory like this on server's output:
serving from <ip>:<port>, the mirror root directory: /tmp/barn_xxx

However, you could also find the location through mount point:

# mount
...
/dev/fuse on /tmp/barn_xxx type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
  1. Now, everything is set successfully, you could do whatever you want in the mirror directory, everything there is a mirror of your local root directory. You could even chroot into that directory:
# chroot /tmp/barn_xxx /bin/bash

Have fun!

Installation

You could either download the prebuilt binary or build from source.

How to build

Zig version: 0.11.0

git clone https://github.com/tw4452852/barn
cd barn
zig build -Dtarget=x86_64-linux-musl

If everything is ok, the binary will be located in ./zig-out/bin/barn.

Inspiration

This tool is heavily inspired by the u-root's cpu which is an implementation of plan9's cpu. There is an excellant article to talk about it.

barn's People

Contributors

kassane avatar tw4452852 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.