2012-08-29

skypipe : a cloud based named pipe

skypipe is a really nice idea about an ubiquitous named pipe on the net.

Basically it allows you to pipe data on a shell from one machine to another without knowing/doing anything, no IP to know, no tunnel to setup, nothing.

See at the end of the post how to set it up.

I show you a small demo here with the default anonymous pipe:

.
MachineA # skypipe < /etc/issue.logo

-------------

MachineB # skypipe

     .vir.                                d$b
  .d$$$$$$b.    .cd$$b.     .d$$b.   d$$$$$$$$$$$b  .d$$b.      .d$$b.
  $$$$( )$$$b d$$$()$$$.   d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b.  .$$$$$$$b.
  Q$$$$$$$$$$B$$$$$$$$P"  d$$$PQ$$$$b.   $$$$.   .$$$P' `$$$ .$$$P' `$$$
    "$$$$$$$P Q$$$$$$$b  d$$$P   Q$$$$b  $$$$b   $$$$b..d$$$ $$$$b..d$$$
   d$$$$$$P"   "$$$$$$$$ Q$$$     Q$$$$  $$$$$   `Q$$$$$$$P  `Q$$$$$$$P
  $$$$$$$P       `"""""   ""        ""   Q$$$P     "Q$$$P"     "Q$$$P"
  `Q$$P"                                  """


This is \n.\O (\s \m \r) \t


Magical isn't it ?

skypipe takes a parameter to give you a named pipe, so alternatively you can do the more precise :
.
MachineA # skypipe gentoologo < /etc/issue.logo

-------------

MachineB # skypipe gentoologo

     .vir.                                d$b
  .d$$$$$$b.    .cd$$b.     .d$$b.   d$$$$$$$$$$$b  .d$$b.      .d$$b.
  $$$$( )$$$b d$$$()$$$.   d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b.  .$$$$$$$b.
  Q$$$$$$$$$$B$$$$$$$$P"  d$$$PQ$$$$b.   $$$$.   .$$$P' `$$$ .$$$P' `$$$
    "$$$$$$$P Q$$$$$$$b  d$$$P   Q$$$$b  $$$$b   $$$$b..d$$$ $$$$b..d$$$
   d$$$$$$P"   "$$$$$$$$ Q$$$     Q$$$$  $$$$$   `Q$$$$$$$P  `Q$$$$$$$P
  $$$$$$$P       `"""""   ""        ""   Q$$$P     "Q$$$P"     "Q$$$P"
  `Q$$P"                                  """


This is \n.\O (\s \m \r) \t


Skypipe even bufferize your output so it doesn't require any precise timing to do it.

Setup

A prerequisite is to go to https://www.dotcloud.com/ and request a free account (it is relatively hassle free BTW).

Once you get that, you can install skypipe from my overlay if you are under gentoo :
# layman -L
# layman -a gbin
# echo "=net-analyzer/skypipe-9999 **" >> /etc/portage/packages.keywords

# emerge skypipe
Under other systems you will need for now to go with a manual setup :
# git clone git://github.com/progrium/skypipe.git
# cd skypipe
# python setup.py install

Then simply starts once the skypipe command on both machines so it first deploys itself to your newly dotcloud account then asks you and remember your credential for access on any new machine.
# skypipe                      
==> First time use, please setup dotCloud account
dotCloud username: gbin
Password: 
==> Launching skypipe satellite. This only has to happen once for your account.
==> This may take about a minute...
==> DEBUG: Found satellite

Thanks to Jeff Lindsay  for this cool tool.
Edit: removed the useless cat usage thx to sigil

8 comments:

  1. Replies
    1. Imagine 2 machines behind nat... this tools allows to magically netcat between them without all the headaches

      Delete
  2. Does this work for mac osx?



    Running pyzmq-static-2.1.11.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-657oHV/pyzmq-static-2.1.11.2/egg-dist-tmp-m81aG0
    unable to execute clang: No such file or directory
    error: Setup script exited with error: command 'clang' failed with exit status 1

    ReplyDelete
    Replies
    1. Try perhaps the non static version of pyzmq, this is the one I used in my ebuild by changing pyzmq-static to pyzmq in the dependencies in setup.py
      You will need 0mq installed by a macport or something similar.

      Delete
  3. Hmm..


    w1x@w1x0-dev:~/hak/dotcloud/skypipe$ skypipe
    Traceback (most recent call last):
    File "/usr/local/bin/skypipe", line 9, in
    load_entry_point('skypipe==0.1.0', 'console_scripts', 'skypipe')()
    File "/usr/local/lib/python2.7/dist-packages/skypipe-0.1.0-py2.7.egg/skypipe/client.py", line 24, in run
    zmq_endpoint = deploy.find_satellite(context)
    File "/usr/local/lib/python2.7/dist-packages/skypipe-0.1.0-py2.7.egg/skypipe/deploy.py", line 139, in find_satellite
    cli = CLI(endpoint=url)
    File "/usr/local/lib/python2.7/dist-packages/skypipe-0.1.0-py2.7.egg/dotcloud/ui/cli.py", line 42, in __init__
    version_checker=self._check_version)
    File "/usr/local/lib/python2.7/dist-packages/skypipe-0.1.0-py2.7.egg/dotcloud/client/client.py", line 17, in __init__
    self._make_session()
    File "/usr/local/lib/python2.7/dist-packages/skypipe-0.1.0-py2.7.egg/dotcloud/client/client.py", line 38, in _make_session
    verify=True)
    File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 279, in session
    return Session(**kwargs)
    TypeError: __init__() got an unexpected keyword argument 'verify'

    ReplyDelete
  4. FYI I run it perfectly under python 2.7 and I have those direct dependencies :
    pyzmq==2.2.0.1
    requests==0.13.6
    argparse==1.2.1
    colorama==0.2.4

    ReplyDelete
  5. Also feel free to report issues to the author at https://github.com/progrium/skypipe/issues

    ReplyDelete