The Artima Developer Community
Sponsored Link

Weblogs Forum
Spoken Log

2 replies on 1 page. Most recent reply: Jan 7, 2005 11:02 AM by Stephen Birch

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Ward Cunningham

Posts: 11
Nickname: ward
Registered: Apr, 2003

Spoken Log (View in Weblogs)
Posted: Nov 28, 2004 11:11 PM
Reply to this message Reply
Summary
Keep close tabs on your server with voice output.
Advertisement

I've been trying to keep closer tabs on my wiki site so that I can understand the ways people act there. This weekend I added voice synthesis. This turns out to be a lot of fun and pretty informative too. I'm writing to other server operators to encourage them to give this a try.

My mac has a command line program that will pronounce text. If I want it to say hello to the world I would type:

say hello world

I can add this to my perl wiki server by adding the line:

system("say $page&");

Place it in wiki.cgi just after where it figured out the requested page. I add the & to the command so that the server doesn't wait for the speaking to finish before serving the page. This could be a lot of fun if you're running a wiki for a group of people who happen to sit near the server. A more useful variation might be to add the speaking to the edit.cgi script. This would announce which pages are being edited so that people can avoid conflicts.

Now I don't actually sit anywhere near my server so I had to monitor its activity remotely. I'm used to using tail -f to watch my server logs. This works fine through secure shell too:

ssh 'tail -f /var/log/httpd/access_log'

So I wrote this into a perl script, something like:

open(L, "ssh c2.com 'tail -f /var/log/httpd/access_log'|");
while() {
  system("say $1&") if /([A-Z][a-z]+([A-Z][a-z]+)+)/;
}

This looks for wiki names in the log and pronounces them as fast as they come. I put the system call into a subroutine and added a sleep to limit the rate to one a second.

sub say {
  system("say $1&");
  sleep(1);
}

Longer names take more than a second to say so the talking can overlap. But this is easy to understand so long as the starts are staggered.

I've added a second voice for more rare events, like posts back to the server for saved pages:

system("say -v Bruce post&") if /POST/;

Bruce is easy to understand even when my default voice, Victora, is gabbing away. I've actually added five or six triggers for Bruce. When he gets going I know someone is doing something weird to my server.

I've also found it useful to ignore the robots. With them crusing through my site the talking gets way too complicated. I added this right inside the while loop:

next if /googlebot.com/;

You will have to tune what you look for and how you say it so that you get a good feel for what is going on moment by moment. Once you have it working, try watching the log the old fashion way in a separate window. You'll find more things you might want to pronounce.


Joe Cheng

Posts: 65
Nickname: jcheng
Registered: Oct, 2002

Re: Spoken Log Posted: Nov 29, 2004 10:58 AM
Reply to this message Reply
Nice idea!

That reminded me of a presentation[1] given at LL3 last year. They were using Jabber (the instant messaging protocol) to enable two-way communications with each machine in a large cluster. I really liked the idea of getting an instant message when an error message is logged, and being able to reply with "restart" or whatever.

There are Jabber client libraries available for most languages and platforms, including Perl[2], of course.

[1] http://ll3.ai.mit.edu/abstracts.html#acme
[2] http://search.cpan.org/~reatmon/Net-Jabber-1.30/Jabber/Client.pm

Stephen Birch

Posts: 3
Nickname: sgbirch
Registered: Jan, 2005

Re: Spoken Log Posted: Jan 7, 2005 11:02 AM
Reply to this message Reply
Interesting. Is there a good Open Source voice sythesis package in the world yet, preferable on GNU/Linux.

Steve

Flat View: This topic has 2 replies on 1 page
Topic: Threaded RSS feeds Previous Topic   Next Topic Topic: No More YACC and LEX

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use