GithubHelp home page GithubHelp logo

sjmulder / trickle Goto Github PK

View Code? Open in Web Editor NEW
100.0 7.0 5.0 26 KB

600 baud pipe and terminal.

License: BSD 2-Clause "Simplified" License

Makefile 12.70% C 51.69% Roff 35.61%
unix utility textprocess pipe baud

trickle's Introduction

trickle & tritty

Slow pipe and terminal.

macOS note: Homebrew users can easily install trickle and tritty with the formula at https://github.com/nickolasburr/homebrew-pfa

trickle

trickle [-b bitrate]

trickle is used as part of a shell pipeline and has very low throughput, hence the name: data trickles through the pipe. By default, it passes on 600 bits per second, but this can be configured:

-b bitrate

(For "baud", bits per second.) Must be a number in range 50-57600. A decimal separator and decimal 'k' suffix can be used.

tritty

tritty [-b bitrate] [command ...]

tritty ("trickle tty") spawns an interactive subterminal with very low throughput. It simulates the experience of using a terminal over a slow connection.

By default, it runs at 600 bits per second (full duplex) but this can be configured:

-b bitrate

(For "baud", bits per second.) Must be a number in range 50-57600. A decimal separator and decimal 'k' suffix can be used.

command

Will be executed inside the virtual terminal. It defaults to the SHELL environment variable, or /bin/sh if unset.

Note that by only limiting throughput the serial device experience is not accurately simulated. In particular, the baud rate attribute on the virtual terminal is not set. Software may use this attribute to adjust their output.

Use stty(1) from within a tritty session to adjust the baud rate attribute of the terminal as shown in the examples below. The original settings will be restored on exit.

Examples

Print README.rm to the terminal at 600 baud:

$ trickle <README.rm

List files at 2600 baud:

$ ls | trickle -b2600

List files at 57600 baud:

$ ls | trickle -b57.6k

Browse the web with a 14400 baud terminal:

$ tritty -b14.4 elinks news.ycombinator.com

Run the default shell at 2600 baud:

$ tritty -b2600   # now in the tritty session
$ man man
  ...
$ exit
exit
$                 # back to regular terminal

Run the default shell at 300 baud, also setting the terminal baud rate attribute:

$ tritty -b300
$ sty 300
   ...
$ exit

Building

Should work on most Unix-like systems, perhaps with some tweaks. Tested on FreeBSD, macOS, Linux and Linux with musl.

Edit the Makefile if desired. Then:

make

There are install and uninstall targets, too. PREFIX is set to /usr/local by default.

Author

By Sijmen J. Mulder ([email protected])

trickle's People

Contributors

sjmulder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

trickle's Issues

Create brew formula

Would you take the time to create a homebrew formula?

I would help out if you don't want to do it (if you are ok with that), but because I have 0 experience with ruby it might take some time.

network support

is possible to add trickle for network slow program called "trinet", the argument a the source is host:port and a port for target, slow with -b argument number selected.

trinet [-b bitrate] host:port port

terminal resizing

This is awesome. I currently use it strictly for nostalgia with some terminal software I use daily.

An issue I noticed is that tritty doesn't seem to appreciate terminal size changes. E.g., if I'm connected with putty, using tritty, and I resize the window, the terminal disconnects and disappears immediately.

Compile error on Debian 9

When I run make on my Debian 9 machine, I get the following output:

cc -ansi -Wall  -o trickle trickle.c
In file included from trickle.c:12:0:
trickle.h:2:18: error: field ‘delay’ has incomplete type
  struct timespec delay;
                  ^~~~~
trickle.c: In function ‘main’:
trickle.c:31:3: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
   nanosleep(&opts.delay, NULL);
   ^~~~~~~~~
Makefile:11: recipe for target 'trickle' failed
make: *** [trickle] Error 1

No binary is produced.

Missing features

Very nice little utility!
Now you should implement "noisy" lines (spurious characters) or error correction emulation (speed will not be constant depending on noisiness).
Full model emulation would be very nice also 😃

Why not use pv -L ?

I can't see the usefulness of trickle existing this other well-known alternative
I'd glad to be lighted.
Thanks!

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.