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
#cloud-config | |
coreos: | |
units: | |
- name: test.service | |
content: "[Unit]\nDescription=Test\n\n[Service]\nExecStart=/usr/bin/echo \"hi\"\nType=oneshot\n\n[Install]\nWantedBy=multi-user.target\n" |
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 | |
# I ran this on an EC2 c1.medium instance with Docker version 0.6.3 on Ubuntu 12.04. | |
# I ran docker -d on tcp port 4243, and delivered 'stop' via the rest api | |
# because that's what I do in my production setup, but I don't know if that | |
# makes a difference. | |
# First, run ubuntu:12.04, and in it do | |
# echo -e '#!/bin/bash\nsleep 600' > cmd.sh | |
# chmod +x cmd.sh | |
# Then commit it and tag it as img-with-cmd |
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 node | |
var shell = require("shelljs") | |
var n = 100; | |
var nPorts = 10; | |
var port = 40000; | |
var launchCmds = []; | |
for (var i = 0; i < n; i++) { |
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 | |
# (C) Copyright Canonical 2011,2012 | |
# What lxc container to clone | |
LXC_BASE="" | |
# $2 is a path to bind mount e.g. /tmp/foo. | |
LXC_BIND="" | |
LXC_DIR="" | |
UNION="overlayfs" |
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 | |
# | |
# template script for generating container for LXC | |
# with username and password 'sense' | |
# and an ssh key for the root user. | |
# | |
# This script consolidates and extends the existing lxc ubuntu scripts | |
# |
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 numpy as np | |
from theano import tensor as T | |
import theano | |
x = T.dvector('x') | |
z = T.dscalar('z') | |
y = T.sum(T.cos(x*z)) | |
x_test = np.random.normal(size=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
from scipy.sparse import linalg | |
import numpy as np | |
import map_utils | |
def dim2w(dim): | |
return np.arange(-np.ceil((dim-1)/2.), np.floor((dim-1)/2.)+1) | |
class fractional_modified_laplacian(linalg.LinearOperator): | |
def __init__(self, dims, kappa, alpha): |
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
from copy import copy | |
import theano as th | |
import theano.tensor as T | |
def isshared(node): | |
"Is there a better way to do this?" | |
return hasattr(node, 'update') | |
def unpack_nodes(expr): | |
""" |
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 pymc as pm | |
import numpy as np | |
# FIXME: Need to store duplicates too, when jumps are rejected. That means some mechanism | |
# for making sure the history is full-rank needs to be employed. | |
class HistoryCovarianceStepper(pm.StepMethod): | |
_state = ['n_points','history','tally','verbose'] | |
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 numpy as npy | |
from pymc.gp import Mean, Covariance, Realization, observe, plot_envelope, NearlyFullRankCovariance, FullRankCovariance | |
from pymc.gp.cov_funs import matern #, thinplate1d | |
import matplotlib | |
matplotlib.rcParams['axes.facecolor']=[1,1,1] | |
__all__ = ['surface_mean', 'M', 'C'] | |
def surface_mean(x, val): | |
"""docstring for parabolic_fun""" |