This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list | |
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - | |
sudo apt-get update && sudo apt-get install bazel | |
wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz | |
sudo tar -xvf go1.8.3.linux-amd64.tar.gz | |
sudo mv go /usr/local | |
echo "export GOROOT=/usr/local/go" >> ~/.bashrc | |
echo "export PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh | |
index b3c0c57..9ca5d7c 100755 | |
--- a/hack/local-up-cluster.sh | |
+++ b/hack/local-up-cluster.sh | |
@@ -183,7 +183,7 @@ KUBELET_HOST=${KUBELET_HOST:-"127.0.0.1"} | |
# By default only allow CORS for requests on localhost | |
API_CORS_ALLOWED_ORIGINS=${API_CORS_ALLOWED_ORIGINS:-/127.0.0.1(:[0-9]+)?$,/localhost(:[0-9]+)?$} | |
KUBELET_PORT=${KUBELET_PORT:-10250} | |
-LOG_LEVEL=${LOG_LEVEL:-3} | |
+LOG_LEVEL=${LOG_LEVEL:-10} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
$USER=$1 | |
$MASTER=$2 | |
$MINION1=$3 | |
$MINION2=$4 | |
alias sshmaster="sshpass -p nicira ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$MASTER" | |
alias sshmin1="sshpass -p nicira ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$MINION1" | |
alias sshmin2="sshpass -p nicira ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$MINION2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SESSION=$USER_$RANDOM | |
NODES="alias_nsxv.sh" | |
MASTER=$1 | |
MINION1=$2 | |
MINION2=$3 | |
USER=$4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clone k8s | |
git clone https://github.com/kubernetes/kubernetes | |
# Setup etcd | |
curl -L https://github.com/coreos/etcd/releases/download/v2.2.2/etcd-v2.2.2-linux-amd64.tar.gz -o etcd-v2.2.2-linux-amd64.tar.gz | |
tar xzvf etcd-v2.2.2-linux-amd64.tar.gz | |
curl -sSL https://get.docker.com | sh | |
# Install go | |
sudo rm -rf /usr/local/go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CSE6242/CX4242 Homework 4 Decision Tree | |
import csv | |
import math | |
from collections import defaultdict | |
import numpy as np | |
from collections import Counter | |
import time | |
# Global Variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a new javascript Date object based on the timestamp | |
// multiplied by 1000 so that the argument is in milliseconds, not seconds | |
var date = new Date(unix_timestamp*1000); | |
// hours part from the timestamp | |
var hours = date.getHours(); | |
// minutes part from the timestamp | |
var minutes = "0" + date.getMinutes(); | |
// seconds part from the timestamp | |
var seconds = "0" + date.getSeconds(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Playign with the API in Chrome. Save the script in your home folder | |
Go to file:// in your browser | |
s = document.createElement('script'); | |
s.src = 'file:///home/gangil/firebase.js'; | |
document.body.appendChild(s) | |
--Function to get all details about a post with the given id | |
function show(snap){ console.log(snap.val());} | |
function getPost(id){new Firebase("https://hacker-news.firebaseio.com/v0/item/" + id).on('value', show);} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<vector> | |
#define V vector; | |
typedef V<int> vi; | |
int main(){ | |
int a[] = {1, 2, 3, 4}; | |
vi b(a, a+4); | |
for(vi::iterator it = b.begin(); it != b.end(); ++it){ | |
cout << *it; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char* itoa(int val, int base){ | |
static char buf[32] = {0}; | |
int i = 31; | |
for(; val && i ; --i, val /= base) | |
buf[i] = "0123456789abcdef"[val % base]; | |
return &buf[i+1]; | |
} |
NewerOlder