Know Users (ku)
(Kuhn's Utility)

Please read ku.1 and ku.help.
ku.1 is from knife.1.

ku is a generic know users tool. You can know if your friends
come by watching all hosts specified by you.
Just enter 
/usr/local/bin/ku 
(or /usr/local/bin/wife, a clone to knife)
to use it.

I have no time to write its manual page, and just describe 
its usage briefly.

Usage: ku -[f|m] host-file
          -[w|i] info-file
          -t timeout-period
          -r refresh-period
          -h (show help message)
m,i,t are compatible to "KNIFE". You can watch your friends
in a screen oriented browser system. There are fours levels now.
1. Hosts selection level
2. Host users level
3. Watching user level
4. Watching users specified level 
                    
You can watch users by "host", "user" or a group of "users".
The last kind of watching is like "knife". 
I have write another script "Watch If Friends Exist", wife 
(/usr/local/bin/wife) to do the last function solely
and roughly compatible to knife.                   

All commands are almost stolen from "TIN". 
'q' to quit from last level.
'Q' quit complately regardless of which level.
'r' refresh right now.
'w' enter watching users specified in your information file.
'ctrl-z' suspend
'ctrl-c' quit rudely
'space' next page
'b' back page
'ctrol-L' redraw page
'/' forward search your friends
'?' backward search  your friends
'return' go to next level.


BUGS:
after ctrl-z suspend, never "bg" it, or screen will be a mess.

TOTDO:
add 'h' to show help message
write man page.
add commands such as "talk,finger,mail" for user level.


From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:46 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C875uD.M4x@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@ccsun35.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C87121.KLJ@csie.nctu.edu.tw>
Date: Sun, 6 Jun 1993 11:13:25 GMT

If you met "segmentation fault and core dump" during
runing of ku, maybe I am replaceing a new ku binary.
Just remove your core. But you think it is rather
abnormal and not due to my replacement of it,
please tell me.

I just solve the problem of the low speed of arrow key movement.
And you can use "number" to select any entry as in tin. 
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:46 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C87GAC.2Gw@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@ccsun35.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C875uD.M4x@csie.nctu.edu.tw>
Date: Sun, 6 Jun 1993 14:58:59 GMT

If you want to "watch" as in "knife" from "ku", I
suggest you run "wife", or edit "wife" for your suit.
"wife" is a shell script using "ku".
(and press "w" in wife)

The default refresh time of "ku" is 60 seconds. I
think this period is a little too short and will
render high system load. For heavily loaded system,
I suggest you set into higher value, by
"ku -r 300" ( every 5 minutes )

The host file specified by "-f" or "-m" is the same as
in "knife". ( and "-w" or "-i" also same as in knife)
You must supply "-w" before using the mode for watching
a group of users listed in "-w" or "-i" file.

The searching path for "-f" or "-w" is done by
 1. if the file path contains "/", no path concated.
 2. if the file contains no "/", search ".", "$HOME",
    and then /usr/local/etc/hosts.ALL for -f,
             /usr/local/etc/hosts.watch for -w.


I will follow up here whenever I remember something.
And then can be used for "man ku".
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:46 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C87J9w.4DF@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@news.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C87GAC.2Gw@csie.nctu.edu.tw>
Date: Sun, 6 Jun 1993 16:03:32 GMT

default "time-out" is 1 second. So, if you feel
network is slow, you can set up "time-out" into
a larger value , say "ku -t 5".
(that is, many hosts are in dead state)
This value won't influence the response time in 
hosts selection level, but will influence the
host users selection level.

You can see hosts state, in 
below the field "#Users", 
U: stands for "UP", machine is up and number of users will be shown.
D: stands for "Dead", host is dead or hard to reach.
C: stands for "Clear", host state is unknown. 

TODO:
add "system load, up time", for host information.
configuable value for number of processes forked to query rusers state.
Now, we only fork 4 processes. 
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:46 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C87LAE.5Kx@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@dragon.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C87J9w.4DF@csie.nctu.edu.tw>
Date: Sun, 6 Jun 1993 16:47:01 GMT


TODO:
add "subdomain watching level". You can watch all logins
from a certain domain, such as "DormChu", or "Dorm10".
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:47 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8BHqM.zs@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@dragon.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C87LAE.5Kx@csie.nctu.edu.tw>
Date: Tue, 8 Jun 1993 19:20:45 GMT


New commands:
in hosts group level
'f': to group users by "from" host or domain.
     You can view(watch) all logins from "dorm", "dorm10", "140.113", .....and
     all the other possible "substring" in the "login from" entry.
'n': to group users by substring of "username".
     You can view(watch) all logins with "cp","cp79", "tsai",.....and
     all possible substring of username.
'L': sort hosts by load
'U': sort hosts by number of login users.
'h': show help menu
          
BUGS:
watching mode in not really watching now. You must knock a key
to view the watching effect. ( to improve idle run performance).
It is to be fixed.          
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:47 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8CGKM.CJ0@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@dragon.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C8BHqM.zs@csie.nctu.edu.tw>
Date: Wed, 9 Jun 1993 07:53:10 GMT

I will stop to proceed KU now except bugs report.
New Options:
-N start watching mode by username
-W start .......       by information file supplied
-F .............       by from domain
-H                     by host
-p number of processes forked. 

For example,
1. ku -F dorm    (or f command in ku)
you can watch all logins from "dorm"
2. ku -N cp78    (or n command in ku)
you can watch all logins of cp78
3. ku -W -w .knife_info -f .knife_host   (or w command in ku)
the same as "knife".

enjoy it. bye every csie netter. I have unsubscribe many groups
and I may not see your comments in usenet.
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:47 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8D1v1.Ly4@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@dragon.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C8CGKM.CJ0@csie.nctu.edu.tw>
Date: Wed, 9 Jun 1993 15:33:00 GMT

BUGS fixed for "watching".
Now "ku" can really be used for a "watching" tool and
won't introduce high load.        
Default watching refresh time is 120 seconds and
use -r to override this value. 
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:47 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8EAMy.GDt@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@ccsun35.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C8D1v1.Ly4@csie.nctu.edu.tw>
Date: Thu, 10 Jun 1993 07:40:10 GMT

Further utilities for ku available. just try it.
(talk, ytalk, cytalk,...finger,..)
And default processes forked for ku is only 3 to
reduce system load. (default in rusers is 2)
refresh time is 120 seconds and timout time is 3.
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!guest Tue Jul 20 15:04:47 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!guest
From: guest@csie.nctu.edu.tw (guest)
Subject: Re: New release of KU again: know users
Message-ID: <C8Gr3G.DpM@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: guest@wizard.csie.nctu.edu.tw
Reply-To: guest@wizard.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C8EAMy.GDt@csie.nctu.edu.tw>
Date: Fri, 11 Jun 1993 15:30:51 GMT

BUG fixed:
can resize when window size changed.

Features added:
1. group by login tty: 
   for example, to watch all logins from console:
   enter 't' and 'console'.
2. view by "load",
   enter 'l' and 'u' to go back.   

Useful watch command, say to watch all logins from "DormChu",
enter
'f', 'dormchu'.

to watch all logins of u8017...., enter
'n', 'u8017'



From news.csie.nctu.edu.tw!guest Tue Jul 20 15:04:47 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!guest
From: guest@csie.nctu.edu.tw (guest)
Subject: Re: New release of KU again: know users
Message-ID: <C8Iv52.5sv@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: guest@wizard.csie.nctu.edu.tw
Reply-To: guest@wizard.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
References: <C8Gr3G.DpM@csie.nctu.edu.tw>
Date: Sat, 12 Jun 1993 18:53:26 GMT

More verbose user information added,
useful refreshing process shown,...
.....
Last Update of KU: 13 June 1:30  in /usr/local/bin/ku.exe
By guest@wizard.csie.nctu.edu.tw.
Anyone can write ku.1 ? 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:47 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8p09x.MCq@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@dragon.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.2 PL0]
References: <C8Gr3G.DpM@csie.nctu.edu.tw> <C8Iv52.5sv@csie.nctu.edu.tw>
Date: Wed, 16 Jun 1993 02:29:57 GMT

Last Update: 15 June 9:50, 1993
New Features added: * F/N/T wildcard grouping of usrs by from/user/tty
	            * unlimited number of hosts, entries grouped
	            * You can obtain part of finger information 
	              of uses in school CC.
Command changed: change N into H in hosts selection level
Example usage: 
/usr/local/bin/wife

1. "rusers -lu"
command: 'N*'

2. "rusers -i"
command: 'N*I'

3. "rup"
command: 'l'

4. "knife"
command: 'w'

5. "who"
command: '/[hostname][CR]'
where [hostname] is the name of host interested
      [CR} is return 
      
6. part of "finger" if user login now.
command: 'n[username][CR][CR]'
      
7. Watching..., 
   1. Hosts level watching (command: 'm')
      for user information (command: 'mu')
      for host load information (command: 'ml')
   2. Host users level watching (command: '/[hostname][CR]')
   3. All logins of a user watching     (command: '/n[username][CR]') 
   4. Users specified in a file watching (command: 'w')
   5. From domain (wildcard,substring) watching (command: 'F' or 'f')
   6. Users (wildcard,substring) watching (command: 'U' or 'u')
   7. Login TTY (wildcard,substring) watching (command: 'T' or 't')
   
   Viewing for hosts level:
   1. sorted by load (command: 'L')
   2. sorted by number of logins (command: 'U')
   3. sorted by hostname (command: 'H')
   4. no sort (command: 'O')
   
   Viewing for other levels:
   1. sorted by username (command: 'N')
   2. sorted by idle time (command: 'I')
   3. no sort (command: 'O') 
   
TODO:
  run command file: say $HOME/.kurc
                    your information, name, address, phone, birthday
                    watching attributes projection
                    watching server communcation
                    
Request for Commant:
Don't you think KU is just a kind of garbage?                    
If not, 
is it good enough for users not in CSIE ? say announce for NCTU users.

--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:48 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8p174.MuA@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@dragon.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.2 PL0]
References: <C8Gr3G.DpM@csie.nctu.edu.tw> <C8Iv52.5sv@csie.nctu.edu.tw> <C8p09x.MCq@csie.nctu.edu.tw>
Date: Wed, 16 Jun 1993 02:49:52 GMT

TODO:
If you watch a gentleman/lady too long, KU will send
a mail to the "watchee" saying a watcher has been watching
you for "N" minutes.......
How large of N ? could you suggest it ?
........
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:48 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8quGn.1wL@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@ccsun35.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.2 PL0]
References: <C8Gr3G.DpM@csie.nctu.edu.tw> <C8Iv52.5sv@csie.nctu.edu.tw> <C8p09x.MCq@csie.nctu.edu.tw> <C8p174.MuA@csie.nctu.edu.tw>
Date: Thu, 17 Jun 1993 02:19:34 GMT

The searching process is shown as xx/100. The first 50/100 is doing
"seaching users" and the remaining 50/100 is doing "searching host"
information. If you want to search users only, after the prompt
has been over 50/100, most users have been scanned. (except
some hard to reach hosts). 
Querying "host" information is slower than querying "user" information.
Since the latter needs only to open /etc/utmp, but the former must
open /dev/kmem and read kernel data. (and through rpc).
(and so, if you want to view "rup" information, you must wait for
 the prompt has been over 50/100)

It is my future work to add options for users who want to query
user information only. 
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:04:48 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: Re: New release of KU again: know users
Message-ID: <C8qv8J.25B@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@ccsun35.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.2 PL0]
References: <C8Gr3G.DpM@csie.nctu.edu.tw> <C8Iv52.5sv@csie.nctu.edu.tw> <C8p09x.MCq@csie.nctu.edu.tw> <C8p174.MuA@csie.nctu.edu.tw> <C8quGn.1wL@csie.nctu.edu.tw>
Date: Thu, 17 Jun 1993 02:36:19 GMT

If you can't see simple finger information for users in school
CC from KU, it may be due to my "spy" fingerd killed by
CC staff or, my friend's account has been expired.
If you have account in school's CC, and find KU failed
to display finger information for CC's users, try
ftp the file in
ccsun35:/home/inn/src/reader-nov/ku/myfinger/ccfinger
to ccsun10.cc.nctu.edu.tw
and run it there.
If you obtain "permission denied", it doesn't matter
becuase there have been one ccfinger running there.

Why I write this note there ? becuase I won't try
to maintain this server any more and my friend will
graduate. His account in CC will be expired. 

And you will seldom see me in the net after these days.
--
Shih-Kun Huang			|  Huang2 Shih4-Kun1
skhuang@csie.nctu.edu.tw	| 

From news.csie.nctu.edu.tw!skhuang Tue Jul 20 15:05:02 1993
Newsgroups: csie.unix
Path: news.csie.nctu.edu.tw!skhuang
From: skhuang@csie.nctu.edu.tw (Shih-Kun Huang)
Subject: suggestions of using KU (for KNIFE fans)
Message-ID: <C8KEC0.37n@csie.nctu.edu.tw>
Sender: usenet@csie.nctu.edu.tw
Nntp-Posting-Host: skhuang@ccsun35.csie.nctu.edu.tw
Organization: Computer Sci. & Information Eng., Chiao-Tung U, Taiwan, ROC
X-Newsreader: TIN [version 1.1 PL6]
Date: Sun, 13 Jun 1993 14:45:36 GMT

1. For KNIFE fans:

If you just want to search friends quickly in a lightly
loaded machine, you can use

/usr/local/bin/wife -W -p 8
( please don't use this way for watching) 

For heavily loaded machine, please use
/usr/local/bin/wife -W -p 1

2. For ordinary "rusers", 
just enter "/usr/local/bin/rusers" without any options.

/usr/local/bin/rusers with options will run /usr/ucb/rusers.

3. For complicated "KU", you may try 
   1. /usr/local/bin/ku -h
   2. /usr/local/bin/ku  and enter "h" in the program.
   
I will write man of KU in this summer vacation.