Skip to content

Instantly share code, notes, and snippets.

View mranney's full-sized avatar

Matt Ranney mranney

View GitHub Profile
root@sjc1-srv-03:/usr/ports/sysutils/lsof # make
===> Building for lsof-4.88.e_1,8
--- version.h ---
--- lib/liblsof.a ---
--- dnode2.o ---
--- version.h ---
Constructing version.h
--- lib/liblsof.a ---
(cd lib; /usr/bin/make DEBUG="-O2" CFGF="-pipe -fno-omit-frame-pointer -fno-strict-aliasing -fno-omit-frame-pointer -DHASTASKS -DHAS_PAUSE_SBT -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR=\"10.0-RELEASE\"")
--- dnode2.o ---
function SomeClass() {
this.version = null;
this.header_length = null;
this.header_bytes = null;
this.diffserv = null;
this.total_length = null;
this.identification = null;
this.flags = {};
this.fragment_offset = null;
this.ttl = null;
mjr-uber-mbp:~$ npm install -g http_trace
\
> socketwatcher@0.2.1 install /usr/local/lib/node_modules/http_trace/node_modules/pcap/node_modules/socketwatcher
> node-gyp rebuild
CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
SOLINK_MODULE(target) Release/socketwatcher.node
SOLINK_MODULE(target) Release/socketwatcher.node: Finished
> pcap@2.0.1 install /usr/local/lib/node_modules/http_trace/node_modules/pcap
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
return {
main: function () {
http.createServer(new_client).listen(listen_port);
sys.puts("Listening on " + listen_port);
}
};
function handle_couch_get(url, in_request, in_response) {
sys.puts("Making outbound CouchDB request: " + sys.inspect(url));
var out_request = http.createClient(couch_port, couch_hostname)
.request("GET", url.href, {
"Host": couch_hostname
});
out_request.addListener("response", function (out_response) {
in_response.sendHeader(out_response.statusCode, out_response.headers);
out_response.addListener("data", function (chunk) {
in_response.write(chunk);
var sys = require('sys'),
http = require('http'),
pool = [];
function finishTHEM(message){
var pool_size = pool.length, local_r, i;
sys.puts("Sending " + message + " to " + pool_size + " clients.");
for(i = 0; i < pool_size; i += 1) {
local_r = pool.shift();
function handle_couch_get(url, in_request, in_response) {
sys.puts(in_request.connection.remoteAddress + " CouchDB request: " + sys.inspect(url));
var out_request = http.createClient(couch_port, couch_hostname)
.request("GET", url.href, {
"Host": couch_hostname
});
out_request.addListener("response", function (out_response) {
in_response.sendHeader(out_response.statusCode, out_response.headers);
out_response.addListener("data", function (chunk) {
in_response.write(chunk);
@mranney
mranney / gist:340659
Created March 22, 2010 23:11
repltest.js
var sys = require("sys"),
net = require("net"),
repl = require("repl");
nconnections = 0;
net.createServer(function (c) {
sys.error("Connection!");
nconnections += 1;
c.close();
}).listen(5000);
@mranney
mranney / output.txt
Created March 23, 2010 05:38
setInterval test
// setInterval / clearInterval
var sys = require("sys"),
start = new Date(),
count = 10,
timer = setInterval(function () {
count -= 1;
sys.puts("Timer fired after " + (Date.now() - start) + "ms " + count + " remaining.");
if (count === 0) {
clearInterval(timer);
}