Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am apatil on github.
  • I am appatil (https://keybase.io/appatil) on keybase.
  • I have a public key ASAVyjh28PYFqu5KEu4RW8PR_Zs3uo3DxKkus8bHmEezEgo

To claim this, I am signing this object:

View vega-lite-example.json
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"values": [
{ "x": 0.0, "y": 1.0 },
{ "x": 1.0, "y": 0.0 },
{ "x": 2.0, "y": 1.0 }
]
},
"description": "An example plot to show you how to use this package",
View pv
apiVersion: v1
kind: PersistentVolume
metadata:
name: projects-share
labels:
app: sense
spec:
capacity:
storage: 12E
accessModes:
View playbook-reduced.yml
---
- hosts: master,nodes
become: True
become_user: root
become_method: sudo
vars_files:
- config.yml
vars:
k8s_version: 1.3.7
docker_version: 1.11.2
View gist:9cb3dde2dd8f3183ffa1
@api {get} /engines Request Available Engines
@apiVersion 1.0.0
@apiName GetEngines
@apiGroup Engines
@apiDescription Gets a list of the currently available engines on Sense.
@apiError (404) user not found.
@apiSuccess (200) {Object[]} engines List of available engines.
View git-crypt-diff
#!/bin/bash
fname=$1
branch=$2
key=$3
if [ "$fname" = "-h" ]
then
echo "Usage: git-crypt-diff fname branch key"
exit 0
@apatil
apatil / test.sh
Last active Aug 29, 2015
How to get Docker to choose the ports using the remote API?
View test.sh
curl -v -H "Content-Type: application/json" -X POST \
-d '{"Cmd":["/bin/sleep","infinity"],"Image":"ubuntu:14.04", "ExposedPorts":{"22/tcp":{}}}' \
http://127.0.0.1:4243/containers/create?name=testcontainer
curl -v -H "Content-Type: application/json" -X POST \
-d '{"PortBindings": { "22/tcp": [{ "HostPort": "11022" }]} }' \
http://127.0.0.1:4243/containers/testcontainer/start
View shared-mounts-nodocker.sh
#!/usr/bin/env bash
ROOTDIR=$PWD
echo "Setting up"
mkdir -p $ROOTDIR/shared
sudo mount --bind $ROOTDIR/shared $ROOTDIR/shared
sudo mount --make-unbindable $ROOTDIR/shared
sudo mount --make-shared $ROOTDIR/shared
@apatil
apatil / tests
Created May 12, 2014
CoreOS/Docker mount propagation tests
View tests
# Test 1:
# Launch data-only container in privileged mode
sudo docker run -i -t --name dataonly --privileged -v /shared ubuntu:14.04 /bin/bash
# in container:
mdir /shared/usr
mount --bind /usr /shared/usr
# Launch client container and attempt to read data from data-only container
sudo docker run -i -t --volumes-from dataonly ubuntu:14.04 /bin/bash
@apatil
apatil / gist:11001937
Created Apr 17, 2014
Fibrous pattern
View gist:11001937
f = (cb) =>
fibrous.run =>
a.sync()
b.sync()
, cb