.. title: The Ultimate Plumber
.. slug: the-ultimate-plumber
.. date: 2018-11-05 00:25:56 UTC+01:00
.. tags: shell scripting, linux, go
.. category:
.. link:
.. description:
.. type: text

Working in a Unix console enables the use of sophisticated pipelines
in day to day administrative work.  Sometimes such complex pipelines
can only be assembled in an interactive and iterative series of
prototypes.  In such a situation `up - the Ultimate Plumber
<https://github.com/akavel/up>`_ can speed up work significantly by
shortening the iteration cycles.

.. image:: /images/data_stream.png
   :width: 200
   :alt: Pipes
   :align: center

.. TEASER_END

Once called on the input data that we want to inspect more closely,
the rest of the pipeline is then edited with instant visual feedback
of the results.

For example, when searching for specific information in the ``procfs``
file system, I can simply start the exploration like shown below.
Note that this is usually run as root to be able to read all of
``procfs``:

.. code-block:: console

  root@deepthought:~# find /proc | up

From here we can start drilling down into the output.  The demo below
shows an interactive session looking for all running processes that
map files matching ``/libsystemd*`` in their memory space, i.e. that are
linked against the systemd library.

.. image:: /images/up-systemd.gif
   :alt: up demo
   :align: center

On this system, the library certainly is widely used.  There are two
things to note in the demo:

* The command is only run on pressing **Enter**.  There is a more
  aggressive mode ``--unsafe-full-throttle`` but I find it disturbing
  to be interrupted by the error messages while the edit is still not
  syntactically correct.
* The output can be scrolled with the **Page Down** and **Page Up** keys.
  This can also be seen at the end of the demo.
