From 58e8b78ffdfaaf2e5e1abd7871e76c5427ed6c29 Mon Sep 17 00:00:00 2001 From: stanley lieber Date: Thu, 21 Jul 2011 14:18:08 -0500 Subject: [PATCH 1/6] troll: import --- rc/bin/troll | 2 ++ sys/games/lib/trolls | 6 ++++++ sys/man/1/fortune | 19 ++++++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 rc/bin/troll create mode 100644 sys/games/lib/trolls diff --git a/rc/bin/troll b/rc/bin/troll new file mode 100755 index 000000000..f114cce63 --- /dev/null +++ b/rc/bin/troll @@ -0,0 +1,2 @@ +#!/bin/rc +fortune /sys/games/lib/trolls diff --git a/sys/games/lib/trolls b/sys/games/lib/trolls new file mode 100644 index 000000000..ddd7c42f1 --- /dev/null +++ b/sys/games/lib/trolls @@ -0,0 +1,6 @@ +i'm so glad i live in europe and not america +azns are such shitty drivers, they should all go back to wherever the fuck they came from and smash each others' cars there +the wii is actually a pretty technically-advanced console compared to the ps3 +lighttpd is a great drop-in replacement for apache +you shouldn't really run hdd speed tests under plan9 because the controller drivers are hacked-together open-source shit, something closed-source but official like windows would give a more accurate result +the british empire had the right idea when they enslaved all those damn niggers diff --git a/sys/man/1/fortune b/sys/man/1/fortune index dfae7186a..96349ebef 100644 --- a/sys/man/1/fortune +++ b/sys/man/1/fortune @@ -1,11 +1,16 @@ .TH FORTUNE 1 .SH NAME -fortune \- sample lines from a file +fortune, troll \- sample lines from a file .SH SYNOPSIS .B fortune [ .I file ] +.br +.B troll +[ +.I file +] .SH DESCRIPTION .I Fortune prints a one-line aphorism chosen at random. @@ -14,10 +19,22 @@ If a is specified, the saying is taken from that file; otherwise it is selected from .BR /sys/games/lib/fortunes . +.LP +.I +Troll +is more specific than +.I fortune; +it specializes in inflammatory rhetoric. .SH FILES .B /sys/games/lib/fortunes .br .B /sys/games/lib/fortunes.index \ \ fast lookup table, maintained automatically +.br +.B /sys/games/lib/trolls .SH SOURCE .B /sys/src/cmd/fortune.c +.br +.B /rc/bin/troll +.SH AUTHORS +Some initial trolls were provided by ChrisPBS. From a8f69d4a0d1e9478b8466f09d35ab193d5f509c7 Mon Sep 17 00:00:00 2001 From: aiju Date: Fri, 22 Jul 2011 11:25:44 +0200 Subject: [PATCH 2/6] etherbcm: another try at the memleak --- sys/src/9/pc/etherbcm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/src/9/pc/etherbcm.c b/sys/src/9/pc/etherbcm.c index 376759aac..a82e748d8 100644 --- a/sys/src/9/pc/etherbcm.c +++ b/sys/src/9/pc/etherbcm.c @@ -358,18 +358,16 @@ bcmtransmit(Ether *edev) print("bcm: send queue full\n"); break; } - if(incr == ctlr->sendcleani) { - bcmtransclean(edev, 0); - if(incr == ctlr->sendcleani) - break; - } bp = qget(edev->oq); if(bp == nil) break; + setmalloctag(bp, (ulong)(void*)bcmtransmit); next = ctlr->sendr + ctlr->sendri * 4; next[0] = 0; next[1] = PADDR(bp->rp); next[2] = (BLEN(bp) << 16) | PacketEnd; next[3] = 0; + if(ctlr->sends[ctlr->sendri] != 0) + freeb(ctlr->sends[ctlr->sendri]); ctlr->sends[ctlr->sendri] = bp; csr32(ctlr, SendBDRingHostIndex) = ctlr->sendri = incr; } From b2a8db846b1030b106d129e19b5db0bf745fb5a8 Mon Sep 17 00:00:00 2001 From: aiju Date: Fri, 22 Jul 2011 11:41:31 +0200 Subject: [PATCH 3/6] acid: fixed $terminal handling --- sys/src/cmd/acid/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/src/cmd/acid/main.c b/sys/src/cmd/acid/main.c index bb27cc9e3..89fc4c636 100644 --- a/sys/src/cmd/acid/main.c +++ b/sys/src/cmd/acid/main.c @@ -567,6 +567,9 @@ system(void) q = strchr(p, ' '); if(q) *q = 0; + q = strrchr(p, '/'); + if(q) + p = q + 1; } if(kernel != nil) From 4636a1e21adfe395c2afdce2145da497b913d1d3 Mon Sep 17 00:00:00 2001 From: aiju Date: Fri, 22 Jul 2011 11:53:47 +0200 Subject: [PATCH 4/6] cwfs: fixed memsize() --- sys/src/cmd/cwfs/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/cwfs/malloc.c b/sys/src/cmd/cwfs/malloc.c index 048a81209..aa7debd27 100644 --- a/sys/src/cmd/cwfs/malloc.c +++ b/sys/src/cmd/cwfs/malloc.c @@ -28,7 +28,7 @@ memsize(void) } } Bterm(bp); - if (pgsize > 0 && userused > userpgs) + if (pgsize > 0 && userused < userpgs) return (userpgs - userused)*pgsize; } return 64*MB; From e88e6c9a3bfdc33c0e9f4388bf61aa4df5220a02 Mon Sep 17 00:00:00 2001 From: aiju Date: Fri, 22 Jul 2011 19:46:17 +0200 Subject: [PATCH 5/6] acid: don't assume mips --- sys/src/cmd/acid/acid.h | 1 - sys/src/cmd/acid/main.c | 27 +++++---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/sys/src/cmd/acid/acid.h b/sys/src/cmd/acid/acid.h index ef398e7b8..a050bc51b 100644 --- a/sys/src/cmd/acid/acid.h +++ b/sys/src/cmd/acid/acid.h @@ -27,7 +27,6 @@ typedef struct Type Type; typedef struct Frtype Frtype; Extern int kernel; -Extern int remote; Extern int text; Extern int silent; Extern Fhdr fhdr; diff --git a/sys/src/cmd/acid/main.c b/sys/src/cmd/acid/main.c index 89fc4c636..f5b67bd05 100644 --- a/sys/src/cmd/acid/main.c +++ b/sys/src/cmd/acid/main.c @@ -60,19 +60,11 @@ main(int argc, char *argv[]) case 'q': quiet = 0; break; - case 'r': - pid = 1; - remote++; - kernel++; - break; default: usage(); }ARGEND if(argc > 0) { - if(remote) - aout = argv[0]; - else if(isnumeric(argv[0])) { pid = strtol(argv[0], 0, 0); snprint(prog, sizeof(prog), "/proc/%d/text", pid); @@ -89,9 +81,7 @@ main(int argc, char *argv[]) } aout = argv[0]; } - } else - if(remote) - aout = "/mips/9ch"; + } fmtinstall('x', xfmt); fmtinstall('L', Lfmt); @@ -258,7 +248,6 @@ readtext(char *s) Value *v; uvlong length; Symbol sym; - extern Machdata mipsmach; if(mtype != 0){ symmap = newmap(0, 1); @@ -274,8 +263,6 @@ readtext(char *s) return; } - machdata = &mipsmach; - if(!crackhdr(text, &fhdr)) { print("can't decode file header\n"); return; @@ -553,15 +540,11 @@ system(void) static char *kernel; cpu = getenv("cputype"); - if(cpu == 0) { - cpu = "mips"; - print("$cputype not set; assuming %s\n", cpu); - } + if(cpu == 0) + sysfatal("$cputype not set"); p = getenv("terminal"); - if(p == 0 || (p=strchr(p, ' ')) == 0 || p[1] == ' ' || p[1] == 0) { - p = "ch"; - print("missing or bad $terminal; assuming %s\n", p); - } + if(p == 0 || (p=strchr(p, ' ')) == 0 || p[1] == ' ' || p[1] == 0) + sysfatal("$terminal not set"); else{ p++; q = strchr(p, ' '); From c985da80d3a7aa6be1db7ea7cb034ec4e057d934 Mon Sep 17 00:00:00 2001 From: stanley lieber Date: Fri, 22 Jul 2011 13:30:42 -0500 Subject: [PATCH 6/6] fortunes: /* ok for now. */ --- sys/games/lib/fortunes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/games/lib/fortunes b/sys/games/lib/fortunes index d2455f382..b9adaeaf8 100644 --- a/sys/games/lib/fortunes +++ b/sys/games/lib/fortunes @@ -4535,3 +4535,8 @@ The cast spent three weeks learning how to type, rollerblade and got to know eac I knew nothing about the PowerPC and had no idea how to modify my software to run on it. One August night, after dinner, two guys showed up to announce that they would camp out in my office until the modification was done. The three of us spent the next six hours editing fifty thousand lines of code. The secret to programming is having smart friends. -- Former Apple engineer at least he's not sexist. +(#cat-v) it's hard not to get trolled in #go-nuts +Dickerson explained the change today on Etsy's blog, saying that his focus as the new CEO will be to impel Etsy to move faster "and more purposefully", and re-prioritize risk-taking and "learning by doing" and "iterating." +(#cat-v) aiju: i had the correct code in my head +Connection to Microsoft Exchange has been restored. +/* ok for now. */