Skip to content

Instantly share code, notes, and snippets.

@zhpengg
zhpengg / skip_list.c
Created June 5, 2012 07:52
skiplist implementation in c
/* 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;
@zhpengg
zhpengg / gettimeofday.c
Created July 14, 2012 06:52
gettimeofday test
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
#include <signal.h>
static long couter = 0;
void sigalarm(int sig)
{
@zhpengg
zhpengg / .bashrc
Created March 1, 2013 09:22
screenssh greate tools
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'"
## 依赖环境
0. 两个程序运行都需要 java 环境, 运行 `java -version` 确保 java 版本是 1.6 以上.
1. 这个系统涉及到两台机器: a) 前端 access log 所在的机器:FE b) 后端实时计算机器: BE
2. 日志收集程序 `flume` 安装在 FE 机器上, 数据库 `mongodb` 和 `spark` 安装在 BE 机器上.
## 安装数据库 mongodb
@zhpengg
zhpengg / .tmux.conf
Last active May 1, 2016 05:56
tmux conf
# 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
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
#!/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