Skip to content

Instantly share code, notes, and snippets.

View laiwei's full-sized avatar
🎯
Focusing

Vicla laiwei

🎯
Focusing
View GitHub Profile
@laiwei
laiwei / screenrc
Created February 21, 2012 09:50
screenrc
##display status line
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
##my key binding
### ^a ' ' 自动进入copy/scroll模式,方便滚动,复制
@laiwei
laiwei / vimrc
Created February 21, 2012 10:08
vimrc
" source /etc/vimrc
" An example for a gvimrc file.
" The commands in this are executed when the GUI is started.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2001 Sep 02
"
" To use it, copy it to
" for Unix and OS/2: ~/.gvimrc
" for Amiga: s:.gvimrc
@laiwei
laiwei / bashrc
Created February 21, 2012 10:10
bashrc
# some more ls aliases
alias ll='ls -lF'
alias la='ls -A'
alias l='ls -CF'
alias j="jobs"
alias findpy='find -name "*.py"'
alias diff='colordiff'
alias svndiff='svn diff --diff-cmd=colordiff'
@laiwei
laiwei / perf_counter.md
Last active June 27, 2017 02:32
perf-counter 接口规范

Perf-Counter 数据接口规范

数据接口协议:

  • http方式
  • json格式

数据格式:

接口规范

在线查看

已经接入的数据示例

hbase metrics

@laiwei
laiwei / pyweb.md
Created April 8, 2013 07:50
python web dev

python web 开发

先学习python

div into python -- 中文版本

div into python 这是一本python入门的小书,非常经典,不用花太久就能读完,然后就能开始着手写代码了!

body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
# vmc update is great for test and development, however it stops your old app and stages and starts the new one,
# resulting in dropped requests.
# If you want to update an application without dropping user requests, see below.
# NOTE: This change assumes your application can share services, etc with the new version.
# Assume my app is named foo
vmc push foo-v2 --url foov2.cloudfoundry.com
@laiwei
laiwei / 60_stats_per_cpu_core.py
Created June 30, 2015 09:48
open-falcon plugin stats per cpu core
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import time, os, socket
import json
metric = ['usr', 'nice', 'sys', 'idle', 'iowait', 'irq', 'soft', 'steal', 'guest']
host = socket.gethostname()
def get_cpu_core_stat(num):