Skip to content

Instantly share code, notes, and snippets.

View CMGS's full-sized avatar
🎯
Focusing

CMGS CMGS

🎯
Focusing
View GitHub Profile
@CMGS
CMGS / openssl.py
Created April 9, 2014 14:06 — forked from rixtox/openssl.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@CMGS
CMGS / nutcracker_tester.go
Created August 17, 2014 03:03
benchmark nutcracker
package main
import (
"code.google.com/p/go-uuid/uuid"
"flag"
"fmt"
"github.com/garyburd/redigo/redis"
"strings"
"sync"
"time"
@CMGS
CMGS / t.go
Created September 24, 2014 02:53
dynamic set
f := func(opts docker.PushImageOptions, auth docker.AuthConfiguration) error { return nil }
f1 := client.PushImage
v1 := reflect.ValueOf(&(f1)).Elem()
v := reflect.ValueOf(f)
v1.Set(v)
log.Println(client.PushImage(docker.PushImageOptions{}, docker.AuthConfiguration{}))
@CMGS
CMGS / a.go
Created September 24, 2014 07:28
reflect
package main
import (
"fmt"
"github.com/fsouza/go-dockerclient"
"reflect"
)
type Test struct {
*docker.Client
@CMGS
CMGS / proxy.rs
Created November 21, 2014 01:04
proxy
use std::io::TcpListener;
use std::io::{Acceptor, Listener};
fn main() {
let listener = TcpListener::bind("0.0.0.0", 9999);
let mut acceptor = listener.listen();
for stream in acceptor.incoming() {
match stream {
Err(e) => println!("connect failed, {}", e),
@CMGS
CMGS / s.log
Created December 22, 2014 06:57
4110 --- SIGCHLD (Child exited) @ 0 (0) ---
4109 --- SIGCHLD (Child exited) @ 0 (0) ---
4108 --- SIGCHLD (Child exited) @ 0 (0) ---
4113 --- SIGCHLD (Child exited) @ 0 (0) ---
4112 --- SIGCHLD (Child exited) @ 0 (0) ---
4108 --- SIGCHLD (Child exited) @ 0 (0) ---
4115 --- SIGCHLD (Child exited) @ 0 (0) ---
4108 --- SIGCHLD (Child exited) @ 0 (0) ---
4108 --- SIGCHLD (Child exited) @ 0 (0) ---
4108 --- SIGCHLD (Child exited) @ 0 (0) ---
@CMGS
CMGS / gist:b56b7d3f121cc3be7045
Created December 26, 2014 03:50
nginx conf
user root;
worker_processes 8;
daemon off;
error_log /root/error.log;
pid /root/nginx.pid;
events {
worker_connections 102400;
multi_accept on;
package main
import (
"fmt"
"net"
"os"
"syscall"
"github.com/docker/libcontainer/netlink"
"github.com/docker/libcontainer/system"
@CMGS
CMGS / 1.go
Created May 18, 2015 02:14
各种测试
package main
import (
"fmt"
"net"
"os"
"runtime"
"github.com/docker/libcontainer/netlink"
)
@CMGS
CMGS / 1.go
Last active August 29, 2015 14:21
falcon test
package main
import (
"fmt"
"time"
"github.com/open-falcon/agent/g"
"github.com/open-falcon/common/model"
)