Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Doing and Being

Clay Graham claytantor

💭
Doing and Being
View GitHub Profile
@claytantor
claytantor / create_docker_machine.sh
Created Oct 24, 2016
how to create and size your boot3docker machine
View create_docker_machine.sh
$ docker-machine create --driver virtualbox --virtualbox-disk-size "32000" default
@claytantor
claytantor / docker_bash.sh
Created Oct 23, 2016
how to run a shell into a container
View docker_bash.sh
$ sudo docker exec -i -t 665b4a1e17b6 /bin/bash
@claytantor
claytantor / fr.sh
Created Oct 21, 2016
Recursively find and replace in files
View fr.sh
# 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 Oct 12, 2016
using cloudwatch logs client
View AwsLogsClient.java
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 Oct 8, 2016
tensorflow finally working with gpu
View tensorfow_gpu.txt
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 Oct 8, 2016
well I have cuda8 installed and working.
View cuda8_installed.txt
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 Oct 5, 2016
chart a stock
View mongo1.py
%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 Oct 2, 2016
how to add a ribbon that will show up at the body level
View ribbon.html
<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>
View UCISequenceClassificationExampleToo_1.java
// ----- 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 Sep 10, 2016
Starting point for utilities to make simple data structures from buffers.
View NDArrayUtils.java
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;