Skip to content

Instantly share code, notes, and snippets.

View claytantor's full-sized avatar
💭
Doing and Being

Clay Graham claytantor

💭
Doing and Being
View GitHub Profile
@claytantor
claytantor / create_docker_machine.sh
Created October 24, 2016 02:00
how to create and size your boot3docker machine
$ docker-machine create --driver virtualbox --virtualbox-disk-size "32000" default
@claytantor
claytantor / docker_bash.sh
Created October 23, 2016 18:43
how to run a shell into a container
$ sudo docker exec -i -t 665b4a1e17b6 /bin/bash
@claytantor
claytantor / fr.sh
Created October 21, 2016 17:23
Recursively find and replace in files
# Recursively find and replace in files
find . -name "*.txt" -print0 | xargs -0 sed -i '' -e 's/foo/bar/g'
@claytantor
claytantor / AwsLogsClient.java
Last active October 12, 2016 18:17
using cloudwatch logs client
public class AwsLogQuery {
private final static Logger logger = LoggerFactory.getLogger(AwsLogQuery.class);
// use the role of the lambda to determine policy.
protected static final AWSCredentialsProvider CREDENTIALS_PROVIDER =
new DefaultAWSCredentialsProviderChain();
public static void main(String[] args){
long startTime = 1476119058044l;
long endTime = 1476119159726l;
@claytantor
claytantor / tensorfow_gpu.txt
Created October 8, 2016 08:17
tensorflow finally working with gpu
clay@freekbox ~/data/nvidia $ python ./test1.py
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so.8.0 locally
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties:
name: GeForce GTX 1060 6GB
major: 6 minor: 1 memoryClockRate (GHz) 1.7085
@claytantor
claytantor / cuda8_installed.txt
Created October 8, 2016 06:27
well I have cuda8 installed and working.
clay@freekbox ~/data/nvidia/NVIDIA_CUDA-8.0_Samples/bin/x86_64/linux/release $ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 1060 6GB"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 6.1
@claytantor
claytantor / mongo1.py
Last active October 5, 2016 05:04
chart a stock
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from pymongo import MongoClient
from bson.objectid import ObjectId
import dateutil.parser
start_date_str = "2015-04-25T07:00:00Z"
@claytantor
claytantor / ribbon.html
Created October 2, 2016 00:07
how to add a ribbon that will show up at the body level
<script>
var node = document.createElement("div");
node.innerHTML = '<a href="https://github.com/claytantor/blueweave"><img style="position: absolute; top: 50px; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>';
document.getElementsByTagName('body')[0].appendChild(node);
</script>
// ----- Train the network, evaluating the test set performance at each epoch -----
int nEpochs = 400;
for (int i = 0; i < nEpochs; i++) {
net.fit(trainData);
trainData.reset();
}
//Evaluate on the test set:
List<String> labels = new ArrayList<>();
@claytantor
claytantor / NDArrayUtils.java
Created September 10, 2016 16:18
Starting point for utilities to make simple data structures from buffers.
package org.deeplearning4j.examples.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.string.NDArrayStrings;
import java.io.IOException;
import java.util.List;