Skip to content

Instantly share code, notes, and snippets.

View ejemba's full-sized avatar

Epo Jemba ejemba

  • Kametic
  • France
View GitHub Profile
@ejemba
ejemba / map_filter_reduce.go
Created December 14, 2016 20:16 — forked from icholy/map_filter_reduce.go
chaining channels in go
package main
import (
"unicode/utf8"
)
type Item string
type Stream chan Item
type Acc string
@ejemba
ejemba / translate.go
Created April 28, 2016 14:49 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@ejemba
ejemba / gist:6f49c3a4c85b0fc20ca8871c4ff1a03e
Created March 31, 2016 08:00 — forked from sidnei/gist:7041338
Using lvm thin provisioning
# Using lvm thin provisioning, per https://github.com/lxc/lxc/pull/67
# First we create a volume group to hold the thin pool
$ sudo vgcreate lxc /dev/sde3
# Then create a thin-pool named 'tp' within that volume group
$ sudo lvcreate -l 90%VG --type thin-pool --thinpool tp lxc
@ejemba
ejemba / README.txt
Created January 15, 2016 23:04 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh test@test.com
Run the server in one terminal
go run server.go
@ejemba
ejemba / database.go
Created October 7, 2015 16:41
Getting started with Cayley + Go API
package main
import (
"errors"
"fmt"
"os"
"github.com/google/cayley"
"github.com/google/cayley/graph"
_ "github.com/google/cayley/graph/bolt"
@ejemba
ejemba / meetup.go
Last active August 29, 2015 14:06 — forked from temoto/meetup.go
// Meetup is a micro proxy program that enables to connect two endpoints via TCP sockets.
// Either of endpoint may listen or connect.
//
// Example usage:
// - you have a faulty PHP application and you want to debug it with xdebug
// - xdebug can connect to your machine:9000, but you are behind NAT
// - so you run `meetup -listen1=:9000 -listen2=:9001` on the application server
// - and another `meetup -connect1=appserver:9001 -connect=localhost:9000` on your machine
// First instance listens two ports and when a connection arrives on both, it creates
// a bidirectional buffered pipe between the two. The other instance connects to