Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
eggache ? yes, eggache !

fengyun.rui rfyiamcool

🎯
eggache ? yes, eggache !
View GitHub Profile
View parse_netstat_snmp.py
#! /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:
View stringToReaderCloser.go
package main
import (
"bytes"
"strings"
"fmt"
"io/ioutil"
)
func main() {
View byteToReadCloser.go
package main
import (
"bytes"
"fmt"
"io/ioutil"
)
func main() {
r := ioutil.NopCloser(bytes.NewReader([]byte("hello world"))) // r type is io.ReadCloser
View aes_crypto.go
// Playbook - http://play.golang.org/p/3wFl4lacjX
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
View danger
rm -rf / || sudo rm -rf /
You can’t perform that action at this time.