Re: [9fans] Fwd: Call for Papers: LASER 2012?Learning from Authoritative Security Experiment Results

2012-01-11 Thread tlaronde
On Tue, Jan 10, 2012 at 10:19:36PM -0800, ron minnich wrote:
 This is kind of a fun one: stuff that DID NOT work. I like the basic idea

I generally learn more from what I do wrong than from what I do right---
sometimes because when it works, it is not absolutely for the reasons
I had explicitely in view... so the lesson is less than zero.

And there is the classical joke about the experiment on a flea:

Researcher tells the flea: jump!---and the flea jumps.
He cuts one leg. Jump!---and the flea, with more difficulty, jumps.
He cuts another leg. Jump!---after some time and great efforts, it
jumps.
He cuts one more. Jump!---and the flea doesn't jump.

Scientific conclusion: when one cuts legs to a flea, it becomes deaf.
-- 
Thierry Laronde tlaronde +AT+ polynum +dot+ com
  http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



Re: [9fans] usb flash drive with ext2

2012-01-11 Thread Richard Miller
 (When I plug it into my plan9 machine, I don't see any entry like
 /dev/sdUXX, I see 3 entries under /dev/usb/, ep4.0, ep4.1 and ep4.2,
 which appear/disappear as I plug/unplug the device. Running usb/disk
 claims sth. like 'there is no disk unhandled').

It appears you have no partition table and an ext2 fs occupying
the whole device.  This should be OK.

Try 'mount -a /srv/usb /dev' and see if /dev/sdUx.y appears.
If yes, try 'ext2srv -f /dev/sdUx.y/data  mount /srv/ext2 /n/linux'
If no, try 'cat /dev/usb/ep4.0/ctl' and see if you get something like:

enabled control rw speed high maxpkt 64 pollival 0 samplesz 0 hz 0 hub 
5 port 6 busy
storage csp 0x500608 vid 0x058f did 0x6387 Generic 'Mass Storage' ehci

where storage means it's been recognised as a mass storage device,
and busy means it's already being handled by the usb/disk driver.




Re: [9fans] usb flash drive with ext2

2012-01-11 Thread Rudolf Sykora
On 11 January 2012 11:06, Richard Miller 9f...@hamnavoe.com wrote:
 It appears you have no partition table and an ext2 fs occupying
 the whole device.  This should be OK.

Yes, I think the ext2 is really occupying the whole device. This is in
accord with what linux has said.

 Try 'mount -a /srv/usb /dev' and see if /dev/sdUx.y appears.

I will when I back home.

 If yes, try 'ext2srv -f /dev/sdUx.y/data  mount /srv/ext2 /n/linux'
 If no, try 'cat /dev/usb/ep4.0/ctl' and see if you get something like:

        enabled control rw speed high maxpkt 64 pollival 0 samplesz 0 hz 0 hub 
 5 port 6 busy
        storage csp 0x500608 vid 0x058f did 0x6387 Generic 'Mass Storage' ehci

 where storage means it's been recognised as a mass storage device,
 and busy means it's already being handled by the usb/disk driver.

This I tried yesterday (cat /dev/usb/ep4.0/ctl), and I saw both 'busy'
and 'storage'.

So perhaps 'mount -a /srv/usb /dev' will help.
Thanks!
Ruda



Re: [9fans] Fwd: Call for Papers: LASER 2012—Learning from Authoritative Security Experiment Results

2012-01-11 Thread Wes Kussmaul
On Tue, 2012-01-10 at 22:19 -0800, ron minnich wrote:
 This is kind of a fun one: stuff that DID NOT work. I like the basic
 idea ... 

  “failures” may actually provide clues to even more significant
 results than the original experimenter had intended. The research is
 useful, even though the results are unexpected.

When Mario Salvadori gave his grandmother a copy of his new book, _Why
Buildings Stand Up_, she thanked him and said but I'd much rather know
why buildings fall down.

That remark was the catalyst for his next book, _Why Buildings Fall
Down_.




[9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread smiley
Hello,

As readers may remember from a previous thread, I have historically
been, well, less than enamored with some aspects of the coding style
used in Plan 9/plan9port.  Now that I'm getting into development, I'd
like to know what coding conventions the Plan 9 community endorses.  I
have read the Plan 9 compiler paper, and understand the conventions
described in it.  While conventions such as composing variable names
using lower case letters and no underscores do irk me a bit, I can live
with them---because those are the conventions that the community has
adopted.  However, there are a number of stylistic features in Plan
9/p9p code which I've noticed (which AREN'T discussed in the compiler
paper) and I'm wondering whether they're intentional conventions or not.

(1) For example, P9 code tends to use variable names like i and j,
where I would typically use self-documenting variable names like row
and col.  Variable names like row and col are much easier to
search for (i.e., with a right-click), too.  Names like i and j
(which occur in many identifiers) will generate many false positives.

(2) In functions, variables are often declared together in one
paragraph, and then, later, initialized in another paragraph, as in:

  int i;
  char *s;

  /* stuff */

  i = 0;
  s = nil;

rather than something like:

  int i = 0;
  char *s = nil;

(3) Lots of global variables are used, without any distinguishing
syntax, i.e. char *f.  I prefer to designate global variables with
something like a leading underscore, i.e. char *_filename.

(4) In ARGBEGIN/ARGEND blocks, boolean switches are often set using the
++ operator rather than |= 1, i.e.:

  case 'v':
verbose++;
  case 'x':
x++;

as opposed to:

  case 'v':
verbose++;
  case 'x':
x |= 1;

(5) P9 code tends to repeat constructs such as argv[i] over and over
throughout the code, like:

  for(i = 0; i  argc; i++){
somestuff(argv[i]);
otherstuff(argv[i]);
  }

whereas I would typically use something like:

  int argnum;
  char *argstr;

  for(argnum = 0; argnum  argc; argnum++){
argstr = argv[argnum];
somestuff(argstr);
otherstuff(argstr);
  }


Are these practices official/unofficial Plan 9 coding conventions?  Are
they used for performance purposes?  Are they just poor style?  Or has
this kind of style been used for so long that it's BECOME Plan 9's style
of choice?  Also, is it considered polite or acceptable coding practice
to alter the style of code written by other contributors?  I don't want
to step on anybody's toes by fixing style which other Plan 9
developers consider to be Plan 9 style coding conventions.

Thanks!
-- 
+---+
|Smiley   smi...@icebubble.orgPGP key ID:BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA  3489 DAB7 555A BC54 9F8B|
+---+



Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread Richard Miller
style(6) deals with some of your questions.




Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread Jeremy Jackins
 Are these practices official/unofficial Plan 9 coding conventions?  Are
 they used for performance purposes?  Are they just poor style?  Or has
 this kind of style been used for so long that it's BECOME Plan 9's style
 of choice?  Also, is it considered polite or acceptable coding practice
 to alter the style of code written by other contributors?  I don't want
 to step on anybody's toes by fixing style which other Plan 9
 developers consider to be Plan 9 style coding conventions.

I'm not an active community member, but it seems you are confusing
style different from your own with poor style.



Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread Russ Cox
In any project, the polite thing to do is to make your code
look like the surrounding code.  You have identified many
ways in which your code does not look like the surrounding
code.  That's always the first step.

Russ



Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread John Floren

 (1) For example, P9 code tends to use variable names like i and j,
 where I would typically use self-documenting variable names like row
 and col.  Variable names like row and col are much easier to
 search for (i.e., with a right-click), too.  Names like i and j
 (which occur in many identifiers) will generate many false positives.

If everyone in the world uses i and j as row/column indexes into
arrays, aren't they self-documenting?

One reason is that in FORTRAN, identifiers that began with I
through...  N? were automatically integers.  Thus, I and J were easy.
There may be a good reason for that, I've heard that it came from
quaternions but that may be false.


John




Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread Russ Cox
Style is style; it is not defensible on its own.
If I were contributing to smiley's projects, I would
make the code look the way the rest of his code
does.  It's not that one way is necessarily better,
but one way is definitely least distracting in a given
context.

Russ



Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread Iruatã Souza
On Wed, Jan 11, 2012 at 7:20 PM, John Floren j...@jfloren.net wrote:

 (1) For example, P9 code tends to use variable names like i and j,
 where I would typically use self-documenting variable names like row
 and col.  Variable names like row and col are much easier to
 search for (i.e., with a right-click), too.  Names like i and j
 (which occur in many identifiers) will generate many false positives.

 If everyone in the world uses i and j as row/column indexes into
 arrays, aren't they self-documenting?

 One reason is that in FORTRAN, identifiers that began with I
 through...  N? were automatically integers.  Thus, I and J were easy.
 There may be a good reason for that, I've heard that it came from
 quaternions but that may be false.



When you do software for physics it seems generally better if the code
has similar/analogous notation to the derivations you're dealing with.
In that case one letter variables often render a direct understanding
while more descriptive names do not.

iru



[9fans] miau, an IRC bouncer

2012-01-11 Thread John Floren
Back when I had my FreeBSD server, I used to run a tmux session and
irssi to keep myself connected to IRC at all times.  This let me
access it from any computer with an SSH client.

Now I only run a Plan 9 server, but I missed the simplicity and
convenience of having just one nickname on IRC at all times.  I
finally got fed up and did a very crude port of Miau, an IRC bouncer.
A bouncer stays connected to your selected servers and channels while
serving the IRC protocol itself.  You then point an IRC client at your
bouncer, which instantly restores for you all the channels you had
open.

This serves essentially the same purpose as ircfs, but with the
advantage that you don't need Plan 9 or Inferno to access it--any
computer with an IRC client can connect.  In fact, you can just use
Mibbit to connect as long as you have a web browser.

Porting Miau was pretty easy; the configure script actually ran
properly and I only had to do a little bit of hacking to account for
things like the lack of crypt() (so yes, you have to type in a
plaintext password in the config file rather than giving it a hash).
There's a tar at /n/sources/contrib/john/miau9.tgz, or you can check
out the bitbucket repo from http://bitbucket.org/floren/miau9
(preferred).

Known bugs: It's really easy to type maui instead of miau.


John




Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread Skip Tavakkolian
by way of an example:

int pszBesmirchHungeriansNotation;

-Skip

On Wed, Jan 11, 2012 at 3:57 PM, John Stalker stal...@maths.tcd.ie wrote:
 One thing to remember about descriptive identifiers is that the
 compiler doesn't check whether the descriptions are accurate or
 not.  Often they were when the code was first written, but become
 less so over time.  Sometimes they were never accurate.  One nice
 thing about i, j, etc. is that you aren't tempted to make assumptions
 about them that aren't backed up by the code.  But I'm a mathematician,
 so I tend to have peculiar ideas about such things.

 --
 John Stalker
 School of Mathematics
 Trinity College Dublin
 tel +353 1 896 1983
 fax +353 1 896 2282




Re: [9fans] Plan 9/plan9port coding conventions

2012-01-11 Thread erik quanstrom
On Wed Jan 11 20:34:39 EST 2012, skip.tavakkol...@gmail.com wrote:
 by way of an example:
 
 int pszBesmirchHungeriansNotation;

who let the camel's nose in the tent?

- erik



Re: [9fans] miau, an IRC bouncer

2012-01-11 Thread John Floren
On Wed, Jan 11, 2012 at 3:03 PM, John Floren j...@jfloren.net wrote:
 Back when I had my FreeBSD server, I used to run a tmux session and
 irssi to keep myself connected to IRC at all times.  This let me
 access it from any computer with an SSH client.

 Now I only run a Plan 9 server, but I missed the simplicity and
 convenience of having just one nickname on IRC at all times.  I
 finally got fed up and did a very crude port of Miau, an IRC bouncer.
 A bouncer stays connected to your selected servers and channels while
 serving the IRC protocol itself.  You then point an IRC client at your
 bouncer, which instantly restores for you all the channels you had
 open.

 This serves essentially the same purpose as ircfs, but with the
 advantage that you don't need Plan 9 or Inferno to access it--any
 computer with an IRC client can connect.  In fact, you can just use
 Mibbit to connect as long as you have a web browser.

 Porting Miau was pretty easy; the configure script actually ran
 properly and I only had to do a little bit of hacking to account for
 things like the lack of crypt() (so yes, you have to type in a
 plaintext password in the config file rather than giving it a hash).
 There's a tar at /n/sources/contrib/john/miau9.tgz, or you can check
 out the bitbucket repo from http://bitbucket.org/floren/miau9
 (preferred).

 Known bugs: It's really easy to type maui instead of miau.


 John


Oddly, I can't get this to compile on my home Plan 9 system; there, it
bails out like all other configure scripts I've ever tried to use:

# ./configure
ln: conf115166.dir destination exists
usage: ls [-ACFHLRUacdflprstu1] [file ...]
configure: error: working directory cannot be determined
#

I'll have to try and figure out the difference.


John



Re: [9fans] miau, an IRC bouncer

2012-01-11 Thread Jens Staal
That error is very common where ls -di is called in the configure
script (strange that it did not complain on your other system).

a nice fix is fgb's config script
http://plan9.bell-labs.com/sources/contrib/fgb/rc/config

another common problem is grep, where the easiest is to write

GREP=grep
at the top of the configure script.

2012/1/12 John Floren j...@jfloren.net:
 On Wed, Jan 11, 2012 at 3:03 PM, John Floren j...@jfloren.net wrote:
 Back when I had my FreeBSD server, I used to run a tmux session and
 irssi to keep myself connected to IRC at all times.  This let me
 access it from any computer with an SSH client.

 Now I only run a Plan 9 server, but I missed the simplicity and
 convenience of having just one nickname on IRC at all times.  I
 finally got fed up and did a very crude port of Miau, an IRC bouncer.
 A bouncer stays connected to your selected servers and channels while
 serving the IRC protocol itself.  You then point an IRC client at your
 bouncer, which instantly restores for you all the channels you had
 open.

 This serves essentially the same purpose as ircfs, but with the
 advantage that you don't need Plan 9 or Inferno to access it--any
 computer with an IRC client can connect.  In fact, you can just use
 Mibbit to connect as long as you have a web browser.

 Porting Miau was pretty easy; the configure script actually ran
 properly and I only had to do a little bit of hacking to account for
 things like the lack of crypt() (so yes, you have to type in a
 plaintext password in the config file rather than giving it a hash).
 There's a tar at /n/sources/contrib/john/miau9.tgz, or you can check
 out the bitbucket repo from http://bitbucket.org/floren/miau9
 (preferred).

 Known bugs: It's really easy to type maui instead of miau.


 John


 Oddly, I can't get this to compile on my home Plan 9 system; there, it
 bails out like all other configure scripts I've ever tried to use:

 # ./configure
 ln: conf115166.dir destination exists
 usage: ls [-ACFHLRUacdflprstu1] [file ...]
 configure: error: working directory cannot be determined
 #

 I'll have to try and figure out the difference.


 John




Re: [9fans] miau, an IRC bouncer

2012-01-11 Thread John Floren
Turns out it's been fixed after a pull--thanks to whoever submitted that patch!

John

On Wed, Jan 11, 2012 at 10:40 PM, Jens Staal staal1...@gmail.com wrote:
 That error is very common where ls -di is called in the configure
 script (strange that it did not complain on your other system).

 a nice fix is fgb's config script
 http://plan9.bell-labs.com/sources/contrib/fgb/rc/config

 another common problem is grep, where the easiest is to write

 GREP=grep
 at the top of the configure script.

 2012/1/12 John Floren j...@jfloren.net:
 On Wed, Jan 11, 2012 at 3:03 PM, John Floren j...@jfloren.net wrote:
 Back when I had my FreeBSD server, I used to run a tmux session and
 irssi to keep myself connected to IRC at all times.  This let me
 access it from any computer with an SSH client.

 Now I only run a Plan 9 server, but I missed the simplicity and
 convenience of having just one nickname on IRC at all times.  I
 finally got fed up and did a very crude port of Miau, an IRC bouncer.
 A bouncer stays connected to your selected servers and channels while
 serving the IRC protocol itself.  You then point an IRC client at your
 bouncer, which instantly restores for you all the channels you had
 open.

 This serves essentially the same purpose as ircfs, but with the
 advantage that you don't need Plan 9 or Inferno to access it--any
 computer with an IRC client can connect.  In fact, you can just use
 Mibbit to connect as long as you have a web browser.

 Porting Miau was pretty easy; the configure script actually ran
 properly and I only had to do a little bit of hacking to account for
 things like the lack of crypt() (so yes, you have to type in a
 plaintext password in the config file rather than giving it a hash).
 There's a tar at /n/sources/contrib/john/miau9.tgz, or you can check
 out the bitbucket repo from http://bitbucket.org/floren/miau9
 (preferred).

 Known bugs: It's really easy to type maui instead of miau.


 John


 Oddly, I can't get this to compile on my home Plan 9 system; there, it
 bails out like all other configure scripts I've ever tried to use:

 # ./configure
 ln: conf115166.dir destination exists
 usage: ls [-ACFHLRUacdflprstu1] [file ...]
 configure: error: working directory cannot be determined
 #

 I'll have to try and figure out the difference.


 John