[TUHS] Remember the ed thread?

Michael Usher musher at ucsc.edu
Tue Mar 30 06:50:55 AEST 2021


I think you can only truly appreciate ed when you were forced to use a DECwriter as your terminal because all the VT100s were in use.  (Undergrad student lab)


—
Michael Usher
Network Operations Manager
University of California, Santa Cruz
musher at ucsc.edu        831-459-3697

> On Mar 29, 2021, at 12:50 PM, Rob Pike <robpike at gmail.com> wrote:
> 
> Ed is the standard editor.
> 
> -rob
> 
> 
> On Tue, Mar 30, 2021 at 1:36 AM Larry McVoy <lm at mcvoy.com <mailto:lm at mcvoy.com>> wrote:
> I had *.clients.your-server.de <http://clients.your-server.de/> crawling mcvoy.com <http://mcvoy.com/> in violation of my
> robots.txt.  For whatever reason, the tty settings (or something) 
> made vi not work, I dunno what the deal is, stty -tabs didn't help.
> 
> So I had to resort to ed to write and debug the little program below.
> It was surprisingly pleasant, it's probably the first time I've used ed
> for anything real in at least a decade.  My fingers still know it.
> 
> +1 for ed.  It's how many decades old and still useful?
> 
> 
> #!/usr/libexec/bitkeeper/bk tclsh
> 
> int
> main(void)
> {
>         FILE    log = popen("/var/log/apache2/dns.l", "r");
>         string  buf, ip;
>         string  dropped{string};
> 
>         fconfigure(log, buffering: "line");
>         while (buf = <log>) {
>                 unless (buf =~ /([^ ]+\.your-server\.de\.) /) continue;
>                 ip = $1; 
>                 if (defined(dropped{ip})) continue;
>                 dropped{ip} = "yes";
>                 warn("DROP ${ip}\n");
>                 system("/sbin/iptables -I INPUT -s ${ip} -j DROP");
>         }
> }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20210329/128ce555/attachment.htm>


More information about the TUHS mailing list