Skip to content

Instantly share code, notes, and snippets.

View khilnani's full-sized avatar

Nik Khilnani khilnani

View GitHub Profile
@khilnani
khilnani / vi.md
Last active December 6, 2016 04:37
" Windows
"------------------------
" :split
" :vsplit
" <C-W>n new
" <C-W>s split
" <C-W>v vsplit
" <C-W>c close
" <C-W>o others
@khilnani
khilnani / ssh.md
Last active December 31, 2015 18:59
  • Create Keys ssh-keygen -t rsa -C "your_email@example.com"
  • Get Fingerprint - ssh-keygen -lf $file
@khilnani
khilnani / hello.sh
Last active January 1, 2016 04:19
Single File Gist - Test
#!/bin/sh
h="Hello"
echo $h
@khilnani
khilnani / hello.sh
Created December 23, 2013 02:36
Two file Gist test
#!/bin/sh
h="Hello"
echo $h

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 / 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;
//--------------------------------------------------------
@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 / mongodb.md
Last active August 29, 2015 13:56
mongodb notes
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 / 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