[9fans] import/export -B

2010-10-22 Thread Steve Simon
I am a little confused by import/export -B (backwards).

The only bit I don't get is why you have to supply a mountpoint to import.
Surely import will always be running from listen and as such it will not
be in any useful namespace so why mount anything?

from the manpage:

  Suppose that the machine moscvax has access to a private
  file server containing public web pages that need to be
  served by the less-trusted server webvax.  Webvax runs the
  following listener (see listen(8)) on TCP port 999:

   #!/bin/rc
   import -B -s rowebfs /usr/web /bin/restarthttpd

  When moscvax boots, it runs

   exportfs -R -r /usr/web -B tcp!webvax!999

  to serve a read-only copy of /usr/web to webvax.  When
  webvax gets the call, import mounts the served tree onto its
  own /usr/web and then runs /bin/restarthttpd to restart
  httpd(8).

It seems to me that my restarthpptd script will be 
'unmount /usr/web; chmod 600 /srv/rowebfs'

I find it strange that the mountpoint is not optional (as long as -s srv names 
exists).

perhaps I am missing somthing? or maybe its just a quirk?

-Steve



[9fans] Simple calculator/spreadsheet for Acme

2010-10-22 Thread Bill Burdick
I wrote a small tool that parses variables and code in an Acme window, runs
code the code with the variables as input, and replaces the variable values
in the window with the values the code outputs.  The code can be any script,
but I made wrappers to make it very easy to write scripts in rc and Go.
 Here's my example from the blog post:

Bob's age=30, he is yearsleft=0 years away from retirement (calc).

#!/usr/bin/env calcgo

yearsleft = 55 - age


If you middle click calc, it runs the Go script (generated, compiled,
linked, and executed by calcgo), and replaces the value of yearsleft with
25.  You can also increment values, etc., so running calc more than once can
to interesting things.

I'm not really tuned into the Acme/Wily/Oberon community, so I don't know if
this is a common way to work, but this uses what I think might be a good
interaction model for scripts -- take input from a window and put the
results back into the window.  It's kind of like HTTP's request/response
idea.  This could be extended to handle more than just simple data, like
tables (which my old calc for Ober did, follow that link in the post if
you're interested).

Here's my blog post about it:
this-statement-is-false.blogspot.com/2010/10/calculatorspreadsheet-tool-for-acme.html

Here's a link to the source (3 rc scripts):
http://repo.or.cz/w/bills-tools.git/tree/HEAD:/calc


Bill


Re: [9fans] sheevaplug port available

2010-10-22 Thread Benjamin Huntsman
There's a good chance your /tmp issue is not permissions,
but a lack of /tmp being mounted.  If your hostowner
doesn't have a lib/profile or its lib/profile doesn't
mount /tmp, then you won't be able to write anything
to it.

That was definitely it.  I had been logging into the hostowner profile
but hadn't run newuser.  I ran it, and then the pull worked.  I did have
to use the -s sys/src flag, but anyway, all up to date.  So looks like
having a profile for hostowner is required.  Good to know.

When rebuilding, I did have to change the permissions on /mail/lib/gone.*
in order for 'mk install' to complete, though I suppose I could have added
bootes to the upas group...

but anyway, thanks all for the help!!

-Ben
winmail.dat