Skip to content

Instantly share code, notes, and snippets.

@cjellick
cjellick / .vimrc
Last active December 18, 2015 02:49
Just my .vimrc
syntax on
filetype plugin indent on
set background=dark
set incsearch
set ignorecase
set smartcase
set scrolloff=2
set wildmode=longest,list
set expandtab
set number
@cjellick
cjellick / .bashrc
Last active December 19, 2015 06:29
my bash setup
PS1="\w$ "
export EDITOR='mvim'
export GIT_EDITOR='mvim -gf'
alias ll='ls -l'
[http]
postBuffer = 524288000
[alias]
hist = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[core]
pager = cat
@cjellick
cjellick / gotodm
Created August 10, 2015 18:12
Scriptlet to source to set and keep track of the docker machine you are using.
eval "$(docker-machine env $1)" 2>/dev/null
PS1="($1)$PS1"
func ServeHTTP(rw http.ResponseWriter, req *http.Request) {
ws := getWebsocketConnection(req)
respChannel := getChannel()
for {
message, ok := <-respChannel
if !ok {
cleanup(ws)
return
}
2015-10-06 16:23:07,425 ERROR [:] [] [] [] [tp219230684-136] [i.g.i.g.r.handler.ExceptionHandler ] Exception in API for request [io.github.ibuildthecloud.gdapi.request.ApiRequest@4206f485] java.lang.IllegalStateException: Can not set a value on a null target
at io.cattle.platform.object.util.DataAccessor.getTargetMap(DataAccessor.java:180) ~[classes/:na]
at io.cattle.platform.object.util.DataAccessor.get(DataAccessor.java:152) ~[classes/:na]
at io.cattle.platform.object.util.DataAccessor.as(DataAccessor.java:134) ~[classes/:na]
at io.cattle.platform.object.util.DataAccessor.field(DataAccessor.java:106) ~[classes/:na]
at io.cattle.platform.configitem.context.impl.LoadBalancerInfoFactory.populateTargetsInfo(LoadBalancerInfoFactory.java:216) ~[classes/:na]
at io.cattle.platform.configitem.context.impl.LoadBalancerInfoFactory.populateContext(LoadBalancerInfoFactory.java:99) ~[classes/:na]
at io.cattle.platform.configitem.context.impl.AbstractAgentBaseContextFactory.populateContext(AbstractAgentBaseContex
@cjellick
cjellick / Dockerfile
Last active October 29, 2015 01:14
kubernetes build script
FROM ubuntu
ADD kubelet /usr/bin/
ADD kube-proxy /usr/bin/
RUN apt-get install -y iptables
time="2015-11-05T16:52:22-07:00" level=info msg="Starting websocket proxy. Listening on [:8080], Proxying to cattle API at [localhost:8081], Monitoring parent pid [11057]."
2015-11-05 23:52:31,159 ERROR [:] [] [] [] [qtp296928318-20] [i.g.i.g.r.handler.ExceptionHandler ] Exception in API for request [io.github.ibuildthecloud.gdapi.request.ApiRequest@798956d1] java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at io.github.ibuildthecloud.gdapi.model.impl.FieldImpl.getValue(FieldImpl.java:74) ~[classes/:na]
at io.github.ibuildthecloud.gdapi.model.impl.WrappedResource.init(WrappedResource.java:76) ~[classes/:na]
at io.github.ibuildthecloud.gdapi.model.impl.WrappedResource.<init>(WrappedResource.java:49) ~[classes/:na]
at io.github.ibuildthecloud.gdapi.model.impl.WrappedResource.<init>(WrappedResource.java:36) ~[classes/:na]
at io.github.ibuildthecloud.gdapi.model.impl.WrappedResource.<init>(WrappedResource.java:53) ~[classes/:na]
at io.github.ibuildthecloud.gdapi.request.resourc
io.cattle.platform.async.utils.TimeoutException: Object [instance:31] failed to satisfy predicate [15000] millis
at io.cattle.platform.object.monitor.impl.ResourceMonitorImpl.waitFor(ResourceMonitorImpl.java:92)
at io.cattle.platform.object.monitor.impl.ResourceMonitorImpl.waitFor(ResourceMonitorImpl.java:97)
at io.cattle.platform.servicediscovery.deployment.impl.DefaultDeploymentUnitInstance.waitForStartImpl(DefaultDeploymentUnitInstance.java:139)
at io.cattle.platform.servicediscovery.deployment.DeploymentUnitInstance.waitForStart(DeploymentUnitInstance.java:81)
at io.cattle.platform.servicediscovery.deployment.impl.DeploymentUnit.waitForStart(DeploymentUnit.java:219)
at io.cattle.platform.servicediscovery.deployment.ServiceDeploymentPlanner.deploy(ServiceDeploymentPlanner.java:70)
at io.cattle.platform.servicediscovery.deployment.impl.DeploymentManagerImpl.startUnits(DeploymentManagerImpl.java:224)
at io.cattle.platform.servicediscovery.deployment.impl.DeploymentManagerImpl.activateDeploymentUnits(

To start on packet: Create a "Type 1" ubuntu machine on packet. Click the Manage button and add this ot the user data:

#cloud-config
runcmd:
- wget -O /tmp/cc https://raw.githubusercontent.com/rancher/os/master/scripts/hosting/packet/packet.sh
- bash -x /tmp/cc

Wait for machine to put up and ssh in.