Skip to content

Instantly share code, notes, and snippets.

Building heimdall...
panic: runtime error: makeslice: len out of range
goroutine 1 [running]:
runtime.panic(0x42cc0a0, 0x4675d00)
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/runtime/panic.c:266 +0xb6
github.com/cloudius-systems/capstan/hypervisor/qemu.SetArgs(0xc2100375f0, 0xc210000298, 0x4, 0xc21001ef86, 0x8, ...)
/Users/dcapwell/src/github/gopath/src/github.com/cloudius-systems/capstan/hypervisor/qemu/qemu.go:147 +0x405
github.com/cloudius-systems/capstan/cmd.Build(0xc2100375f0, 0xc210000298, 0x4, 0xc21001ef86, 0x8, ...)
/Users/dcapwell/src/github/gopath/src/github.com/cloudius-systems/capstan/cmd/build.go:66 +0x7d1
/**
* Utility class for working with fibers
*/
public final class Fibers {
private Fibers() {
}
/**
* Defines work to run inside a fiber process.
*/
@dcapwell
dcapwell / RecursiveLocks.java
Last active August 29, 2015 14:09
Java recursion with sync blocks
package com.github.dcapwell.jmh.java;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Threads;
package tach_demo;
import java.net.InetSocketAddress;
import tachyon.org.apache.thrift.TProcessor;
import tachyon.org.apache.thrift.server.TServer;
import tachyon.org.apache.thrift.server.TThreadedSelectorServer;
import tachyon.org.apache.thrift.transport.TNonblockingServerSocket;
import tachyon.org.apache.thrift.transport.TTransportException;
@dcapwell
dcapwell / boot2docker-use-nfs.sh
Created August 20, 2015 06:03
NFS for boot2docker
#!/usr/bin/env bash
set -x
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
@dcapwell
dcapwell / pom.xml
Created September 6, 2012 05:33
pom to use finagle
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ekaqu.finagle</groupId>
<artifactId>finagle-examples</artifactId>
<version>1.0</version>
@Override
public C get(final long timeout, final TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException {
try {
return super.get(timeout, unit);
} catch (TimeoutException e) {
Function<List<Optional<V>>, C> localCombiner = combiner;
if (localCombiner != null) {
// if the set took or not we don't care, if it doesn't take it means that it was set by the last future.
set(localCombiner.apply(values));
} else {
@dcapwell
dcapwell / gist:6907836
Created October 9, 2013 20:32
libs opened by bash on mac
$ sudo dtruss /bin/bash -c "echo hi" 2>&1 | egrep "^stat"
stat64("/AppleInternal\0", 0x7FFF584C0DD8, 0x0) = -1 Err#2
stat64("/Users/capwed\0", 0x7FFF584C1708, 0x0) = 0 0
stat64(".\0", 0x7FFF584C1678, 0x0) = 0 0
stat64("/usr/lib/libstdc++.6.dylib\0", 0x7FFF584C03E0, 0x7FFF584C12E0) = 0 0
stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF584C0610, 0x7FFF584C15E0) = 0 0
stat64("/usr/lib/libncurses.5.4.dylib\0", 0x7FFF584C03E0, 0x7FFF584C12E0) = 0 0
stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF584C03E0, 0x7FFF584C12E0) = 0 0
stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF584BFFE0, 0x7FFF584C0EE0) = 0 0
stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF584BFFE0, 0x7FFF584C0EE0) = 0 0
docker:
pkgrepo.managed:
- humanname: Docker Inc. PPA
- name: deb http://get.docker.io/ubuntu docker main
- comments:
- "# Docker Inc. Repo"
- key_url: https://get.docker.io/gpg
# - require_in:
# - pkg: lxc-docker
pkg.installed:
include:
- java
jenkins:
pkgrepo.managed:
- humanname: Jenkins PPA
- name: deb http://pkg.jenkins-ci.org/debian binary/
- comments:
- "# Jenkins Repo"
- key_url: http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key