Slide 1

Slide 1 text

App::RemoteCommand 2018.02.09 Shoichi Kaji

Slide 2

Slide 2 text

Me • Shoichi Kaji • github/PAUSE: skaji • Perl5: cpm • Perl6: mi6

Slide 3

Slide 3 text

Contents • What is App::RemoteCommand? • Why did I create it? • Features • DEMO • Internals

Slide 4

Slide 4 text

What is App::RemoteCommand?

Slide 5

Slide 5 text

A simple remote command launcher via SSH

Slide 6

Slide 6 text

Why did I created it? • We have a lot of tools that support IT automation, such as chef, ansible, capistrano, fabric, … • OTOH, we sometimes want to do ad hoc operation. Then such IT-automation tools are obtrusive. But ssh(1) is powerless. • So I created App::RemoteCommand, which is simple, and at the same time, powerful.

Slide 7

Slide 7 text

Features • Execute remote command in parallel • Remember sudo pass fi rst, never ask again • You may specify a local script fi le • Append host and time to each output line • Sane signal handling

Slide 8

Slide 8 text

DEMO https://asciinema.org/a/119109

Slide 9

Slide 9 text

Internals • a) Built on top of Net::OpenSSH • b) Using its own event loop

Slide 10

Slide 10 text

Built on top of Net::OpenSSH • Net::OpenSSH is a wrapper around ssh(1), created by Salvador Fandiño. • Because it is a wrapper for ssh(1), 
 it can use the complicated ~/.ssh/con fi g 😎 • It multiplexes SSH connections. • It provides sophisticated I/F for SSH operation, including I/F for event oriented programming.

Slide 11

Slide 11 text

Using its own event loop • Thanks to Net::OpenSSH, we can easily write an application working with SSH in event oriented programming. • In fact, App::RemoteCommand uses its own event loop; it watches: • SSH: connected, fi nished-command, disconnected • IO: readable • Process: fi nished • Signals: catched

Slide 12

Slide 12 text

Try it now! ❯ cpm install -g App::RemoteCommand