Skip to content

Instantly share code, notes, and snippets.

View nborwankar's full-sized avatar

Nitin Borwankar nborwankar

View GitHub Profile
<tfoot>
<tr bgcolor="white">
<th ><button class="pager-prev-page">prev</button></th>
<th colspan="2"><span class="pager-page"></span>
of <span class="pager-page-total"></span></th>
<th ><button class="pager-next-page">next</button></th>
</tr>
</tfoot>
; <<>> DiG 9.6.0-APPLE-P2 <<>> registry.npmjs.org a
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12756
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 0
;; QUESTION SECTION:
;registry.npmjs.org. IN A
;; ANSWER SECTION:
npm it worked if it ends with ok
npm configfile /Users/nitin/.npmrc
npm cli [ 'install', 'websocket' ]
npm version 0.1.20
npm install pkg websocket
npm fetch data websocket
npm GET websocket
npm ! Error: ECONNREFUSED, Connection refused
at IOWatcher.callback (net:854:22)
So what exactly is in a Sproingg node?
-------------------------------------
Sproingg is a project to bootstrap a richly featured text communication system over CouchDB using
the following apps and CouchDB features collectively referred to as a Sproingg node
a) A CouchDB database as message inbox with a CouchDB database URL as an address for sending messages (Reqd)
b) A CouchApp that is a forum app (Optional)
c) A CouchApp that is a wiki app (Optional)
d) A CouchApp blog (Optional)
testing ....
THE PROBLEM:
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)
THE TEMPTINGLY EASY BUT TOTALLY WRONG SOLUTION:
Alter the port the script talks to from 8000 to 80:
}).listen(80);
curl -X PUT http://your:credentials@localhost:5984/profiles
curl -X POST -d '{"source":"http://couchcamp.couchone.com/profiles","target":"http://localhost:5984/profiles","continuous":true}' -H "Content-type: application/json" http://localhost:5984/_replicate
curl -X POST -d '{"target":"http://couchcamp.couchone.com/profiles","source":"http://localhost:5984/profiles","continuous":true}' -H "Content-type: application/json" http://localhost:5984/_replicate
@nborwankar
nborwankar / couchdb-ec2-install.sh
Created August 26, 2011 00:21 — forked from msmith/couchdb-ec2-install.sh
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
@nborwankar
nborwankar / MLBootcampOct2015
Last active October 6, 2015 20:41
Notes and links for ML Bootcamp at UCB Oct 2015
Session 1
---------
* Intro
* Motivation
* Installation
* Overview of Material
Here's an R session mimicking the steps in the doc for decision trees. At this point not meant to show anything like the final result just a probe of the R<->Pg semantics.
Note that the driver seems to create a result set in a format that the data frame constructor in R understands.
Not only that but the equivalent of "to_string" for df seems to output it in the familiar tabular format by default.
So the happy result to report here is that the native impedance mismatch is small.
We'll need some validation tests to identify R<-->GP issues if any.
Right now I am using an R<-->Postgres driver (MADlib 0.4 on Pg 9.1 on MacOSX Lion., RStudio 0.9.4, R 2.13.2).