CLUG wiki

CLUG resources

edit SideBar

Spinach

What's behind Spinach?

Spinach used to be a Knab. Now he's an Ibid.

Spinach Responses

Spinach only responds to queries that are directly addressed to him, either as a private message, or prefixed by one of the names he answers to (currently "Spinach", "bot" and, of course, "spinasie").

If Spinach does not understand your query, he will reply with something along the lines of "Excuse me?" or "Sorry..." or "*blink*", and so on. Otherwise, he will process your query according to whichever bot module matches what you have asked.

Modules

There is a variety of response modules plugged into Spinach's backend, each one providing a different service. To see which modules he currently uses, use the "lsmod" command:

 <Linus> Spinach: lsmod
 <Spinach> Linus: Module list: Strip Auth Hate Ignore Irc Modules Perl Rehash BashOrg ITime Fortune ...

The reply will probably be a lot longer, depending on how many modules he has plugged in.

To find out more about a particular module, use the "modinfo" command:

 <Linus> Spinach: modinfo Fortune
 <Spinach> Linus: Fortune: Return a fortune cookie. Usage: "fortune".

Remember that module names are case-sensitive!

Now that we know how this module works, we can try it out:

 <Linus> Spinach: fortune
 <Spinach> Linus: "I don't think so," said Rene Descartes.  Just then, he vanished.

Factoids

Some of the most commonly used modules are the "Factoid" family of modules. These can be used to teach Spinach to respond to pretty much anything. By way of explanation, here is an example:

 <Linus> Spinach: CLUG is the Cape Linux User Group
 <Spinach> Linus: sure thing
 <Linus> Spinach: what is CLUG?
 <Spinach> CLUG is the Cape Linux User Group

You can teach him more than one response:

 <Linus> Spinach: CLUG is also the word "gulch" backwards, only without the 'h'
 <Spinach> Linus: sure thing

He will now choose one of the responses randomly each time he is asked about "CLUG".

Another point to note is that you don't only have to use the verb "is". You can teach him that your dog has no nose, and that today was the happiest day of your life.

Finding factoids

Sometimes you teach Spinach something, but then can't remember what to ask him to get the answer back. In this case, you can use "search" and "scan" to find the factoids.

For example, if I know I taught him something about my dog, but I'm not sure whether it was under "Linus's dog" or "Linus.dog" or "Linus' dog" or "the dog of Linus", I can just search for "dog":

 <Linus> Spinach: search for dog
 <Spinach> Linus: Found: ('is') my dog has no nose [1]; moondog [1]; good dog [2]; dog-fu [1]; 
           updog [1];  (showing 5 of 7 results)

Well, the answer wasn't in there, but you will notice that he only gave 5 results, but there were 7 available. You can increase the number searched for like this:

 <Linus> Spinach: search for 10 dog
 <Spinach> Linus: Found: ('is') my dog has no nose [1]; moondog [1]; good dog [2]; dog-fu [1];
           updog [1]; Linus's dog [1]; maddog [1] (showing 7 of 7 results)

And there it is. You can now ask him about "Linus's dog" to your heart's content.

Another problem you might have is that you taught him something about the Apache web server, but can't remember what the key was - you just know that it was something about Apache. This is what "scan" is for. The "scan" function looks in the responses to the factoids, instead of in the queries:

 <Linus> Spinach: scan for apache
 <Spinach> Linus: Found: ('is') twisted vs. apache [1]; htpasswd [1]; apache [1]; vhost [2]; 
           adti [1]; (showing 5 of 5 results)

Ah, there it is! It was the URL for the documentation on Apache Virtual Hosts:

 <Linus> Spinach: vhost
 <Spinach> Linus: vhost is http://httpd.apache.org/docs/vhosts/

Modifying factoids

I will skim over this briefly, but if you want to change a typo in a factoid, you can do it as follows:

 <Linus> Spinach: ubuntu is Mark Shuttleworth's new Debian based dsitribution
 <Spinach> Linus: okay

As you can see, I spelled "distribution" wrongly.

 <Linus> Spinach: ubuntu =~ s/dsit/dist/
 <Spinach> Linus: sure thing

I told him to search for "dsit" and replace it with "dist". Now:

 <Linus> Spinach: ubuntu
 <Spinach> ubuntu is Mark Shuttleworth's new Debian based distribution

You can add to the end of a factoid like this:

 <Linus> Spinach: ubuntu += , the latest release is called Gutsy
 <Spinach> Linus: lekker

See the result:

 <Linus> Spinach: ubuntu
 <Spinach> ubuntu is Mark Shuttleworth's new Debian based distribution, the latest release is called Gutsy

Useful Modules

In this section, I will give some brief guidelines on using some of the more useful modules that Spinach has plugged in:

Currency converter

This can be used to find out how much one currency gives in another one:

 <Linus> Spinach: exchange 30 USD to ZAR
 <Spinach> Linus: 30.00 (United States Dollar (USD)) makes 186.763 (South Africa Rand (ZAR))

If you're not sure what the three-letter code is for a currency, you can ask Spinach about it:

 <Linus> Spinach: currencies for slovakia
 <Spinach> Slovakia uses Koruna (SKK)

Note that you can also use TLD (Top Layer Domain's) instead of currencies (e.g. ".za" for South Africa, ".jp" for Japan).

Google

You can find top google matches by asking Spinach to google for something:

 <Linus> Spinach: google for litigious bastards
 <Spinach> Linus: Google found 'The SCO Group, Inc. | The Power of UNIX', at 
           http://www.sco.com/

Also fun is to ask Spinach to compare Google matches:

 <Linus> Spinach: googlecmp Cape Town and Johannesburg
 <Spinach> Linus: 'Cape+Town' wins with 4,950,000 matches, 'Johannesburg' 
           had 2,980,000 matches.

But we knew that anyway.

the Babel Fish

Spinach can try to use the Babel Fish to translate things for you:

 <Linus> Spinach: translate from french mon dieu, nous sommes dans ennui
 <Spinach> Linus: The 'fish gave: my god, we are in trouble

Base Conversions and Maths

Spinach can convert between different numerical bases, and do some Maths for you:

 <Linus> Spinach: convert 31337 from dec to hex
 <Spinach> Linus: 31337 (dec) in hex is:  7a69
 <Linus> Spinach: 10 + 5
 <Spinach> Linus: 15
 <Linus> Spinach: half of four
 <Spinach> Linus: 2

 <Linus> Spinach: units yards miles
 <Spinach> Linus: 'miles' = 'yards' * 0.00056818182, 'yards' = 'miles' *
           1760

Life Guidance

Spinach can make those all-important decisions for you:

 <Linus> Spinach: choose tea or coffee
 <Spinach> I choose coffee, Linus

 <Linus> Spinach: divine will it keep me up all night?
 * Spinach shakes the psychic black magic 8 ball...
 <Spinach> It says 'Very Doubtful', Linus

Don't forget to thank him!

 <Linus> Spinach: botsnack!
 <Spinach> thanks, Linus :)

Dictionary

Spinach has a wealth of knowledge at his disposal in the form of various dictionaries.

You can ask him for help with spelling a word:

 <Linus> Spinach: spell embarass
 <Spinach> Linus: embarass doesn't seem right. Other close words are embarrass

Or for a definition:

 <Linus> Spinach: define aboulia
 <Spinach> Linus: aboulia n : a loss of will power [syn: {abulia}]

For a list of the dictionaries he uses for this information, ask as follows:

 <Linus> Spinach: dictionaries
 <Spinach> Linus: Dictionaries I have: wn, devils, gazetteer, vera, easton, 
           world95, web1913, hitchcock, elements, jargon or foldoc
 <Linus> Spinach: dictionary vera
 <Spinach> Linus: vera: Virtual Entity of Relevant Acronyms (Version 1.9, 
           June 2002)
 <Linus> Spinach: dictionary jargon
 <Spinach> Linus: jargon: Jargon File (4.3.1, 29 Jun 2001)

Obviously, different dictionaries will have different definitions for certain words. In order to get a definition from a specific dictionary, use the following syntax:

 <Linus> Spinach: define bit using jargon
 <Spinach> Linus: bit n. [from the mainstream meaning and `Binary digIT'] 
                1. [techspeak] The unit of information; the amount of 
                information obtained by asking a yes-or-no question for which 
                the two outcomes are equally probable. 2. [techspeak] A 
                computational quantity that can take on one of two values, such
                as true and false or 0 and 1. 3. A mental flag: a reminder that
                something should be done eventually. "I have a bit set for 
                you." (I haven't seen you for a whi
 <Linus> Spinach: define bit using web1913
 <Spinach> Linus: Bit \Bit\, n. In the British West Indies, a fourpenny 
                piece, or groat. Bit \Bit\, 3d sing. pr. of {Bid}, for biddeth.
                [Obs.] --Chaucer. Bit \Bit\, n. [OE. bitt, bite, AS. bite, 
                bite, fr. b[=i]tan to bite. See {Bite}, n. & v., and cf. {Bit} 
                a morsel.] 1. The part of a bridle, usually of iron, which is 
                inserted in the mouth of a horse, and having appendages to 
                which the reins are fastened. --Shak.  The foamy bridle with 
                the bit of gold. --Chaucer.

Finally, you can also use different strategies for testing the spelling of a word:

 <Linus> Spinach: strategies
 <Spinach> Linus: Word matching strategies I have: suffix, regexp, exact, 
           soundex, substring, word, lev, prefix or re
 <Linus> Spinach: strategy prefix
 <Spinach> Linus: prefix: Match prefixes

Now to use this strategy:

 <Linus> Spinach: spell pneumon using prefix
 <Spinach> Linus: pneumon doesn't seem right. Other close words are
           pneumonometer, pneumonitic, pneumonitis, pneumonic plague,
           pneumonophora, pneumonectomy, pneumonia, pneumony, pneumonic or
           pneumonoconiosis

Who knew?!

IP Tools

 <Linus> Spinach: nslookup www.bbc.co.uk
 <Spinach> Linus: www.bbc.co.uk is 212.58.240.33
 <Linus> Spinach: geo name for 212.58.240.33
 <Spinach> Linus: 212.58.240.33 is located in United Kingdom
Edit - History - Print - Recent Changes - Search
Page last modified on September 13, 2013, at 10:19 AM