flesh out plan9 thing
This commit is contained in:
parent
dca6445cfb
commit
0a4af205b7
|
@ -20,7 +20,7 @@ Computer Nerd Stuff
|
||||||
|
|
||||||
* [The Setup](setup.html): the hardware and software I use
|
* [The Setup](setup.html): the hardware and software I use
|
||||||
* [Writing formal letters with roff](roff-letters.html)
|
* [Writing formal letters with roff](roff-letters.html)
|
||||||
* [Plan9 GUI stuff in Unix](gui.html): How to make your X11 stuff feel more like Plan9
|
* [Plan9 GUI stuff in Unix](plan9.html): How to make your X11 stuff feel more like Plan9
|
||||||
* [Runit as Init](runit-as-init.html): My experience using runit as PID 1 for two years
|
* [Runit as Init](runit-as-init.html): My experience using runit as PID 1 for two years
|
||||||
* [Reply-To Munging Still Considered Harmful](reply-to-still-harmful.html)
|
* [Reply-To Munging Still Considered Harmful](reply-to-still-harmful.html)
|
||||||
* [Runnning PHP as a CGI](php-cgi.html) in anything other than Apache
|
* [Runnning PHP as a CGI](php-cgi.html) in anything other than Apache
|
||||||
|
|
|
@ -61,3 +61,75 @@ there are some differences you might prefer.
|
||||||
http://woozle.org/neale/g.cgi/x11/9wm/
|
http://woozle.org/neale/g.cgi/x11/9wm/
|
||||||
|
|
||||||
|
|
||||||
|
sshfs
|
||||||
|
-----
|
||||||
|
|
||||||
|
As a non-root user,
|
||||||
|
you can mount remote file systems locally with `sshfs`.
|
||||||
|
It's probably as close as Unix is going to get for a while,
|
||||||
|
and it's not awful.
|
||||||
|
|
||||||
|
|
||||||
|
lm
|
||||||
|
--
|
||||||
|
|
||||||
|
The plan9 `lm` command is great:
|
||||||
|
it's like `apropos` or `man -k` but it outputs lines you can
|
||||||
|
copy and paste into a prompt to pull up the page.
|
||||||
|
Here's a script to do the same thing with Unix:
|
||||||
|
|
||||||
|
#! /bin/sh
|
||||||
|
apropos -l "$@" | sed 's/\(.*\) (\(.*\)) * - /man \2 \1 # /'
|
||||||
|
|
||||||
|
|
||||||
|
xdg-open
|
||||||
|
--------
|
||||||
|
|
||||||
|
This is the current Linux notion of how to do things like the plumber.
|
||||||
|
Just about every modern program calls out to it to open files,
|
||||||
|
and it uses whichever one is first in your path,
|
||||||
|
so you can make a little script to do what you want and
|
||||||
|
avoid having to configure all the weirdo files in ~/.config
|
||||||
|
|
||||||
|
#! /bin/sh
|
||||||
|
case "$1" in
|
||||||
|
*://*)
|
||||||
|
exec web "$1"
|
||||||
|
;;
|
||||||
|
*.pdf)
|
||||||
|
exec my-pdf-viewer "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
mon
|
||||||
|
---
|
||||||
|
|
||||||
|
Russ Cox uses a program called `mon`
|
||||||
|
to watch files and run them whenever they change.
|
||||||
|
This is pretty handy for iterative debugging,
|
||||||
|
you don't have to keep re-running your program every time you
|
||||||
|
save/compile.
|
||||||
|
|
||||||
|
Here's a start at one.
|
||||||
|
It can be improved.
|
||||||
|
|
||||||
|
#! /bin/sh
|
||||||
|
while true; do
|
||||||
|
gonow=
|
||||||
|
stat=$(stat --format=%Y.%Z.%s $1)
|
||||||
|
if [ "$stat" != "${laststat:-$stat}" ]; then
|
||||||
|
laststat=$stat
|
||||||
|
gonow=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$gonow" ]; then
|
||||||
|
echo "[[=== start ===]]"
|
||||||
|
$@
|
||||||
|
echo "[[=== done ===]]"
|
||||||
|
fi
|
||||||
|
laststat=$stat
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue