OK, turing.

<- leave blank

Tue Apr 20 16:19:53 EDT 2021

call plug#begin()
Plug 'preservim/nerdtree'
Plug 'tpope/vim-eunuch'
Plug 'ryanoasis/vim-devicons'
Plug 'kaicataldo/material.vim', { 'branch': 'main' }
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-commentary'
Plug 'mattn/emmet-vim'
Plug 'Yggdroot/indentLine'
Plug 'mattn/emmet-vim'
Plug 'AndrewRadev/tagalong.vim'
Plug 'dense-analysis/ale'
Plug 'junegunn/goyo.vim'
Plug 'vimwiki/vimwiki'
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for':
['markdown', 'vim-plug']}
if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif
call plug#end()

Tue Apr 20 14:13:12 EDT 2021
# HG changeset patch
# User Humm <hummsmith42@gmail.com>
plumber: fix substrings in match rules

Unmatched substrings are nil, so we can't rely on nil terminating the
array of substrings.

diff -r 5346858b7aef sys/src/cmd/plumb/match.c
--- a/sys/src/cmd/plumb/match.c Tue Apr 13 13:28:31 2021 +0200
+++ b/sys/src/cmd/plumb/match.c Tue Apr 20 20:11:01 2021 +0200
@@ -36,12 +36,13 @@
		free(match[i]);
		match[i] = nil;
	}
- for(i=0; i<10 && rs[i].sp!=nil; i++){
- n = rs[i].ep-rs[i].sp;
- match[i] = emalloc(n+1);
- memmove(match[i], rs[i].sp, n);
- match[i][n] = '\0';
- }
+ for(i=0; i<10; i++)
+ if(rs[i].sp!=nil){
+ n = rs[i].ep-rs[i].sp;
+ match[i] = emalloc(n+1);
+ memmove(match[i], rs[i].sp, n);
+ match[i][n] = '\0';
+ }
 }

 int


Tue Apr 20 09:37:16 EDT 2021
?

Tue Apr 20 05:05:33 EDT 2021
char *
fmthtml(char *msg)
{
	int wr[2], rd[2], n;
	char buf[2048];


	if(pipe(wr) == -1 || pipe(rd) == -1)
		sysfatal("pipe: %r");
	switch(fork()){
	case -1:
		sysfatal("fork: %r");
		break;
	case 0:
		close(wr[0]);
		close(rd[1]);
		dup(wr[1], 0);
		dup(rd[0], 1);
		execl("/bin/htmlfmt", "htmlfmt -a", nil);
		sysfatal("exec: %r");
		break;
	default:
		close(wr[1]);
		close(rd[0]);
		write(wr[0], msg, strlen(msg));
		close(wr[0]);
		n = readn(rd[1], buf, sizeof(buf));
		close(rd[1]);
		if(n == -1)
			sysfatal("read: %r\n");
		buf[n] = 0;
		return buf;
	}
	return buf;
}

Mon Apr 19 22:10:19 EDT 2021
Corder, the Red Eagles’ assistant ops officer, must have known most, if not all,
of this as a result of HAVE PAD and BOXER when he volunteered to be the first Red
Eagle at Tonopah to fly the MiG-23.  McCloud followed suit and became the second
to checkout in the Flogger, Scott recalls.  “It was a new experience and we didn’t
know too much about the jet; it didn’t come with the knowledge that the other
countries operating it around the world took for granted,” he added.  As they
learned each day, Corder got to work writing the Flogger’s Dash 1.

Mon Apr 19 22:02:13 EDT 2021
To: 9front@9front.org
From: Julien Blanchard <julien@typed-hole.org>
Date: Fri, 16 Apr 2021 15:19:33 +0200
Subject: [9front] [patch] rc-httpd: opt-out of of Google's FLoC Network by default
Reply-To: 9front@9front.org

Hello,

Since this FLoC thing from Google
(https://www.eff.org/deeplinks/2021/03/googles-floc-terrible-idea) is
opt-out only maybe it's nice if rc-httpd does it by default.

diff -r eafb71d27315 rc/bin/rc-httpd/rc-httpd
--- a/rc/bin/rc-httpd/rc-httpd    Wed Apr 14 20:30:24 2021 -0700
+++ b/rc/bin/rc-httpd/rc-httpd    Fri Apr 16 13:13:06 2021 +0000
@@ -3,7 +3,7 @@
  path=(/bin $rc_httpd_dir/handlers)
  cgi_path=/bin
  SERVER_PORT=80 # default for CGI scripts, may be overridden by the
Host header
-extra_headers='Server: rc-httpd'
+extra_headers=('Server: rc-httpd', 'Permissions-Policy:
interest-cohort=()')
  cr=

  fn do_log{





Mon Apr 19 18:48:18 EDT 2021
diff -r cc8420fa5fce sys/src/cmd/file.c
--- a/sys/src/cmd/file.c Fri Apr 09 16:48:07 2021 +0200
+++ b/sys/src/cmd/file.c Tue Apr 20 01:47:43 2021 +0300
@@ -169,6 +169,7 @@
 int isface(void);
 int isexec(void);
 int isudiff(void);
+int isexecscript(void);
 int p9bitnum(char*, int*);
 int p9subfont(uchar*);
 void print_utf(void);
@@ -182,6 +183,7 @@
	istring, /* recognizable by first string */
	iself, /* ELF (foreign) executable */
	isexec, /* native executables */
+ isexecscript, /* executable scripts */
	iff, /* interchange file format (strings) */
	longoff, /* recognizable by 4 bytes at some offset */
	isoffstr, /* recognizable by string at some offset */
@@ -198,7 +200,7 @@
	isp9bit, /* plan 9 image (as from /dev/window) */
	isrtf, /* rich text format */
	ismsdos, /* msdos exe (virus file attachement) */
- isicocur, /* windows icon or cursor file */
+ isicocur, /* windows icon or cursor file */
	isface, /* ascii face file */
	istga,
	ismp4,
@@ -722,6 +724,40 @@
	return 0;
 }

+/* executable scripts */
+int
+isexecscript(void)
+{
+ char a[64], *p;
+
+ if (memcmp("#!", buf, 2) != 0)
+ return 0;
+ memmove(a, buf+2, sizeof a);
+ if ((p = strchr(a, '\n')) != nil)
+ *p = 0;
+ if ((p = strpbrk(a, " \t")) != nil)
+ *p = 0;
+ if ((p = strrchr(a, '/')) != nil)
+ p++;
+ else
+ p = a;
+
+ if (strcmp("rc", p) == 0)
+ print("%s\n", mime ? PLAIN : "rc script");
+ else if (strcmp("sh", p) == 0)
+ print("%s\n", mime ? "application/x-sh" : "sh script");
+ else if (strcmp("bash", p) == 0)
+ print("%s\n", mime ? "application/x-sh" : "bash script");
+ else if (strcmp("awk", p) == 0)
+ print("%s\n", mime ? PLAIN : "awk script");
+ else if (strcmp("sed", p) == 0)
+ print("%s\n", mime ? PLAIN : "sed script");
+ else if (strcmp("perl", p) == 0)
+ print("%s\n", mime ? PLAIN : "perl script");
+ else
+ print("%s\n", mime ? PLAIN : "executable script");
+ return 1;
+}

 /* from tar.c */
 enum { NAMSIZ = 100, TBLOCK = 512 };
@@ -805,8 +841,6 @@
	"!<arch>\n__.SYMDEF", "archive random library", 16, OCTET,
	"!<arch>\n", "archive", 8, OCTET,
	"070707", "cpio archive - ascii header", 6, OCTET,
- "#!/bin/rc", "rc executable file", 9, PLAIN,
- "#!/bin/sh", "sh executable file", 9, PLAIN,
	"%!", "postscript", 2, "application/postscript",
	"\004%!", "postscript", 3, "application/postscript",
	"x T post", "troff output for post", 8, "application/troff",
@@ -820,10 +854,10 @@
	"%PDF", "PDF", 4, "application/pdf",
	"<!DOCTYPE", "HTML file", 9, "text/html",
	"<!doctype", "HTML file", 9, "text/html",
- "<!--", "HTML file", 4, "text/html",
+ "<!--", "XML file", 4, "text/xml",
	"<html>", "HTML file", 6, "text/html",
	"<HTML>", "HTML file", 6, "text/html",
- "<?xml", "HTML file", 5, "text/html",
+ "<?xml", "XML file", 5, "text/xml",
	"\111\111\052\000", "tiff", 4, "image/tiff",
	"\115\115\000\052", "tiff", 4, "image/tiff",
	"\377\330\377\340", "jpeg", 4, "image/jpeg",
@@ -1108,7 +1142,7 @@
		return 0;
	*q = 0;
	if(strncmp(p, "From ", 5) == 0 && strstr(p, " remote from ") == nil){
- print("%s\n", mime ? PLAIN : "mail box");
+ print("%s\n", mime ? "application/mbox" : "mail box");
		return 1;
	}
	*q = '\n';

Mon Apr 19 18:40:58 EDT 2021
diff -r cc8420fa5fce sys/src/cmd/file.c
--- a/sys/src/cmd/file.c Fri Apr 09 16:48:07 2021 +0200
+++ b/sys/src/cmd/file.c Tue Apr 20 01:40:33 2021 +0300
@@ -169,6 +169,7 @@
 int isface(void);
 int isexec(void);
 int isudiff(void);
+int isexecscript(void);
 int p9bitnum(char*, int*);
 int p9subfont(uchar*);
 void print_utf(void);
@@ -182,6 +183,7 @@
	istring, /* recognizable by first string */
	iself, /* ELF (foreign) executable */
	isexec, /* native executables */
+ isexecscript, /* executable scripts */
	iff, /* interchange file format (strings) */
	longoff, /* recognizable by 4 bytes at some offset */
	isoffstr, /* recognizable by string at some offset */
@@ -198,7 +200,7 @@
	isp9bit, /* plan 9 image (as from /dev/window) */
	isrtf, /* rich text format */
	ismsdos, /* msdos exe (virus file attachement) */
- isicocur, /* windows icon or cursor file */
+ isicocur, /* windows icon or cursor file */
	isface, /* ascii face file */
	istga,
	ismp4,
@@ -722,6 +724,40 @@
	return 0;
 }

+/* executable scripts */
+int
+isexecscript(void)
+{
+ char a[64], *p;
+
+ if (memcmp("#!", buf, 2) != 0)
+ return 0;
+ memmove(a, buf+2, sizeof a);
+ if ((p = strchr(a, '\n')) != nil)
+ *p = 0;
+ if ((p = strpbrk(a, " \t")) != nil)
+ *p = 0;
+ if ((p = strrchr(a, '/')) != nil)
+ p++;
+ else
+ p = a;
+
+ if (strcmp("rc", p) == 0)
+ print("%s\n", mime ? PLAIN : "rc executable file");
+ else if (strcmp("sh", p) == 0)
+ print("%s\n", mime ? "application/x-sh" : "sh executable file");
+ else if (strcmp("bash", p) == 0)
+ print("%s\n", mime ? "application/x-sh" : "bash executable file");
+ else if (strcmp("awk", p) == 0)
+ print("%s\n", mime ? PLAIN : "awk script");
+ else if (strcmp("sed", p) == 0)
+ print("%s\n", mime ? PLAIN : "sed script");
+ else if (strcmp("perl", p) == 0)
+ print("%s\n", mime ? PLAIN : "perl script");
+ else
+ print("%s\n", mime ? PLAIN : "interpeted executable file");
+ return 1;
+}

 /* from tar.c */
 enum { NAMSIZ = 100, TBLOCK = 512 };
@@ -805,8 +841,6 @@
	"!<arch>\n__.SYMDEF", "archive random library", 16, OCTET,
	"!<arch>\n", "archive", 8, OCTET,
	"070707", "cpio archive - ascii header", 6, OCTET,
- "#!/bin/rc", "rc executable file", 9, PLAIN,
- "#!/bin/sh", "sh executable file", 9, PLAIN,
	"%!", "postscript", 2, "application/postscript",
	"\004%!", "postscript", 3, "application/postscript",
	"x T post", "troff output for post", 8, "application/troff",
@@ -820,10 +854,8 @@
	"%PDF", "PDF", 4, "application/pdf",
	"<!DOCTYPE", "HTML file", 9, "text/html",
	"<!doctype", "HTML file", 9, "text/html",
- "<!--", "HTML file", 4, "text/html",
	"<html>", "HTML file", 6, "text/html",
	"<HTML>", "HTML file", 6, "text/html",
- "<?xml", "HTML file", 5, "text/html",
	"\111\111\052\000", "tiff", 4, "image/tiff",
	"\115\115\000\052", "tiff", 4, "image/tiff",
	"\377\330\377\340", "jpeg", 4, "image/jpeg",
@@ -1108,7 +1140,7 @@
		return 0;
	*q = 0;
	if(strncmp(p, "From ", 5) == 0 && strstr(p, " remote from ") == nil){
- print("%s\n", mime ? PLAIN : "mail box");
+ print("%s\n", mime ? "application/mbox" : "mail box");
		return 1;
	}
	*q = '\n';

Mon Apr 19 18:36:31 EDT 2021
diff -r cc8420fa5fce sys/src/cmd/file.c
--- a/sys/src/cmd/file.c Fri Apr 09 16:48:07 2021 +0200
+++ b/sys/src/cmd/file.c Tue Apr 20 01:35:47 2021 +0300
@@ -169,6 +169,7 @@
 int isface(void);
 int isexec(void);
 int isudiff(void);
+int isintrexec(void);
 int p9bitnum(char*, int*);
 int p9subfont(uchar*);
 void print_utf(void);
@@ -182,6 +183,7 @@
	istring, /* recognizable by first string */
	iself, /* ELF (foreign) executable */
	isexec, /* native executables */
+ isintrexec, /* interpeted executables */
	iff, /* interchange file format (strings) */
	longoff, /* recognizable by 4 bytes at some offset */
	isoffstr, /* recognizable by string at some offset */
@@ -198,7 +200,7 @@
	isp9bit, /* plan 9 image (as from /dev/window) */
	isrtf, /* rich text format */
	ismsdos, /* msdos exe (virus file attachement) */
- isicocur, /* windows icon or cursor file */
+ isicocur, /* windows icon or cursor file */
	isface, /* ascii face file */
	istga,
	ismp4,
@@ -722,6 +724,40 @@
	return 0;
 }

+/* interpeted executables */
+int
+isintrexec(void)
+{
+ char a[64], *p;
+
+ if (memcmp("#!", buf, 2) != 0)
+ return 0;
+ memmove(a, buf+2, sizeof a);
+ if ((p = strchr(a, '\n')) != nil)
+ *p = 0;
+ if ((p = strpbrk(a, " \t")) != nil)
+ *p = 0;
+ if ((p = strrchr(a, '/')) != nil)
+ p++;
+ else
+ p = a;
+
+ if (strcmp("rc", p) == 0)
+ print("%s\n", mime ? PLAIN : "rc executable file");
+ else if (strcmp("sh", p) == 0)
+ print("%s\n", mime ? "application/x-sh" : "sh executable file");
+ else if (strcmp("bash", p) == 0)
+ print("%s\n", mime ? "application/x-sh" : "bash executable file");
+ else if (strcmp("awk", p) == 0)
+ print("%s\n", mime ? PLAIN : "awk script");
+ else if (strcmp("sed", p) == 0)
+ print("%s\n", mime ? PLAIN : "sed script");
+ else if (strcmp("perl", p) == 0)
+ print("%s\n", mime ? PLAIN : "perl script");
+ else
+ print("%s\n", mime ? PLAIN : "interpeted executable file");
+ return 1;
+}

 /* from tar.c */
 enum { NAMSIZ = 100, TBLOCK = 512 };
@@ -805,8 +841,6 @@
	"!<arch>\n__.SYMDEF", "archive random library", 16, OCTET,
	"!<arch>\n", "archive", 8, OCTET,
	"070707", "cpio archive - ascii header", 6, OCTET,
- "#!/bin/rc", "rc executable file", 9, PLAIN,
- "#!/bin/sh", "sh executable file", 9, PLAIN,
	"%!", "postscript", 2, "application/postscript",
	"\004%!", "postscript", 3, "application/postscript",
	"x T post", "troff output for post", 8, "application/troff",
@@ -820,10 +854,8 @@
	"%PDF", "PDF", 4, "application/pdf",
	"<!DOCTYPE", "HTML file", 9, "text/html",
	"<!doctype", "HTML file", 9, "text/html",
- "<!--", "HTML file", 4, "text/html",
	"<html>", "HTML file", 6, "text/html",
	"<HTML>", "HTML file", 6, "text/html",
- "<?xml", "HTML file", 5, "text/html",
	"\111\111\052\000", "tiff", 4, "image/tiff",
	"\115\115\000\052", "tiff", 4, "image/tiff",
	"\377\330\377\340", "jpeg", 4, "image/jpeg",
@@ -1108,7 +1140,7 @@
		return 0;
	*q = 0;
	if(strncmp(p, "From ", 5) == 0 && strstr(p, " remote from ") == nil){
- print("%s\n", mime ? PLAIN : "mail box");
+ print("%s\n", mime ? "application/mbox" : "mail box");
		return 1;
	}
	*q = '\n';

Mon Apr 19 17:04:01 EDT 2021
int
isintrexec(void)
{
	char a[64], *b[2], *p;
	int n;

	if (memcmp("#!", buf, 2) != 0)
		return 0;
	memmove(a, buf+2, sizeof a);
	if ((p = strchr(a, '\n')) != nil)
		*p = 0;
	p = strrchr(a, '/');
	if (p == nil)
		p = a;
	else
		p++;
	n = getfields(p, b, 2, 1, " \t");
	if (n == 2 && strcmp(b[0], "env") == 0)
		p = b[1];
	else
		p = b[0];
	if (strcmp("rc", p) == 0)
		print("%s\n", mime ? PLAIN : "rc executable file");
	else if (strcmp("sh", p) == 0)
		print("%s\n", mime ? "application/x-sh" : "sh executable file");
	else if (strcmp("bash", p) == 0)
		print("%s\n", mime ? "application/x-sh" : "bash executable file");
	else if (strcmp("awk", p) == 0)
		print("%s\n", mime ? PLAIN : "awk script");
	else if (strcmp("sed", p) == 0)
		print("%s\n", mime ? PLAIN : "sed script");
	else if (strcmp("perl", p) == 0)
		print("%s\n", mime ? PLAIN : "perl script");
	else
		print("%s\n", mime ? PLAIN : "interpeted executable file");
	return 1;
}

Mon Apr 19 16:58:57 EDT 2021
/* interpeted executables */
int
isintrexec(void)
{
	char a[64], *b[3], *p;
	int n;

	if (memcmp("#!", buf, 2) != 0)
		return 0;
	memmove(a, buf+2, sizeof a);
	if ((p = strchr(a, '\n')) != nil)
		*p = 0;
	p = strrchr(a, '/');
	if (p == nil)
		p = a;
	else
		p++;
	n = getfields(p, b, 3, 1, " \t");
	if (n >= 2 && strcmp(b[0], "env") == 0)
		p = b[1];
	else
		p = b[0];
	if (strcmp("rc", p) == 0)
		print("%s\n", mime ? PLAIN : "rc executable file");
	else if (strcmp("sh", p) == 0)
		print("%s\n", mime ? "application/x-sh" : "sh executable file");
	else if (strcmp("bash", p) == 0)
		print("%s\n", mime ? "application/x-sh" : "bash executable file");
	else if (strcmp("awk", p) == 0)
		print("%s\n", mime ? PLAIN : "awk script");
	else if (strcmp("sed", p) == 0)
		print("%s\n", mime ? PLAIN : "sed script");
	else if (strcmp("perl", p) == 0)
		print("%s\n", mime ? PLAIN : "perl script");
	else
		print("%s\n", mime ? PLAIN : "interpeted executable file");
	return 1;
}

next