Skip to content

Instantly share code, notes, and snippets.

-- to set terminal window title
echo -n -e "\033]0;Docker and Kubernetes\007"
@xsqian
xsqian / docker.text
Created March 15, 2018 04:28
docker image for the CarND
-- to pull the latest version of docker image from registry:
docker pull udacity/carnd-term1-starter-kit
-- to run the docker image (for Windows PowerShell):
docker run -it --rm -p 8888:8888 -v ${pwd}:/src udacity/carnd-term1-starter-kit test.ipynb
--or (for bash or Docker Quickstart Terminal)
docker run -it --rm -p 8888:8888 -v `pwd`:/src udacity/carnd-term1-starter-kit test.ipynb
@xsqian
xsqian / tf-save-data.py
Created March 15, 2018 06:26
Saving Graphs for TensorBoard
import tensorflow as tf
x = tf.constant(5, name='x')
y = tf.constant(8, name='y')
z = tf.Variable(2*x+3*y, name='z')
model = tf.global_variables_initializer()
with tf.Session() as sess:
write = tf.summary.FileWriter("./tf_logs", sess.graph)
sess.run(model)
print('z = ', sess.run(z)
echo -n -e "\033]0;My Terminal Title\007"
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"PrestoCoordinatorURL": {
"Description": "URL of the Presto Server. example: http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com:8889",
"Type": "String"
},
"AirpalPort": {
"Description": "Airpal Port",
"Type": "String",
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: datadog-agent
spec:
template:
metadata:
labels:
app: datadog-agent
name: datadog-agent
{
"deviceId": "devA",
"etag": "AAAAAAAAAAc=",
"status": "enabled",
"statusReason": "provisioned",
"statusUpdateTime": "0001-01-01T00:00:00",
"connectionState": "connected",
"lastActivityTime": "2015-02-30T16:24:48.789Z",
"cloudToDeviceMessageCount": 0,
"authenticationType": "sas",
sudo lsof -i :27017 # checks port 27017
host = db.serverStatus().host;
prompt = function() {
return db+"@"+host+"$ ";
}
or to get the uptime and total number of documents
prompt = function() {
return "Uptime:"+db.serverStatus().uptime+" Documents:"+db.stats().objects+" > ";
find . -name '*.js' -exec grep -i 'NPM_TOKE' {} \; -print