Skip to content

Instantly share code, notes, and snippets.

View dmage's full-sized avatar

Oleg Bulatov dmage

View GitHub Profile
@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",
@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 / 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()
package main
import (
"math"
"testing"
)
func Log2Sum(logx, logy float64) float64 {
if logx < logy {
logx, logy = logy, logx
@dmage
dmage / kt_latin.c
Last active November 6, 2016 23:53
for (i = 0; i < 128; i++) {
if (!strcmp(s, get_sym(ctx, KT_LATIN, i)))
return K(KT_LATIN, i);
}
if (direction == TO_UNICODE) {
for (i = 0; i < charsets_size; i++) {
p = (sym *) charsets[i].charnames;
for (j = charsets[i].start; j < CHARSET_SIZE; j++, p++) {
if (!strcmp(s, p->name))
import random
from sklearn import datasets, cross_validation, metrics
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib import learn
import numpy as np
random.seed(42)
# Load dataset and split it into train / test subsets.
// Package worker provides observable collections of runnable tasks.
package worker
import (
"context"
"sync"
)
// Interface defines a general worker.
type Interface interface {
$ socat -v TCP4-LISTEN:80,reuseaddr,fork TCP4:172.30.1.1:5000
...
> 2017/04/10 18:39:55.619349 length=392 from=0 to=391
GET /openshift/token?account=developer&scope=repository%3Amyproject%2Fdebian%3Apush%2Cpull HTTP/1.1\r
Host: 127.0.0.1\r
User-Agent: docker/1.12.6 go/go1.7.4 kernel/4.10.8-200.fc25.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.6 \\(linux\\))\r
Authorization: Basic ZGV2ZWxvcGVyOmtENVBrMmFwSFpTZW1pLVRGa2VjanZKVUVqUlVFZy11UTIwcnJUSnhjdFk=\r
Accept-Encoding: gzip\r
Connection: close\r
\r
> 2017/04/10 17:54:33.109309 length=237 from=0 to=236
GET /v2/ HTTP/1.1\r
Host: registry.free-int.openshift.com\r
User-Agent: docker/1.12.6 go/go1.7.4 kernel/4.10.8-200.fc25.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.6 \\(linux\\))\r
Accept-Encoding: gzip\r
Connection: close\r
\r
< 2017/04/10 17:54:33.218820 length=520 from=0 to=519
HTTP/1.1 401 Unauthorized\r
Content-Type: application/json; charset=utf-8\r
"".A t=1 size=16 args=0x18 locals=0x0
0x0000 00000 (foo.go:3) TEXT "".A(SB), $0-24
0x0000 00000 (foo.go:3) FUNCDATA $0, gclocals·d4dc2f11db048877dbc0f60a22b4adb3(SB)
0x0000 00000 (foo.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
0x0000 00000 (foo.go:4) MOVQ "".x+16(FP), AX
0x0005 00005 (foo.go:4) TESTQ AX, AX
0x0008 00008 (foo.go:4) SETEQ AL
0x000b 00011 (foo.go:4) MOVB AL, "".~r1+24(FP)
0x000f 00015 (foo.go:4) RET
0x0000 48 8b 44 24 10 48 85 c0 0f 94 c0 88 44 24 18 c3 H.D$.H......D$..