Jonzy's Universal Gopher Hierarchy Excavation And Display
jughead -B [ ?dtv ] dataFile
jughead -S [ ?dtv ] [ -l log ] [ -p port# ] [ -u username ] dataFile
-? prints the usage information and terminates. This is done as soon as this flag is encountered.
-A prints the directory tree created from all directories served from a particular host. This option overrides -a. You may also want to set the -n flag.
-a prints the directory tree created from the total number of directories served from a particular host.
-B builds an index table and a hash table for quick access to the data found in dataFile. As the tables are being built the number of items remaining to process are displayed.
-b creates a data file called dataFile for use with the -B option.
-d is for debugging mode which prints out diagnostic information concerning jughead.
-H prints the hosts and ports accessed from host. This option overrides -h.
-h prints the hosts accessed from host.
-I prints host and port information for all entries. This option overrides -i.
-i prints host and port information for directories only.
-l says to log the search queries to the file log. This option is only valid with the -S option.
-m supresses menu output when not used with the -b, -B, or -S flags, or prints the menus when used with the -b flag. This value is true by default when used with any flags except -b.
-n prints line numbers preceeding each menu item. Useful with the -A flag or to determine quickly where an item was previously displayed.
-O same as -o except traverses the entire tree. This option overrides -o.
-o only prints entries from hosts in hosts2search.
-p tells jughead to use port# as the port number. The default port when not invoked as a search engine with the -S flag is the gopher port 70. The default port when invoked as a search engine is port 3000.
-S runs jughead as a server listening out a port for a string containing words to search on. This includes boolean operators AND, OR, and NOT. If no boolean operator is found between words, the operation to perform is an implied AND. All evaluations are processed left to right. Currently there is no way to search on the words AND, OR, or NOT, nor break the expression into sub expressions. The search engine also supports partial word searches, where the wildcard symbol is *. Currently the wildcard symbol cannot be the the first character in a word to search for, and all characters following the wildcard are ignored. When jughead is running as a search engine, the SIGHUP signal is supported which rereads the database file into memory.
-s allows the use of sending a selector string selStr, by default this is the empty string.
-t prints the time required to either load the index table into memory, build the index table, or process the menu of a given gopher server. The time is printed in the form "h:m:s".
-u sets the process user id to username.
-v prints the version of jughead and terminates. This is done as soon as this flag is encountered.
-X informs jughead to not search any menus which contain selStrNot2search as the selector string. This string can be wildcarded with the asterik. You can have multiples of these just make sure each is preceeded by the -X flag.
-x informs jughead to not search the menus of hostNot2search out port port#. You can have multiples of these just make sure each is preceeded by the -x flag.
host is the the hostname of the machine with the gopher server.
- flag means get the hosts2search from stdin. The hosts2search need to be separated by white space, and when you are finished entering the hosts2search enter EOF, ^D to quit. The hosts2Search can be a domain such as .edu or .gov. Note the preceeding period (.) when using a hosts2search as a domain.
hosts2search is a list of hosts to have their menu structure printed out or searched. If no hosts2search is specifed host will be the only host searched. If you specify any host in hosts2search and want host to be searched also, you must specify host as one of the hosts2search.
host is the initial host running the gopher server to connect with.
dataFile is either the name of the dataFile to create when used with -b, or the name of the dataFile used to build the index and hash table with -B, or the name of dataFile to use when acting as a search engine with -S.
Note: the hHiIo flags make no sense with the bBS flags as far as building the data and index files. They alter the behavior of the information printed to the screen when used with the b flag. The order of the various flags is irrelevant with the exception host and dataFile must be the last argument.
jughead supports the signal SIGHUP for re-reading a new hash table into memory. Thus once you have rebuilt the database simply acquire the process id of jughead via your particular call to ps, and do a kill -HUP (jughead), where (jughead) is the process id of jughead.
jughead supports some special commands, where each special command must be preceeded by a question mark '?', and are listed below:
where what is a standard search string, anything enclosed in square brackets is optional, and all special commands must be preceeded with '?'. ?all what returns all the hits on what, otherwise items are only returned if there are less then 1024 items. ?help [what] Gives you the About.jughead document and any optional hits on what. ?limit=n what returns the first n items on what. ?version [what] returns the version of jughead and any optional hits on what. ?range=start-stop what returns the start to stop range of hits on what. Only 1 special command is supported per query, and if any syntax error is encountered it reported as the title to the About.jughead document. To supports this feature you need to edit JUGHEADHELPDOC in the Makefile to specify where and what gopher server is serving the help document.
jughead gopher.server
2. To get a list of all items stored on server "this.server" but actualy served from "gopher.server" enter:
jughead -O gopher.server this.server
3. To get a list of all items stored on server "this.server" that are stored at the top level of "gopher.server" enter:
jughead -o gopher.server this.server
4. To get a list of all the items, as well as the hostname and port in which the items reside, from all machines in the ".server" domain, whose links are actualy stored on "gopher.server" enter:
jughead -I .server gopher.server
5. To get a list of items in the directory "directory", with a selector string "1/directory" stored and served from "gopher.server", and have the results placed in the file "result.file" enter:
jughead "1/directory" gopher.server > result.file
6. To get a list of all hosts and the appropriate port which is accessed from the server "gopher.server" enter:
jughead -h gopher.server
7. To not traverse any ftp items which contain "ftp: ..." as part of the selector string or the directory "1/Dir" or any items on the gopher server
dont.look.here listening out port 6666 from the server gopher.server enter:
jughead -X "ftp:*"-x dont.look.here 6666 -X "1/Dir" gopher.server
8. To build tables for any server in the ".utah.edu" domain and not traverse items served from m.utah.edu out port 2001, and not traverse any ftp items served from gopher.server, then have jughead run as a server and log all search requests to the file data.log, while determining the time required for each task enter:
jughead -tm -b data -x m.utah.edu 2001 -X "ftp:*" .utah.edu gopher.server
jughead -tB data
jughead -tS -l data.log data
9. To rebuild the data used by jughead, from sample 8, and restart jughead as a search engine do the following:
cd differentDirectory
jughead -tm -b data -x m.utah.edu 2001 -X "ftp:*" .utah.edu gopher.server
jughead -tB data
cd ..
mv differentDirectory/data* ./
ps -aux | grep jughead
kill -HUP jugheadProcessID