Skip to content

Instantly share code, notes, and snippets.

View nbari's full-sized avatar
🪴

nbari

🪴
View GitHub Profile
@nbari
nbari / golang.sh
Created December 16, 2015 14:05 — forked from jacoelho/golang.sh
Install golang debian/ubuntu
#!/bin/bash
export GOLANG_VERSION=1.5.2
export GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
export GOLANG_DOWNLOAD_SHA1=cae87ed095e8d94a81871281d35da7829bd1234e
apt-get update -qq
apt-get install -y --no-install-recommends \
g++ \
@nbari
nbari / vm-resize-hard-disk.md
Created December 17, 2015 09:38 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@nbari
nbari / fanout.go
Last active January 19, 2016 13:14
Fan-Out golang
package main
import (
"fmt"
"sync"
"time"
)
type myStruct struct {
key int
@nbari
nbari / observer.go
Last active January 19, 2016 15:21
observer pattern in go
package main
import (
"fmt"
"sync"
"time"
)
type Producer struct {
chs []chan<- int
@nbari
nbari / email_test.go
Created January 22, 2016 23:21 — forked from tmichel/email_test.go
Sending and testing email in Go -- appendix
package email
import (
"net/smtp"
"testing"
)
type EmailConfig struct {
Username string
Password string
@nbari
nbari / Makefile
Created January 25, 2016 12:00
make & gnumake compatible
.PHONY: all test
all: test
test:
@if test -n "${BRANCH}"; then \
if test "${BRANCH}" = "master"; then echo "build master"; fi; \
fi;
score-api:
url: http://127.0.0.1:8000/_healtcheck_
expect:
status: 200
if_not:
cmd: sv restart /service/score-api
notify: "your@team"
@nbari
nbari / udpProxy.go
Created March 18, 2016 14:51 — forked from mike-zhang/udpProxy.go
Implementation of a UDP proxy in Golang
// Implementation of a UDP proxy
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
@nbari
nbari / proxy.go
Created March 20, 2016 09:28 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
Hardware : MT6582 (MT8382 is Fake!)
Model : GEN610
Build number : MT83X2_MR606_MZ6062H6CW1.2015092114
Build date UTC : 20150921-065038
Android v : 4.4.2
Baseband v: MOLY.WR8.W1315.MD.WG.MP.V35.P4, 2015/03/31 10:32
Kernel v : 3.4.67 (lyl@elink103) (gcc version 4.7 (GCC) ) #1 SMP Mon Sep 21 14:47:33 CST 2015