{"id":285,"date":"2009-06-14T06:34:58","date_gmt":"2009-06-14T06:34:58","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/index.php\/?p=285"},"modified":"2009-06-14T06:34:58","modified_gmt":"2009-06-14T06:34:58","slug":"making-your-server-talk","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/","title":{"rendered":"Making Your Server Talk"},"content":{"rendered":"<p>Code and config in these examples are tested on a debian box.<\/p>\n<p>What we need:<br \/>\n-A software for speech synthesis<br \/>\nespeak is good for this purpse. quiet configurable and the voice quality is OK.<\/p>\n<p> apt-get install espeak <\/p>\n<p>-A software that can trigger events, when certain log entries appear<br \/>\nswatch is our friend here. it reads logs in realtime and triggers a command if a specific pattern is found.<br \/>\nIn our case it will just trigger espeak to say something.<\/p>\n<p> apt-get install swatch <\/p>\n<p>Now that we have our tools lets make a sample talker&#8230;<br \/>\nWe want our box to report, if new (no-spam) mail arrived.<\/p>\n<p>I&#8217;m using spamassassin to filter my mail.<br \/>\nI get a line similar to<\/p>\n<p>Jul 26 16:34:04 star spamd[13365]: spamd: clean message (-2.4\/0.5) for mailbox:1001 in 1.9 seconds, 7128 bytes.<br \/>\nin \/var\/log\/mail.log<\/p>\n<p>everytime a good messages reaches my inbox.<\/p>\n<p>So create a config file for swatch to look out for lines like that<\/p>\n<p>File: \/etc\/swatch\/ham<\/p>\n<p>watchfor   \/clean message\/<br \/>\nexec &#8220;espeak new_mail &#038;&#8221;<\/p>\n<p>The only thing left to do now is to start the swatch daemon<\/p>\n<p>\/usr\/bin\/swatch &#8211;daemon &#8211;config-file=\/etc\/swatch\/ham &#8211;tail-file=\/var\/log\/mail.log<\/p>\n<p>I think you got the point. The possibilities are endless. Everything that is logged can be spoken.<\/p>\n<p>But there are other interesting possibilities. Lets say you want your box to report new available updates to you.<br \/>\nThis little script can do it when run from a repeating cron-job:<\/p>\n<p>#!\/bin\/bash<br \/>\napt-get update<br \/>\nUPDATELINE=`apt-get &#8211;simulate upgrade | grep remove`<br \/>\nEINS=`echo $UPDATELINE | cut -d &#8221; &#8221; -f 1`<br \/>\nZWEI=`echo $UPDATELINE | cut -d &#8221; &#8221; -f 3`<br \/>\nDREI=`echo $UPDATELINE | cut -d &#8221; &#8221; -f 6`<br \/>\nVIER=`echo $UPDATELINE | cut -d &#8221; &#8221; -f 10`<br \/>\n((UPDATES=EINS+ZWEI+DREI+VIER))<br \/>\nif [ $UPDATES -gt 0 ]; then<br \/>\nespeak &#8220;REPORT: i need $UPDATES updates! please install as soon as possible&#8221;<br \/>\nfi<\/p>\n<p>Now you have got all the tools to make your server an absolutely anoying brabbling box.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Code and config in these examples are tested on a debian box. What we need: -A software for speech synthesis espeak is good for this purpse. quiet configurable and the voice quality is OK. apt-get install espeak -A software that can trigger events, when certain log entries appear swatch is our friend here. it reads&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-285","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Making Your Server Talk - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Making Your Server Talk - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"Code and config in these examples are tested on a debian box. What we need: -A software for speech synthesis espeak is good for this purpse. quiet configurable and the voice quality is OK. apt-get install espeak -A software that can trigger events, when certain log entries appear swatch is our friend here. it reads... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-14T06:34:58+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Making Your Server Talk\",\"datePublished\":\"2009-06-14T06:34:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/\"},\"wordCount\":317,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/\",\"name\":\"Making Your Server Talk - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2009-06-14T06:34:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/making-your-server-talk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Making Your Server Talk\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Making Your Server Talk - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/","og_locale":"en_US","og_type":"article","og_title":"Making Your Server Talk - Linux Shtuff","og_description":"Code and config in these examples are tested on a debian box. What we need: -A software for speech synthesis espeak is good for this purpse. quiet configurable and the voice quality is OK. apt-get install espeak -A software that can trigger events, when certain log entries appear swatch is our friend here. it reads... Read More","og_url":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2009-06-14T06:34:58+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Making Your Server Talk","datePublished":"2009-06-14T06:34:58+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/"},"wordCount":317,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/making-your-server-talk\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/","url":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/","name":"Making Your Server Talk - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2009-06-14T06:34:58+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/making-your-server-talk\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/making-your-server-talk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Making Your Server Talk"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=285"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/285\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}