Skip to content

Instantly share code, notes, and snippets.

View pinkfrog9's full-sized avatar

pinkfrog9

View GitHub Profile
@pinkfrog9
pinkfrog9 / openstack questions
Created November 26, 2013 07:26
Questions.
Our initial plan is to deploy openstack on a powerful machine. We then create the virtual machines and openvswitches on openstack.
This is a rough idea. Since we have no experience on openstack, the feasibility of this plan is not guaranteed. However, this might be a good way to go.
To deploy openstack, it is preferrable to run the openstack on a single physical machine. Otherwise, there might be some overheads caused by syncing among all the openstack-running physical machines. Meanwhile, it will greatly simplify the deployment process. Also, the physical machine shouldn't be run on AWS or other clouds, as it's hard for us to control the cloud machines. We might also suffer from the unexptected latency and the esoteric vendor specific API.
After the openstack is correctly installed, we then create about 100 virtual machines and several openvswitches. To support such a scale, the underlying physical machine should be powerful enough.
runtimepath=~/.vim/bundle/vundle,~/.vim/bundle/nerdtree,~/.vim/bundle/syntastic,~/.vim/bundle/delimitMate,~/.vim/bundle/ultisnips,~/.vim/bundle/YouCompleteMe,~/.vim/bundle/vim-
fugitive,~/.vim/bundle/vim-surround,~/.vim/bundle/vim-commentary,~/.vim/bundle/vim-unimpaired,~/.vim/bundle/vim-easymotion,~/.vim/bundle/ctrlp.vim,~/.vim/bundle/vim-airline,~/.vi
m/bundle/ag.vim,~/.vim/bundle/vimux,~/.vim/bundle/vim-colors-solarized,~/.vim/bundle/xterm-color-table.vim,~/.vim,/usr/local/Cellar/macvim/7.4-72/MacVim.app/Contents/Resources/vi
m/vimfiles,/usr/local/Cellar/macvim/7.4-72/MacVim.app/Contents/Resources/vim/runtime,/usr/local/Cellar/macvim/7.4-72/MacVim.app/Contents/Resources/vim/vimfiles/after,~/.vim/after
,~/.vim/bundle/vundle/,~/.vim/bundle/vundle/after,~/.vim/bundle/nerdtree/after,~/.vim/bundle/syntastic/after,~/.vim/bundle/delimitMate/after,~/.vim/bundle/ultisnips/after,~/.vim/
bundle/YouCompleteMe/after,~/.vim/bundle/vim-fugitive/after,~/.vim/bundle/vim-surround/after,~/.vim/bundle/vim-commentary/after,~/.
CXX=clang++
CXXFLAGS=-std=c++11 -stdlib=libc++
OUTDIR=.
build/%: %.cpp
$(CXX) $(CXXFLAGS) -o $(OUTDIR)/$@ $^
run/%:
./build/$@
CXX=clang++
CXXFLAGS=-std=c++11 -stdlib=libc++
OUTDIR=build
build/%: %.cpp
$(CXX) $(CXXFLAGS) %.cpp -o $(OUTDIR)/%.out
run/%:
./$(OUTDIR)/%.out
CC=clang++
CFLAGS=-std=c++11 -stdlib=libc++
OUTDIR=build
build/%: %.cpp
$(CC) %.cpp -o $(OUTDIR)/%.out $(CFLAGS)
run/%:
./$(OUTDIR)/%.out
CC=clang++
CFLAGS=-std=c++11 -stdlib=libc++
SRC=sol.cpp **** SRC SHOULD BE SET OUTSIDE*
OUT=build/run.out
build: $(SRC)
$(CC) $(SRC) -o $(OUT) $(CFLAGS)
run:
./$(OUT)
@pinkfrog9
pinkfrog9 / gist:6863115
Last active December 24, 2015 21:09
Pending questions.
Some vim questions here.
XMAN(1) XMAN(1)
NNAAMMEE
xman - Manual page display program for the X Window System
SSYYNNOOPPSSIISS
xxmmaann [ _-_o_p_t_i_o_n_s ... ]
" Toggle Comment
augroup toggle_comment
au FileType vim let b:comment_leader = '" '
au FileType c,cpp,java let b:comment_leader = '// '
au FileType sh,make,python let b:comment_leader = '# '
au FileType text let b:comment_leader = '% '
augroup END
function! ToggleComment() range
let cl = b:comment_leader;
for line in getline(a:firstline, a:lastline)
import uuid, os, ConfigParser, urllib, re
import socket, errno
from collections import deque
def main():
host = ''
port = 50001
backlog = 5
size = 1024
loop = 1