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 | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF | |
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]') | |
CODENAME=$(lsb_release -cs) | |
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | \ | |
sudo tee /etc/apt/sources.list.d/mesosphere.list | |
sudo apt-get update | |
sudo apt-get install -y mesos |
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
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list | |
deb http://apt.kubernetes.io/ kubernetes-xenial main | |
EOF | |
apt-get update | |
apt-get install -y docker.io | |
apt-get install -y kubelet kubeadm kubectl kubernetes-cni |
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
#<source> | |
# @type http | |
# port 8888 | |
#</source> | |
<source> | |
@type tail | |
path /tmp/*.log | |
tag file.* | |
read_from_head true |
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
# XXX: this only works for tf 0.11 | |
import tensorflow as tf | |
from tensorflow.core.protobuf import meta_graph_pb2 | |
from tensorflow.contrib.session_bundle import manifest_pb2 | |
def read_serving_signatures(meta_file): | |
tf.reset_default_graph() | |
with tf.Session() as sess: | |
new_saver = tf.train.import_meta_graph(meta_file) |
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
# XXX: Only work with tf 11 | |
from tensorflow.contrib.learn.python.learn.utils import export | |
from tensorflow.contrib.session_bundle import exporter | |
def my_input_fn(): | |
# Return features tensors, the name is empty because when we build the model | |
# we feed in empty column name | |
return { | |
"": tf.placeholder(tf.float32, shape=[None, 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
#!/bin/bash | |
readarray -t lines < $1 | |
username=${lines[0]} | |
password=${lines[1]} | |
if [[ "$password" == "bao" ]]; then | |
echo "ok" |
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
import grpc.beta.implementations | |
import tensorflow_serving.apis.predict_pb2 as predict_pb2 | |
import tensorflow_serving.apis.prediction_service_pb2 as prediction_service_pb2 | |
import numpy as np | |
import tensorflow as tf | |
import threading | |
from timeit import timeit | |
# from concurrent.futures import ProcessPoolExecutor | |
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
### Keybase proof | |
I hereby claim: | |
* I am nqbao on github. | |
* I am nqbao (https://keybase.io/nqbao) on keybase. | |
* I have a public key ASC9DdgdV1S915zhkOswS6NVKUYnAoYm4IEpFJcFJrig8Qo | |
To claim this, I am signing this object: |
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
#!/usr/bin/env python | |
import grpc.beta.implementations | |
import tensorflow_serving.apis.predict_pb2 as predict_pb2 | |
import tensorflow_serving.apis.prediction_service_pb2 as prediction_service_pb2 | |
import random | |
import numpy as np | |
import tensorflow as tf | |
import threading |
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 | |
sudo apt-get update | |
sudo apt-get -y install ruby-dev libjemalloc-dev net-tools | |
sudo gem install fluentd -v "~> 0.14.0" --no-ri --no-rdoc | |
sudo gem install fluent-plugin-record-modifier | |
sudo gem install fluent-plugin-cloudwatch-logs | |