Skip to content

Instantly share code, notes, and snippets.

View leonlee's full-sized avatar
🎯
Focusing

Leon Lee leonlee

🎯
Focusing
  • ACAR
  • Beijing
View GitHub Profile
"vundle pre-config
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"vundle bundles & plugins
Plugin 'VundleVim/Vundle.vim'
Bundle 'tpope/vim-endwise'
Bundle 'tpope/vim-git'
@leonlee
leonlee / iptableflip.sh
Created March 31, 2016 11:06 — forked from lewisd32/iptableflip.sh
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
let mapleader=";"
noremap j 3j
noremap k 3k
noremap J <C-d>
noremap K <C-u>
map <Leader>s :stop<cr>
noremap h gT
noremap l gt
map < <C-6>
@leonlee
leonlee / vim.markdown
Created March 7, 2016 11:57 — forked from socketwiz/vim.markdown
Vim cheat sheet

##motions

motion description
h Count characters left
l Count characters right
^ To the first character of the line
$ To the last character of the line
f<char> To the counth character occurrence to the right. F<char> to the counth character occurrence to the left
t<char> To 1 character just before the counth character occurrence to the right
T<char> To 1 character just before the counth character occurrence to the left
docker run -d --net=host \
-e MARATHON_ENDPOINT=http://192.168.1.212:8080 \
-e BAMBOO_ENDPOINT=http://192.168.1.212:8000 \
-e BAMBOO_ZK_HOST=192.168.1.212:2181 \
-e BAMBOO_ZK_PATH=/bb_gateway \
-e BIND=":8000" \
-e CONFIG_PATH="config/production.gateway.json" \
--name omega-bamboo-gateway \
testregistry.dataman.io/bamboo-0.2.14:omega.v0.4
docker run -d --net=host \
-e MARATHON_ENDPOINT=http://192.168.1.212:8080 \
-e BAMBOO_ENDPOINT=http://192.168.1.212:8001 \
-e BAMBOO_ZK_HOST=192.168.1.212:2181 \
-e BAMBOO_ZK_PATH=/bb_proxy \
-e BIND=":8001" \
-e CONFIG_PATH="config/production.proxy.json" \
--name omega-bamboo-proxy \
testregistry.dataman.io/bamboo-0.2.14:omega.v0.4
#bamboo-centos:v0.1
docker run -d --net=host \
-e MARATHON_ENDPOINT=http://192.168.1.212:8080 \
-e BAMBOO_ENDPOINT=http://192.168.1.212:8001 \
-e BAMBOO_ZK_HOST=192.168.1.212:2181 \
-e BAMBOO_ZK_PATH=/bb_proxy \
-e BIND=":8001" \
-e CONFIG_PATH="config/production.proxy.json" \
--name omega-bamboo-proxy \
testregistry.dataman.io/bamboo-0.2.14:omega.v0.4
#bamboo-centos:v0.1
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)
sudo killall -9 networkd
---
numCPU: 1
host: "localhost"
port: 6080
debugging: false
log:
console: true
file: "./omega-app.log"
level: "debug"
formatter: "%Date(2006-01-02 15:04:05Z07:00) [%LEVEL] %Msg%n"