Skip to content

Instantly share code, notes, and snippets.

View khilnani's full-sized avatar

Nik Khilnani khilnani

View GitHub Profile
@khilnani
khilnani / mongodb.md
Last active January 27, 2019 22:25
mongodb cheat sheet
@khilnani
khilnani / chromebook-ubuntu.md
Last active July 22, 2018 07:31
Install Ubuntu on Chromebook. In Ubuntu, to install Lamp, Mongo DB: wget -O - http://goo.gl/YMhdcP | sudo bash

Install Ubuntu on Chromebook

  • Restart using ESC-Refresh-Power
  • At the prompt, CTRL-D to erase and install ChromeOS in Developer mode
  • Launch terminal - CTRL-ALT-t
  • Download and Install Crouton from (https://github.com/dnschneid/crouton)
    • sudo sh -e ~/Downloads/crouton -t cli-extra
    • sudo sh -e crouton -p "/media/removable/USB Drive/" -r trusty -t cli-extra
    • sudo sh -e crouton -p "/media/removable/USB Drive/" -r trusty -t xfce
  • Open up port 80 if needed - sudo /sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
var should = require('chai').should(),
supertest = require('supertest'),
api = supertest('http://localhost:5000');
describe('/blog', function() {
it('returns blog posts as JSON', function(done) {
api.get('/blog')
.set('x-api-key', '123myapikey')
.auth('correct', 'credentials')
@khilnani
khilnani / mongodb.md
Last active August 29, 2015 13:56
mongodb notes
@khilnani
khilnani / screenshot.js
Created January 26, 2014 06:49
Phantom.js script to take a screenshot of a URL
#!/usr/bin/env phantomjs
//--------------------------------------------------------
var page = require('webpage').create(),
system = require('system'),
file = null,
url = null;
//--------------------------------------------------------
@khilnani
khilnani / google.js
Created January 26, 2014 06:26
Phantom.js script to take screenshots of a google search result
#!/usr/bin/env phantomjs
//--------------------------------------------------------
var page = require('webpage').create(),
system = require('system'),
action = null,
q = null;
//--------------------------------------------------------

Download

Installation

  • Download both Memcached and Libevent source files (.tar.gz).
  • Install Libevent first since its a dependency for Memcached to work.
  • ./configure -prefix=/opt/libevent
@khilnani
khilnani / hello.sh
Created December 23, 2013 02:36
Two file Gist test
#!/bin/sh
h="Hello"
echo $h