Skip to content

Instantly share code, notes, and snippets.

@navidshaikh
navidshaikh / traffic_demo.sh
Created August 15, 2019 13:57
sample demo script
set x
function nq() {
printf "\n"
read -p "Next?(y/n): " next
if [ $next != "y" ]
then
exit 1
fi
@navidshaikh
navidshaikh / knative terms
Last active March 27, 2019 10:31
Terms used in kantive context
Serving:
- stable-window: After a defined time of idleness when no request coming to revision.
- inactive-revision: Revision's state after `stable-window`.
- scale-to-zero-grace-period: The time an inactive revision is left running before it's scaled to zero.
Facts:
- After `stable-window` is lapsed, all the `inactive-revisions` now points to `activator`.
#!/usr/bin/env python2
import sys
class Node(object):
def __init__(self, value):
self.mid = value
self.left = None
self.right = None

Setup TLS-Enabled-Daemon from CDK and Connect to Eclipse

NEW VERSION OF THIS DOC https://github.com/navidshaikh/testing-adb

Bex has done a better job in building up the context and outlining the idea [here] (https://gist.github.com/bexelbie/35f421ee247c7621c0d0) . Goal here is to configure a TLS enabled Docker docker daemon running over TCP from inside CDK and configure client at Eclipse to be able to connect to it.

In order to get configure CDK + Eclipse

  1. docker daemon inside CDK has to run over TCP (as well, if running on local unix socket) - This need required certs to be generated inside CDK and updating the docker daemon config and restarting service.
  2. Required client side certs has to be copied over to host (from guest) for clients to connect
  3. Port at which docker inside CDK running need to be mapped at host machine port for client to easily connect
@navidshaikh
navidshaikh / gist:4147217
Created November 26, 2012 08:36 — forked from syntagmatic/gist:2202660
Export CSV with Javascript
// assumes variable data, which is a homogenous collection of objects
// get keys
var keys = _.keys(data[0]);
// convert to csv string
var csv = keys.join(",");
_(data).each(function(row) {
csv += "\n";
csv += _(keys).map(function(k) {