App-HistHub
view release on metacpan or search on metacpan
lib/App/HistHub.pm view on Meta::CPAN
package App::HistHub;
use Moose;
our $VERSION = '0.01';
use POE qw/
Wheel::FollowTail
Component::Client::HTTPDeferred
/;
use JSON::XS ();
use HTTP::Request::Common;
use Fcntl ':flock';
has hist_file => (
is => 'rw',
isa => 'Str',
required => 1,
);
has tailor => (
is => 'rw',
isa => 'POE::Wheel::FollowTail',
);
has ua => (
is => 'rw',
isa => 'POE::Component::Client::HTTPDeferred',
lazy => 1,
default => sub {
POE::Component::Client::HTTPDeferred->new;
},
);
has json_driver => (
is => 'rw',
isa => 'JSON::XS',
lazy => 1,
default => sub {
JSON::XS->new->latin1;
},
);
has poll_delay => (
is => 'rw',
isa => 'Int',
default => sub { 5 },
);
has update_queue => (
is => 'rw',
isa => 'ArrayRef',
default => sub { [] },
);
has api_endpoint => (
is => 'rw',
isa => 'Str',
required => 1,
);
has api_uid => (
is => 'rw',
isa => 'Str',
);
=head1 NAME
App::HistHub - Sync shell history between multiple PC.
=head1 SYNOPSIS
use App::HistHub;
my $hh = App::HistHub->new(
hist_file => 'path to your history file',
api_endpoint => 'http://localhost:3000/',
);
$hh->run;
=head1 DESCRIPTION
App::HistHub is an application that enables you to sync shell history between multiple computers.
This application consists of two modules: client module (histhubd.pl) and server module (histhub_server.pl).
You need one histhub server. To bootup the server, type following command:
histhub_server
This server receive updating history data from one client, and broadcast to others.
You also need one client daemon in each computer that you want to share history. To boot client, type following command:
histhubd --histfile=/path/to/your_history_file --server=http://your_server_address
This client send updated history to server, and receive new history from other clients.
=head1 METHODS
( run in 2.670 seconds using v1.01-cache-2.11-cpan-e1769b4cff6 )