Skip to content

Instantly share code, notes, and snippets.

@TristinDavis
Forked from sharifulin/gist:1157271
Created November 16, 2012 01:35
Show Gist options
  • Save TristinDavis/4083125 to your computer and use it in GitHub Desktop.
Save TristinDavis/4083125 to your computer and use it in GitHub Desktop.
use Mojolicious::Lite;
get '/tasks' => sub {
my $self = shift;
$self->stash(
tasks => [
map { [ split /\s+/ ] }
split /\n/, qx(ps axh -o comm,stat,\%cpu,nice,pid,rss,user)
]
);
} => 'tasks';
app->start('daemon');
__DATA__
@@ tasks.html.ep
%= param 'killed'
%= dumper $tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment