Skip to content

Instantly share code, notes, and snippets.

View 3rd-Eden's full-sized avatar
💭
I have approximate knowledge of many things

Arnout Kazemier 3rd-Eden

💭
I have approximate knowledge of many things
View GitHub Profile
python tools/test.py --mode=release simple message
=== release test-dgram-unix ===
Path: simple/test-dgram-unix
server is listening
client is listening
client wrote 17 bytes.
server got: A message to send from /tmp/dgram_client_sock
assert:80
throw new assert.AssertionError({
^
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>text/html cloneNode</title>
</head>
<body>
<script type="text/html" id="example">{javascript:"contents"}</script>
<script type="text/javascript">
@3rd-Eden
3rd-Eden / pingoutput.txt
Created July 21, 2010 09:53
Connection errors with node do not get send
> ping 10.211.55.5
PING 10.211.55.5 (10.211.55.5): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
ping: sendto: No route to host
Request timeout for icmp_seq 4
ping: sendto: Host is down
Request timeout for icmp_seq 5
@3rd-Eden
3rd-Eden / ping.js
Created July 21, 2010 10:37
pinging servers
var spawn = require('child_process').spawn;
exports.ping = function( ip, callback ){
var pingSpawn = spawn( 'ping', [ ip ]);
pingSpawn.stdout.on('data', function (data) {
callback( false, true );
pingSpawn.kill();
});
@3rd-Eden
3rd-Eden / node_global_detection.js
Created July 22, 2010 15:05
How to easily detect leaking globals in Node.js
var natives = process.compile('Object.getOwnPropertyNames((function(){return this}()))','natives.js');
/* some code */
hello_world = "global";
/* some more code */
Object.getOwnPropertyNames((function(){return this}())).forEach(function(key){if( natives.indexOf(key) == -1){console.error(key)}})
@3rd-Eden
3rd-Eden / profileroutput.log
Created August 9, 2010 17:12
Node profiler output
[Unknown]:
ticks total nonlib name
1 1.6%
[Shared libraries]:
ticks total nonlib name
[JavaScript]:
ticks total nonlib name
1 1.6% 1.6% Function: Stream.flush net:800
var connect = require("connect"),
express = require("express");
var app = express.createServer(),
routes = require("./routes");
app.configure(function(){
app.set("views", __dirname + "/views");
app.use(app.router);
});
Caught exception: Error: ECONNRESET, Connection reset by peer
[ 'Error: ECONNRESET, Connection reset by peer'
, ' at Stream._readImpl (net:305:14)'
, ' at IOWatcher.callback (net:455:24)'
, ' at node.js:764:9'
]
Caught exception: Error: ECONNRESET, Connection reset by peer
[ 'Error: ECONNRESET, Connection reset by peer'
, ' at Stream._readImpl (net:305:14)'
, ' at IOWatcher.callback (net:455:24)'
[node@speedo ~]$ node-service-info
fmri svc:/site/node-service:default
name node.js service
enabled true
state online
next_state none
state_time August 30, 2010 12:26:00 PM GMT
logfile /var/svc/log/site-node-service:default.log
restarter svc:/system/svc/restarter:default
contract_id 5091
var onkeydown = function onkeydown( e ){
var keycode = (e || global.event).keyCode || e.charCode;
keys.push( String.fromCharCode( keycode ) );
code.push( keycode );
clearTimeout( timer );
timer = setTimeout(function(){
// check if we are already authorized or not, if this is not the case and the code matches the konami code we are going to
// start authorization process
if( !CONF.authorized && authorize && code.length == 10 && code.join('.') == "38.38.40.40.37.39.37.39.66.65" ){