(作業中メモ)
c=/mnt/term/Users/lufia/src/github.com/0intro/plan9-contrib
bind -a $c/sys/lib/tls /sys/lib/tls
bind /tmp/x/ape /sys/include/ape
bind /tmp/x/arch /386/include/ape/
bind $home/bin/386/cpp /bin/cpp
# | |
# usage: docker run -ti --rm -v $(pwd):/docs -v ~/.ssh:/root/.ssh:ro xx | |
# | |
FROM debian:11 | |
RUN apt-get update && \ | |
apt-get install -y git make golang && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
mkdir -p /app /docs && \ | |
git clone https://github.com/ingydotnet/git-subrepo.git /app/git-subrepo && \ |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <errno.h> | |
#include <sys/mount.h> | |
// /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h |
#include <u.h> | |
#include <libc.h> | |
typedef struct Time Time; | |
typedef union Metric Metric; | |
typedef struct Value Value; | |
struct Time { | |
vlong sec; | |
}; |
#!/bin/sh | |
set -eu | |
list_pkgs() | |
{ | |
local f | |
f=$(cat <<-'END' | |
{{range .Imports}}{{.}} |
package main | |
import ( | |
"crypto/tls" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
) |
#include <u.h> | |
#include <libc.h> | |
#include <bio.h> | |
static void | |
usage(void) | |
{ | |
fprint(2, "usage: %s [file ...]\n", argv0); | |
exits("usage"); | |
} |
package main | |
import ( | |
"context" | |
"crypto/tls" | |
"flag" | |
"io" | |
"log" | |
"net/http" | |
"net/url" |
#!/usr/bin/env bash | |
# ref https://groups.google.com/forum/#!topic/comp.os.plan9/dL9RQnlY6So | |
w=acme/$winid | |
echo -n Edit ,d | 9p write $w/body | |
echo -n /Edit ,d/ | 9p write $w/addr | |
echo -n 'dot=addr' | 9p write $w/ctl | |
9p read $w/addr | awk '{printf("MX%s %s\n", $1, $2)}' | 9p write $w/event |
#!/usr/bin/env bash | |
# usage: goinstall [pkg ...] | |
if [[ -z $GOPATH ]] | |
then | |
echo $(basename $0): requires GOPATH >&2 | |
exit 1 | |
fi | |
IFS=: paths=($GOPATH) |