Skip to content

Instantly share code, notes, and snippets.

View CMGS's full-sized avatar
🎯
Focusing

CMGS CMGS

🎯
Focusing
View GitHub Profile
@CMGS
CMGS / vimrc
Last active July 15, 2017 09:56
vimrc
set autoindent
set hlsearch
set background=dark
set backspace=indent,eol,start
set cin
set encoding=utf-8
let &termencoding=&encoding
" 设置文字编码自动识别
set fileencodings=ucs-bom,utf-8,gbk,big5
set ambiwidth=double
@CMGS
CMGS / .vimrc
Created April 18, 2016 10:03
vimrc
set autoindent
set hlsearch
set background=dark
set backspace=indent,eol,start
set cin
set encoding=utf-8
let &termencoding=&encoding
" 设置文字编码自动识别
set fileencodings=ucs-bom,utf-8,gbk,big5
set ambiwidth=double
@CMGS
CMGS / tmp
Created January 13, 2016 10:11
# Generated by confd
include "bird_aggr.cfg";
include "bird_ipam.cfg";
router id {{getenv "IP"}};
{{define "LOGGING"}}
{{$node_logging_key := printf "/host/%s/loglevel" (getenv "HOSTNAME")}}{{if exists $node_logging_key}}{{$logging := getv $node_logging_key}}
{{if eq $logging "debug"}} debug all;{{else if ne $logging "none"}} debug { states };{{end}}
{{else if exists "/global/loglevel"}}{{$logging := getv "/global/loglevel"}}
@CMGS
CMGS / b.py
Created November 3, 2015 03:24
# coding: utf-8
import gevent
from gevent import monkey; monkey.patch_all()
import time
from requests import Session
ans = {
u'92和160哪个数大?(请填数值)':'160', \
u'55和200哪个数大?(请填数值)':'200', \
u'700和222哪个数大?(请填数值)':'700', \
@CMGS
CMGS / a.conf.jinja
Last active November 2, 2015 08:25
conf
worker_processes {{worker_processes}};
error_log stderr info;
events {
worker_connections {{worker_connections}};
}
daemon off;
@CMGS
CMGS / redis.lua
Created November 2, 2015 07:40 — forked from moonbingbing/redis.lua
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "table.new")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
end
local _M = new_tab(0, 155)
@CMGS
CMGS / wtf.c
Created October 27, 2015 15:42
launch
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
@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"
)
@CMGS
CMGS / 1.go
Created May 18, 2015 02:14
各种测试
package main
import (
"fmt"
"net"
"os"
"runtime"
"github.com/docker/libcontainer/netlink"
)
package main
import (
"fmt"
"net"
"os"
"syscall"
"github.com/docker/libcontainer/netlink"
"github.com/docker/libcontainer/system"