GithubHelp home page GithubHelp logo

arrgap's Introduction

This is a small convenience utility for a more convenient working in a secured environment where your VPN blocks all of the connections to local network, but nonetheless you would like to retain the terminal shell access to the devices on it.

For this, one can configure a raspberry pi zero w to act as a USB gadget with the login shell on the serial port - thus, for your main laptop it will appear as a serial port dongle connected to "some" linux computer.

Since the serial communication is uninhibited, you can get the simultaneous control over the device on the local network (from raspberry), as well as in the secured environment (directly over VPN).

However, there is a catch: the serial interface assumes a fixed window size. This makes it supremely inconvenient to use it in a window - the moment you resize the window away from the default 80x24, all your output goes very corrupt.

Quite obviously - because SIGWINCH, which is sent to your local terminal when you resize the window, is not sent over the serial interface. This small program is there to take care of that: first, on your main/secured host launch "ARRGAP_LOCAL=y ./arrgap". This will give you a shell.

In this shell, connect to the serial port, raspberry pi, etc. On the raspberry pi, start ./arrgap - this will give you another shell. If you now start a full screen terminal app (like vi or tmux), and resize your terminal, you will see that the target application has resized as well!

This is achieved by emitting from the host machine an escape sequence each time it gets a SIGWINCH, and the target machine intercepts this escape sequence and sends the appropriate ioctl() locally, setting the terminal window size. The local apps notice that and adapt accordingly.

arrgap's People

Contributors

ayourtch avatar

Watchers

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