This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" | |
alias ls='ls --color' | |
alias ll='ls -l' | |
export SCALA_HOME='/Users/zhen/Downloads/scala-2.10.4' | |
export PATH=$SCALA_HOME/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " use vim defaults | |
set ls=2 " allways show status line | |
set expandtab " use space to replace tab | |
set tabstop=4 " numbers of spaces of tab character | |
set shiftwidth=4 " numbers of spaces to (auto)indent | |
set scrolloff=3 " keep 3 lines when scrolling | |
set showcmd " display incomplete commands | |
set hlsearch " highlight searches | |
set incsearch " do incremental searching | |
set ruler " show the cursor position all the time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# status bar | |
set-option -g status-utf8 on | |
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
set-option -g status-attr default | |
# set window split |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 依赖环境 | |
0. 两个程序运行都需要 java 环境, 运行 `java -version` 确保 java 版本是 1.6 以上. | |
1. 这个系统涉及到两台机器: a) 前端 access log 所在的机器:FE b) 后端实时计算机器: BE | |
2. 日志收集程序 `flume` 安装在 FE 机器上, 数据库 `mongodb` 和 `spark` 安装在 BE 机器上. | |
## 安装数据库 mongodb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function screenssh () | |
{ | |
local username=work | |
local server='' | |
local timeout=3 | |
for server in $@; do | |
screen -S $STY -X screen ssh $username@$server | |
done | |
#sleep $timeout | |
#local cmd="screen -S $STY -X at ssh# stuff $'$password\n'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include <signal.h> | |
static long couter = 0; | |
void sigalarm(int sig) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Skip Lists: A Probabilistic Alternative to Balanced Trees */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#define SKIPLIST_MAX_LEVEL 6 | |
typedef struct snode { | |
int key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <map> | |
using namespace std; | |
struct entry { | |
entry(string k, int v, entry *n, entry *p): | |
key(k), value(v), next(n), prev(p){} | |
string key; | |
int value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <uthash.h> | |
// this is an example of how to do a LRU cache in C using uthash | |
// http://uthash.sourceforge.net/ | |
// by Jehiah Czebotar 2011 - [email protected] | |
// this code is in the public domain http://unlicense.org/ | |
#define MAX_CACHE_SIZE 100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
int main() | |
{ |
NewerOlder