dot

packages and services management
Log | Files | Refs | README

commit 2042e6996a921de7bba6ed00d2db67de372190b3
parent aa4df71bb90b253d3f63fd55d673b6b65f3bc70e
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue,  3 Apr 2018 23:40:12 +0200

djbdns man pages

Diffstat:
Dbin/ghttpd | 84-------------------------------------------------------------------------------
Abin/gph-html | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Mbin/gproxy | 5++++-
Apack/djbdns-man/build | 10++++++++++
Apack/djbdns-man/tar | 1+
Muri/groups | 2++
Muri/people | 3+++
7 files changed, 71 insertions(+), 85 deletions(-)

diff --git a/bin/ghttpd b/bin/ghttpd @@ -1,84 +0,0 @@ -#!/usr/bin/awk -f -# converting gopher://localhost:70 to http://localhost:80/*.html -# -# /etc/inetd.conf: -# ghttpd stream tcp nowait root /.../ghttpd ghttpd host - -BEGIN { - HOST = ARGV[1]; - ARGC = 0; -} - -{ - sub("^GET /", ""); - sub(" HTTP/[0-9].*$", ""); - gsub(" ", "%20"); - gsub("\t", "%0b"); - gsub("\\\\", "%5c"); - - path = substr($0, 2); - flag = substr($0, 1, 1); - - exit; -} - -function esc(str) -{ - gsub("&", "\\&amp;", str); - gsub("<", "\\&lt;", str); - gsub(">", "\\&gt;", str); - gsub("\"", "\\&quot;", str); - return str; -} - -function url(f) -{ - if (sub("^URL:", "", f[2])) - return f[2]; - if (f[3] == HOST) - return sprintf("/%s%s", f[0], f[2]); - return sprintf("gopher://%s:%s/%s%s", f[3], f[4], f[0], f[2]); -} - -function link(f) -{ - return sprintf("<a href=\"%s\">%s</a>", url(f), esc(f[1])); -} - -END { - gsub("'", "", path); - - cmd = "printf '%s\r\n' '" path "' | nc -w 2 localhost 70" - - print("HTTP/1.1 200 OK\r"); - - if (flag == "1" || flag == "") { - print("Content-Type: text/html; charset=UTF-8\r"); - print("\r"); - print("<!doctype html><title>" HOST "</title>"); - print("<style>a { text-decoration:none; color:#077; }</style>"); - print("<pre style=\"width: 80ch; margin: auto;\">"); - - while (cmd | getline) { - sub("\r$", ""); - split($0, f, "\t"); - f[0] = substr(f[1], 1, 1); - sub(".", "", f[1]); - - if (f[0] == "i") - printf("%s\n", esc(f[1])); - else - print(link(f)); - } - print("</pre>"); - - } else if (flag == "0") { - print("Content-Type: text/plain; charset=UTF-8\r"); - print("\r"); - system(cmd); - - } else { - print("\r"); - system(cmd); - } -} diff --git a/bin/gph-html b/bin/gph-html @@ -0,0 +1,51 @@ +#!/usr/bin/awk -f + +# convert geomyidae .gph format into .html + +BEGIN { + HOST = ARGV[1]; + ARGC = 0; +} + +function esc(str) +{ + gsub("&", "\\&amp;", str); + gsub("<", "\\&lt;", str); + gsub(">", "\\&gt;", str); + gsub("\"", "\\&quot;", str); + return str; +} + +function url(f) +{ + if (sub("^URL:", "", f[2])) + return f[2]; + if (f[3] == HOST) + return sprintf("/%s%s", f[0], f[2]); + return sprintf("gopher://%s:%s/%s%s", f[3], f[4], f[0], f[2]); +} + +function link(f) +{ + return sprintf("<a href=\"%s\">%s</a>", url(f), esc(f[1])); +} + +END { + print("<!doctype html><title>" HOST "</title>"); + print("<style>a { text-decoration:none; color:#077; }</style>"); + print("<pre style=\"width: 80ch; margin: auto;\">"); + + while (cmd | getline) { + sub("\r$", ""); + split($0, f, "\t"); + f[0] = substr(f[1], 1, 1); + sub(".", "", f[1]); + + if (f[0] == "i") + printf("%s\n", esc(f[1])); + else + print(link(f)); + } + + print("</pre>"); +} diff --git a/bin/gproxy b/bin/gproxy @@ -1,6 +1,7 @@ #!/usr/bin/awk -f + # proxy from gopher to http and html for use with inetd -# + # /etc/inetd.conf: # gproxy stream tcp nowait nobody /.../gproxy gproxy host @@ -71,6 +72,8 @@ function link(f) END { gsub("'", "", path); gsub("'", "", host); + if (host == "") + host = "localhost"; cmd = "printf '%s\r\n' '" path "' | nc -w 5 '" host "' 70" print("HTTP/1.1 200 OK\r"); diff --git a/pack/djbdns-man/build b/pack/djbdns-man/build @@ -0,0 +1,10 @@ +#!/bin/sh -e + +mkdir -p "$PREFIX/share/man/man1" +cp *.1 "$PREFIX/share/man/man1" + +mkdir -p "$PREFIX/share/man/man5" +cp *.5 "$PREFIX/share/man/man5" + +mkdir -p "$PREFIX/share/man/man8" +cp *.8 "$PREFIX/share/man/man8" diff --git a/pack/djbdns-man/tar b/pack/djbdns-man/tar @@ -0,0 +1 @@ +http://smarden.org/pape/djb/manpages/djbdns-1.05-man.tar.gz diff --git a/uri/groups b/uri/groups @@ -7,6 +7,8 @@ http://9gridchan.org/ http://nixers.net http://suckless.org http://systemspace.network +http://thedjbway.b0llix.net/djbwhy.html +http://www.guinix.com/ irc://irc.cyberia.is/2f30 irc://irc.cyberia.is/airbnb irc://irc.cyberia.is/cyberia diff --git a/uri/people b/uri/people @@ -7,12 +7,15 @@ gopher://schinkel.bevuta.com gopher://tx.god.jp gopher://z3bra.org http://code.dogmap.org +http://cr.yp.to http://fuwafuwa.moe http://fydler.com/karahobny http://gnu.moe http://hosakacorp.net http://josuah.net http://nullprogram.com +http://skarnet.org +http://smarden.org http://smarden.org http://suckless.org http://twitter.com/jaromil