Skip to content

Instantly share code, notes, and snippets.

// list a directory
{
command: 'ls',
arguments: [
{'uri': '/home/dunk/*.json'}
]
}
// list a directory and grep the returned files for foo
{
// Retrieving the "dashboard" object will tell you how to draw the
// dashboard. I've organized the things with "panes" so if we want to
// add a right top or bottom one later the data format already
// supports it.
var exdata = {
"dashboard": {
"name" : "mydashboard",
dunk@somehost:/tmp$ sudo npm install fatbot
npm it worked if it ends with ok
npm configfile /home/dunk/.npmrc
npm cli [ 'install', 'fatbot' ]
npm version 0.1.20
npm install pkg fatbot
npm fetch data fatbot
npm GET fatbot
npm install pkg fatbot
npm install pkg [email protected]
var connect = require('connect'),
sys = require('sys');
if( 0 ) {
// this works
module.exports = connect.createServer(
function(req, resp) {
sys.puts('json request');
req.setEncoding('utf8');
var body = '';
module.exports = connect.createServer(
connect.staticProvider(__dirname),
connect.router(function(app) {
app.post('/posttest', function(req, resp, params) {
sys.puts('post request');
req.setEncoding('utf8');
var body = '';
req.addListener('data', function(data) {
sys.puts('data'+ data);
body += data;
from spidermonkey import Runtime
import sys
rt = Runtime()
def jsprint(*args):
print " ".join(str(a) for a in args)
def _require(source):
cx = newcontext()
"""
simple script to merge multiple har files
usage: python merge_har.py out.har mylogs/*.har
"""
import simplejson
import sys
def merge(out_fn, in_files):
merged_log = {
'version': '1.1',