Skip to content

Instantly share code, notes, and snippets.

@earoc
earoc / reader.go
Created May 14, 2019 05:16 — forked from jedy/reader.go
processes communicate with shared memory in golang
package main
// #include <stdlib.h>
// #include "wrapper.c"
import "C"
import "unsafe"
import "fmt"
func read(filename string) string {
f := C.CString(filename)
@earoc
earoc / s.go
Created May 14, 2019 05:15 — forked from jedy/s.go
在golang中传递网络socket
package main
import (
"fmt"
"net"
"os"
"bufio"
)
func main() {
@earoc
earoc / Install-VirtualBox6-on-Ubuntu18.04.md
Created March 22, 2019 09:08
Install-VirtualBox6-on-Ubuntu18.04

Install virutal box on Linux Host

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"
sudo apt install virtualbox-6.0
@earoc
earoc / aes_encryption.go
Created May 15, 2018 15:57 — forked from stupidbodo/aes_encryption.go
AES Encryption Example in Golang
// Playbook - http://play.golang.org/p/3wFl4lacjX
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
@earoc
earoc / 1_ruby_quicksort.rb
Last active May 21, 2017 14:51
Here are some things you can do with Gists in GistBox.
# Use Gists to store entire functions
class QuickSort
def self.sort!(keys)
quick(keys,0,keys.size-1)
end
private
def self.quick(keys, left, right)