Skip to content

Instantly share code, notes, and snippets.

View RavenZZ's full-sized avatar
🎯
Focusing

Raven RavenZZ

🎯
Focusing
View GitHub Profile
@RavenZZ
RavenZZ / Dockerfile
Created February 17, 2018 06:44 — forked from crosbymichael/Dockerfile
Docker with supervisor
FROM ubuntu
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -y openssh-server supervisor
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf
RUN mkdir -p /var/run/sshd
func merge(a, b <-chan int) <-chan int {
c := make(chan int)
go func() {
defer close(c)
for a != nil || b != nil {
select {
case v, ok := <-a:
if !ok {
fmt.Println("a is done")
a = nil
@RavenZZ
RavenZZ / 1_kubernetes_on_macOS.md
Created December 12, 2017 15:40 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@RavenZZ
RavenZZ / gist:1b1a6cae10434aa3695b0ee7aa5f7815
Created November 7, 2017 12:24 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@RavenZZ
RavenZZ / concurrency-in-go.md
Created October 30, 2017 13:20 — forked from kachayev/concurrency-in-go.md
Channels Are Not Enough or Why Pipelining Is Not That Easy
@RavenZZ
RavenZZ / zeromq-vs-redis.md
Created September 5, 2017 01:49 — forked from hmartiro/zeromq-vs-redis.md
Comparison of ZeroMQ and Redis for a robot control platform

ZeroMQ vs Redis

This document is research for the selection of a communication platform for robot-net.

Goal

The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.

Requirements:

@RavenZZ
RavenZZ / GoMgoSample-1.go
Created August 9, 2017 08:01 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@RavenZZ
RavenZZ / merge_sort.go
Created July 12, 2017 03:29 — forked from RichardKnop/merge_sort.go
Merge Sort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
sortedItems := mergeSort(items)
fmt.Println(sortedItems)
@RavenZZ
RavenZZ / comb_sort.go
Created July 12, 2017 03:29 — forked from RichardKnop/comb_sort.go
Comb Sort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
combsort(items)
fmt.Println(items)
@RavenZZ
RavenZZ / shellsort.go
Created July 12, 2017 03:29 — forked from RichardKnop/shellsort.go
Shellsort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
shellshort(items)
fmt.Println(items)