Skip to content

Instantly share code, notes, and snippets.

View aadamowski's full-sized avatar

aadamowski aadamowski

View GitHub Profile
@Marak
Marak / lol.js
Created August 6, 2012 11:43
A terrible solution for finding network gateway
//
// Since the code to actually figure this out doesn't exist in node yet
//
// see: https://groups.google.com/forum/?fromgroups#!topic/nodejs-dev/QbcnxS0_yyg
//
var guessGateway = function () {
var network = os.networkInterfaces(),
guess = '10.0.0.1';
Object.keys(network).forEach(function(interfaces){