ref: 5cb4b786139c7e3ad5df18d5d7edc56634d111a0
author: glenda <glenda@narshaddaa>
date: Thu Apr 27 08:50:57 EDT 2023
init with some scripts
--- /dev/null
+++ b/gr
@@ -1,0 +1,24 @@
+#!/bin/rc
+# gr - recursive g(1)
+# sources/contrib/stallion/rc/gr
+
+fn usage {
+ echo >[1=2] usage: gr [g options] pattern [file...]
+ exit usage
+}
+
+fn findfiles {
+ du -as $* |awk '{if ($2 != ".") print $2}'
+}
+
+opts=()
+while(~ $1 -*){
+ opts=($opts $1)
+ shift
+}
+
+if(~ $#* 0)
+ usage
+
+pattern=$1; shift
+g $opts $pattern `{findfiles $*}
--- /dev/null
+++ b/iogear
@@ -1,0 +1,3 @@
+#!/bin/rc
+ip/ipconfig -g 192.168.1.254 ether /net/ether0 192.168.1.253 255.255.255.0
+#ip/ipconfig ether /net/ether0
--- /dev/null
+++ b/loadsec
@@ -1,0 +1,8 @@
+#!/bin/rc
+auth/factotum
+o=`{pwd}
+ramfs -p; cd /tmp
+auth/secstore -g factotum -u $user -s $authsrv
+read -m factotum > /mnt/factotum/ctl
+rm factotum
+cd $o
--- /dev/null
+++ b/olenda
@@ -1,0 +1,25 @@
+#!/bin/rc
+
+
+# x0 = inc x0 i
+fn inc {
+ echo $1^'+'^$2 | bc
+}
+
+# 126 x 32 oled
+while(){
+ i = 10
+ x0 = 20
+ y0 = 0
+ x1 = 146
+ y1 = 32
+
+ for(nothing in `{seq 14}){
+ crop -r $x0 $y0 $x1 $y1 < /lib/bunny.bit | iconv -u > /mnt/reform/kbdoled
+ #x0 = `{inc $x0 $i}
+ y0 = `{inc $y0 $i}
+ #x1 = `{inc $x1 $i}
+ y1 = `{inc $y1 $i}
+ sleep 0.1
+ }
+}
--- /dev/null
+++ b/pshot
@@ -1,0 +1,20 @@
+#!/bin/rc
+# pshot - see procs taking sys time, sorted
+
+ps | awk '{
+ nnl = 0
+ for(i = 1; i <= NF; i++){
+ if(index($4, "0:00") != 0){
+ nnl = 1
+ continue
+ }else if(i == 1){
+ printf "%s ", $4
+ }else if(i == 4){
+ printf "%s ", $1
+ } else {
+ printf "%s ", $i
+ }
+ }
+ if(!nnl)
+ print ""
+}' | sort -gr
--- /dev/null
+++ b/riostart
@@ -1,0 +1,10 @@
+#!/bin/rc
+window 0,0,161,117 stats -lmisce
+window cat /dev/kprint
+window -miny 130
+reform/shortcuts </dev/kbdtap >/dev/kbdtap &
+
+# run a system shell on the serial console
+#~ $#console 0 || window -scroll console
+
+