Skip to content

Instantly share code, notes, and snippets.

package main
import (
"math"
"testing"
)
func Log2Sum(logx, logy float64) float64 {
if logx < logy {
logx, logy = logy, logx
@dmage
dmage / main.go
Created January 26, 2015 12:20
List of interfaces in mgo/bson (go-mgo/mgo#69)
package main
import (
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"log"
)
type MyInterface interface {
Hello()
@dmage
dmage / gossh.go
Created February 22, 2014 16:10
code.google.com/p/go.crypto/ssh: unhandled message while creating NewSession
package main
import (
gossh "code.google.com/p/go.crypto/ssh"
"log"
)
type keyboardInteractive map[string]string
func (cr *keyboardInteractive) Challenge(user string, instruction string, questions []string, echos []bool) ([]string, error) {
@dmage
dmage / gentoo-minimal.json
Created February 22, 2014 11:47
PACKER_LOG=1 packer build gentoo-minimal.json 2>&1 | tee packer.log
{
"description": "gentoo template",
"variables": {
"ssh_username": "root",
"ssh_password": "vagrant"
},
"builders": [
{
"type": "virtualbox-iso",
"name": "virtualbox-gentoo",