ref: ff8443f8c2fe5e2499ff75d12a5333f9b6c43485
parent: 41f6839ba51cf7122044b5dd0519394317f5ab52
author: qwx <qwx@sciops.net>
date: Thu Jan 9 10:43:41 EST 2020
add convenience scripts
--- /dev/null
+++ b/9grid
@@ -1,0 +1,19 @@
+#!/bin/rc -e
+rfork n
+auth/factotum
+echo 'key proto=dp9ik user=glenda dom=grid !password=9gridchan' >/mnt/factotum/ctl
+srvtls tcp!registry.9gridchan.org!16675 gridreg /n/gridreg
+sed -n '/gridregistry/d;/tlssrv/{s/^/srvtls -c /;s/(is |mountpoint|service.*$)//g;s/pubregistry/gridpubreg/g;p;}' /n/gridreg/index | rc
+rm /srv/grid*
+#echo 'none
+#none' | `{sed -n 's/^([^ ]+).* is gridftp.*/ftpfs -\/ \1/p' /n/gridreg/index}
+#bind -c /n/ftp/incoming /n/gridftp
+#rio -k 'window -r 813 1702 1001 1878 page -i; window -r 330 1122 1002 1880 mothra; window -r 4 1123 1001 1583 -scroll chat -n qwx; window -scroll grep -b qwx /n/chat/chat' || status=''
+rio -k 'window -scroll chat -n qwx; window -scroll grep -b qwx /n/chat/chat' || status=''
+unmount /mnt/plumb
+#unmount /n/gridftp
+#unmount /n/ftp
+for(i in /n/grid*)
+ unmount $i
+unmount /mnt/wiki
+unmount /n/chat
--- /dev/null
+++ b/mk9
@@ -1,0 +1,16 @@
+#!/bin/rc -ex
+9fs 9fat
+if(test -f /n/9fat/9pc64 || test -f /n/9fat/9pc){
+ rm /n/9fat/9bootfat
+ cp /386/9bootfat /n/9fat/
+ chmod +al /n/9fat/9bootfat
+}
+if(test -f /n/9fat/9pc64)
+ cp /amd64/9pc64 /n/9fat/
+if(test -f /n/9fat/9pc)
+ cp /386/9pc /n/9fat/
+if(test -f /n/9fat/9zynq)
+ cp /arm/9zynq /n/9fat/
+rm /srv/dos
+unmount /n/9fat
+unmount /n/9
--- /dev/null
+++ b/mkall
@@ -1,0 +1,11 @@
+#!/bin/rc -e
+for(i in amd64 386 arm){
+ if(! ~ $#* 0)
+ objtype=$i mk $*^.install
+ if not
+ objtype=$i mk install
+}
+if(! ~ $#* 0)
+ mk $*^.clean
+if not
+ mk clean
--- /dev/null
+++ b/mku
@@ -1,0 +1,160 @@
+#!/bin/rc -xe
+# gottagofast update script
+# FIXME: this script is FUCKING RETARDED
+# FIXME: idea: don't rfork n, allow fixing whatever and continuing build; better
+# error detection and recovery
+rfork en
+h=$home
+
+fn mkp{
+ cd $h/p
+ mk nuke
+ mk install && mk nuke || exit NOPE
+ cp opl2/man/1/opl2 pplay/man/1/pplay u6/man/1/u6mopl wl3d/man/1/wl3d /sys/man/1/
+ cp wl3d/man/6/wl3d /sys/man/6/
+ cd $h/p/qk2
+ for(i in mkfile.*){
+ bind $i mkfile
+ mk install && mk nuke || exit NOPE
+ unmount mkfile
+ }
+ if(test -d $h/lib/extra/spew/aplay){
+ cd $h/lib/extra/spew/aplay
+ mk install && mk clean
+ }
+}
+
+if(! test -e $h/p){
+ h=/usr/qwx
+ if(! test -e $h/p)
+ exit 'no p to hand'
+}
+
+{
+cd /
+bind -ac /dist/plan9front /
+hg revert --no-backup \
+ /lib/vgadb\
+ /rc/bin/^(9fs ircrc play)\
+ /sys/man/4/nusb\
+ /sys/src/9/pc64/mkfile\
+
+sysupdate
+. /sys/lib/rootstub
+ramfs -um /n/mk
+@{cd /sys/src; tar c *} | @{cd /n/mk; tar x}
+bind /n/mk /sys/src
+
+#fplot-col\
+#life-col.patch\ FIXME: goddamnit burnzez
+colf=(\
+acme-col\
+kbmap-col\
+kbdfs-fshalt\
+libdraw-menucol\
+colors-col\
+faces-col\
+rio-col\
+samterm-col\
+spred-col\
+stats-col\
+statusmsg-col\
+statusbar-col\
+sudoku-col\
+mothra-slmod\
+vt-col\
+)
+
+f=(\
+9fs-9paste\
+9nusbrc-nesusbjoy\
+doom-autorun\
+doom-chat\
+doom-limits\
+doom-mouseglitches\
+doom-mousegrab\
+doom-naivescaleup\
+doom-nodclick\
+doom-skywallhit\
+doom-spy\
+file-mod\
+ircrc-jpmfix\
+ircrc-print-log\
+man-joy\
+page-invert\
+page-tempfix\
+paint-colpick\
+paint-reverse\
+play-dmid-mod\
+png-maxmem\
+rio-exit\
+samterm-cmdrect\
+troff-nchars\
+)
+
+ko=(amd64 386)
+k=(pc64 pc)
+switch($sysname){
+case u11 u16 u24 u25 u27 u32
+ f=($f $colf)
+ ko=(amd64 386 arm)
+ k=(zynq pc pc64)
+case u14 u19 u20 u23 u28
+ f=($f $colf)
+case u2 u13 u21
+ f=($f $colf)
+ ko=386
+ k=(pc)
+case *
+ ko=386
+ k=(pc)
+}
+for(i in $f)
+ ape/patch -s --no-backup-if-mismatch -p1 < $h/p/patch/$i
+ape/patch -s -fp1 < $h/p/patch/doom-udpip # FIXME
+cp $h/p/dot/vgadb /lib/vgadb
+rm -f (/lib/vgadb /rc/bin/ircrc /sys/man/4/nusb)^.orig
+
+cd /sys/src
+{
+ mk clean
+ for(i in $ko)
+ objtype=$i mk nuke
+ mk install || exit 'NOPE'
+ for(i in $ko)
+ if(! ~ $i $objtype)
+ objtype=$i mk install || exit 'NOPE'
+ mk clean
+ for(i in $ko)
+ objtype=$i mkp
+} | pump || exit 'NOPE'
+cd /sys/man
+mk
+
+for(i in $k){
+ cd /sys/src/9/^$i
+ mk clean && mk install && mk clean
+}
+9fs 9fat
+if(~ $objtype amd64 386){
+ rm /n/9fat/9bootfat
+ cp /386/9bootfat /n/9fat/
+ chmod +al /n/9fat/9bootfat
+}
+for(i in $k)
+ switch($i){
+ case pc
+ if(! ~ $sysname u28 && ! ~ $sysname u16)
+ cp /386/9pc /n/9fat/
+ case pc64
+ if(! ~ $sysname u16)
+ cp /amd64/9pc64 /n/9fat/
+ case zynq
+ cp /arm/9zynq /n/9fat/
+ }
+unmount /n/9fat
+unmount /n/9
+rm /srv/dos
+} >>/tmp/mku.$pid
+#echo sync >>/srv/hjfs.cmd
+rm /tmp/mku.$pid
--- /dev/null
+++ b/psam
@@ -1,0 +1,18 @@
+#!/bin/rc
+r=()
+switch($vgasize){
+case 3840x2160x*
+ r=(0 564 3840 1882)
+case 1920x1200x*
+ r=(0 0 1920 1018)
+case 1920x1080x*
+ r=(0 0 1920 898)
+case 1600x1200x*
+ r=(0 0 1920 928)
+case 1400x1050x*
+ r=(0 0 1400 906)
+case 1366x768x*
+ r=(0 0 1366 625)
+}
+if(! ~ $#r 0)
+ window -m -r $r sam -a $* $home/p/not/todo.proj
--- /dev/null
+++ b/vmxlinux
@@ -1,0 +1,48 @@
+#!/bin/rc
+rfork n
+
+fn clean{
+ for(i in '#X'/*/ctl)
+ echo quit > $i
+}
+
+fn sigexit{
+ clean
+}
+
+fn sigint{
+ clean
+}
+
+n=ether0
+M=1G
+k=/tmp/vmx/vmlinuz-5.3.0-19-generic
+m=/tmp/vmx/initrd.img-5.3.0-19-generic
+d=/dev/sdU7af84/data
+v=vesa:1280x1024
+c=('root=/dev/vda1')
+while(~ $1 -?){
+ switch($1){
+ case -d; d=$2; shift;
+ case -e; d=($d -d $2); shift;
+ case -k; k=$2; shift;
+ case -l; psd listen || aux/listen;
+ case -M; M=$2; shift;
+ case -m; m=$2; shift;
+ case -n; n=$2; shift;
+ case --; break;
+ case *
+ echo usage: $0 [opts] [--] [more opts]
+ exit usage
+ }
+ shift
+}
+echo scroll >/dev/wctl
+vmx \
+ -d $d \
+ -M $M \
+ -m $m \
+ -n $n \
+ -v vesa:1280x1024 \
+ $k \
+ $c $*
--- /dev/null
+++ b/wpa
@@ -1,0 +1,6 @@
+#!/bin/rc -e
+ip/ipconfig unbind || status=''
+if(! test -d /net/ether1)
+ bind -a '#l1' /net
+aux/wpa -s $1 /net/ether1
+ip/ipconfig ether /net/ether1