Skip to content

Instantly share code, notes, and snippets.

View nicola's full-sized avatar

Nicola nicola

View GitHub Profile
@nicola
nicola / b2g_discovery.js
Last active August 29, 2015 14:04
Discover a B2G simulator port in NodeJS
var discoverPorts = function (callback) {
var ports = [];
if (os == 'darwin') {
var output = exec(LSOF_CMD, {silent: true}).output;
var regex = /^b2g[-bin]?.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:([0-9]*)/;
var lines = output.split('\n');
for (var line=0; line < lines.length; line++) {
var matches = regex.exec(lines[line]);
# Find open FirefoxOS connection open and listening for remote debugging
import psutil
def get_connections(p):
try:
return p.get_connections()
except:
return []
@nicola
nicola / b2g_finder.py
Last active August 29, 2015 14:04
Find open FirefoxOS connection open and listening for remote debugging
import psutil
def get_connections(p):
try:
return p.get_connections()
except:
return []