Re: [nodejs] node_modules/node-proxy/build/Release/nodeproxy.node: invalid ELF header]

2013-01-19 Thread Norman Khine


On Saturday, January 19, 2013 7:14:26 AM UTC+1, Luke Arduini wrote:

 No idea how appfog works or what os they're running for deploys, but do 
 they install  build (if necessary) dependencies for you or take what's 
 built on your local machine? If it's the latter then it's probably the 
 issue but you should really just ask their support.


OK, the problem was that i had to run locally in order to rebuild any 
dependancies:

$ npm shrinkwrap

then AppFog uses this to build all the modules - 
see https://docs.appfog.com/languages/node#node-dep-mgmt

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] 64 system can't complie node-v0.8.18

2013-01-19 Thread 冼建民
www:/home/kenneth/node-v0.8.18# make
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/kenneth/node-v0.8.18/out'
  flock /home/kenneth/node-v0.8.18/out/Release/linker.lock g++ -pthread 
-rdynamic -m64  -o /home/kenneth/node-v0.8.18/out/Release/mksnapshot 
-Wl,--start-group 
/home/kenneth/node-v0.8.18/out/Release/obj.target/mksnapshot/deps/v8/src/mksnapshot.o
 
/home/kenneth/node-v0.8.18/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a
 
/home/kenneth/node-v0.8.18/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a
 
-Wl,--end-group 
make[1]: flock: Command not found
make[1]: *** [/home/kenneth/node-v0.8.18/out/Release/mksnapshot] Error 127
make[1]: Leaving directory `/home/kenneth/node-v0.8.18/out'
make: *** [node] Error 2

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] 64 system can't complie node-v0.8.18

2013-01-19 Thread Ben Noordhuis
On Sat, Jan 19, 2013 at 10:58 AM, 冼建民 utfqvfhpy...@gmail.com wrote:
 www:/home/kenneth/node-v0.8.18# make
 make -C out BUILDTYPE=Release V=1
 make[1]: Entering directory `/home/kenneth/node-v0.8.18/out'
   flock /home/kenneth/node-v0.8.18/out/Release/linker.lock g++ -pthread
 -rdynamic -m64  -o /home/kenneth/node-v0.8.18/out/Release/mksnapshot
 -Wl,--start-group
 /home/kenneth/node-v0.8.18/out/Release/obj.target/mksnapshot/deps/v8/src/mksnapshot.o
 /home/kenneth/node-v0.8.18/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a
 /home/kenneth/node-v0.8.18/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a
 -Wl,--end-group
 make[1]: flock: Command not found
 make[1]: *** [/home/kenneth/node-v0.8.18/out/Release/mksnapshot] Error 127
 make[1]: Leaving directory `/home/kenneth/node-v0.8.18/out'
 make: *** [node] Error 2

Make sure that you have the util-linux package installed.  (I'm
assuming that's a Linux system.)

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Grasshopper

2013-01-19 Thread Anephenix
Hi,

Apologies for hijacking this thread, but I wanted to get in touch with any 
Bangalore-based Node.js developers who do contracting work. There is a 
startup in the city who are using Dashku (an open-source Dashboard app I 
built), and want some custom work done with it. I can't do it because I've 
too much work to do already, but I figured it would be useful for any 
Node.js devs nearby.

Regards,

Paul Jensen


On Monday, July 19, 2010 2:05:47 PM UTC+1, Chandra Sekar S wrote:

 Hi,

 I've been writing a web framework for Node.js for quite some time, called 
 Grasshopper.  I had initially intended it to be a way for me to learn the 
 working of Node well.

 Now, after some amount of development, I've been using it for applications 
 I write for myself.  I thought I'd share it with the community and if 
 anyone finds it interesting feel free to use, fork and contribute back.

 http://github.com/tuxychandru/grasshopper

 It has a bunch examples explaining the usage of various features within 
 the examples directory of the repository.  Any feedback is welcome.

 --
 Chandra Sekar.S
  

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Running javascript code safely

2013-01-19 Thread Alexey Petrushin
Maybe I'm wrong, but isn't we loose all the performance benefits of node.js 
when delegating this to the system? 

If so - why bother with JS-related stuff at all - just use pure OS features 
for sandboxing and run there whatever You want - node.js or not.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] a pakage that exports few modules

2013-01-19 Thread Glenn Block
Check out utile: https://github.com/flatiron/utile

It has helpers requireDir and requireDirLazy which scan for .js files and
exposes an object for each file with the key being the filename.


On Fri, Jan 18, 2013 at 10:27 PM, Luke Arduini lucasardu...@gmail.comwrote:

 Magically finding files in a /lib directory sounds scary. Maybe I missed
 it, why not be explicit with your requires if you're including multiple
 files in your module? (not commenting on if I think this is a good idea)

 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] cluster module: understanding and interfering the distribution of incoming connection to workers

2013-01-19 Thread thewilli
Hi!

The node documentation of the cluster module says about incoming server 
connections: 

When multiple processes are all accept()ing on the same underlying 
 resource, the operating system load-balances across them very efficiently. 
 There is no routing logic in Node.js, or in your program, and no shared 
 state between the workers.


I want to understand what node does when a new incoming connection is 
established and two or more worker are listening.

As far as I understand what happens after listen(port) is called on a 
workers server instance is, that the master is queried (queryServer 
internal message) about the given parameters like port and type, and that 
the server returns an fd handler (in cluster.js, 
messageHandler.queryServer). This handle is either retrieved or newly 
created. So what is that handle about? It is created in the 
_createServerHandle method in the net module, which creates a new instance 
of process.binding('tcp_wrap').TCP defined in tcp_wrap.cc in case of a 
TCP-based server. 

But where does that acception that is mentioned in the documentation take 
place? Is there any (easy) way to create a custom way of distribution of 
new connections to all listening workers?

Thanks in advance!

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] cluster module: understanding and interfering the distribution of incoming connection to workers

2013-01-19 Thread Ben Noordhuis
On Sat, Jan 19, 2013 at 7:54 PM, thewilli thewi...@googlemail.com wrote:
 Hi!

 The node documentation of the cluster module says about incoming server
 connections:

 When multiple processes are all accept()ing on the same underlying
 resource, the operating system load-balances across them very efficiently.
 There is no routing logic in Node.js, or in your program, and no shared
 state between the workers.


 I want to understand what node does when a new incoming connection is
 established and two or more worker are listening.

 As far as I understand what happens after listen(port) is called on a
 workers server instance is, that the master is queried (queryServer
 internal message) about the given parameters like port and type, and that
 the server returns an fd handler (in cluster.js,
 messageHandler.queryServer). This handle is either retrieved or newly
 created. So what is that handle about? It is created in the
 _createServerHandle method in the net module, which creates a new instance
 of process.binding('tcp_wrap').TCP defined in tcp_wrap.cc in case of a
 TCP-based server.

 But where does that acception that is mentioned in the documentation take
 place? Is there any (easy) way to create a custom way of distribution of new
 connections to all listening workers?

 Thanks in advance!

It works like this:

1. The master creates the listen socket (wrapped by a handle object)
and sends it to the workers.
2. The workers tell the operating system: Start watching this socket
for new connections.
3. When a new connection comes in, the operating system notifies one
of the workers.
4. The notified worker accepts (opens) the connection and starts
reading/writing.

The idea is that the operating system knows best what process to
notify (the one that is least loaded) but that has turned out to be of
debatable effectiveness.  Some workloads trigger a Linux scheduler
quirk where most connections end up in just 2 or 3 workers.

We'll be revising the current approach some day but the details remain
TBD and there is also the issue of man power.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Running javascript code safely

2013-01-19 Thread Bradley Meck
Alexey, depends on the system. Long story put short:

If you have persistent workers (say one per user not per request), this can 
be beneficial in some situations where running user code on your machines 
is less costly than sending things over network or for security you cannot 
(ie. something akin to couchdb/mongodb/etc. indexing). This is where this 
approach shines.

Doing this per request... you lose some benefits from the arbiter. But the 
arbiter could be in any language and should exist spawning child processes 
if you run code anyway anyway. However, with things like SES you get pretty 
much full speed JS so you can get benefits from the evented nature of Node 
in workers while allowing some interesting interactions to take place if 
you are running distributed systems. Most applications see little to no 
gain over using a bootstrap to setup RPC and then dropping permissions from 
that though, which is why I mention up top that #7 is generally overkill.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Running javascript code safely

2013-01-19 Thread Austin William Wright
I'd call this a bug, none of the context is supposed to be shared, 
including Function and Object.

On Friday, January 18, 2013 12:15:38 PM UTC-7, Bradley Meck wrote:

 Austin: won't go into great detail, but heres a fun little example:

 ```javascript
 function exploit() {
   console.log.constructor(process.exit(42))();
 }
 var result = require('vm').runInNewContext([
   'use strict;',
   '('+exploit.toString()+')()'
 ].join('\n'), {console:console});
 console.log('I SURVIVED THE STORM!'); // it wont
 ```

 Thats pretty trivial and then prototype injection attacks can occur if you 
 pass in natives and eventually use say... JSON.stringify if you override 
 .toJSON, .toString, .constructor, .valueOf, .__proto__, ...
 Then it gets worse when you do something like say... get a hold of a 
 non-strict mode function from a different scope by having it construct lets 
 say a continuation callback ...
 Even still... get a hold of some options object that feeds into a secure 
 area and set the options to something insecure (at a future point in time 
 with lets say Object.defineProperty).
 ...
 it goes on...
 ...


-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en