This commit is contained in:
light jiang 2018-12-17 18:10:33 +08:00
parent 051d1db55d
commit 9aed47964e
10 changed files with 279 additions and 33 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.idea .idea
*.pyc *.pyc
.vscode/ .vscode/
.tags

View File

@ -1,33 +1,35 @@
# 如何迁移git项目 # 如何迁移git项目
#### Create a new repository
``` bash - git remote set-url origin ************(项目地址)
git clone *************.git - git push
cd existing_repo
```bash
#Git global setup
git config --global user.name "light"
git config --global user.email "1870499383@qq.com"
#Create a new repository
git clone git@git.vueadmin.com:light/test.git
cd test
touch README.md touch README.md
git add README.md git add README.md
git commit -m "add README" git commit -m "add README"
git push -u origin master git push -u origin master
```
#### Existing folder #Existing folder
``` bash
cd existing_folder cd existing_folder
git init git init
git remote add origin *************.git git remote add origin git@git.vueadmin.com:light/test.git
git add . git add .
git commit -m "Initial commit" git commit -m "Initial commit"
git push -u origin master git push -u origin master
```
#### Existing Git repository #Existing Git repository
```bash
cd existing_repo cd existing_repo
git remote rename origin old-origin git remote rename origin old-origin
git remote add origin *************.git git remote add origin git@git.vueadmin.com:light/test.git
git push -u origin --all git push -u origin --all
git push -u origin --tags git push -u origin --tags
``` ```

View File

@ -1,4 +1,16 @@
# git command
## 强制拉取
``` bash:
git submodule update --init --recursive git submodule update --init --recursive
git fetch --all git fetch --all
git reset --hard origin/master git reset --hard origin/master
git pull git pull
```
## 统计代码量
```bash
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
```

47
openstack/ip.md Normal file
View File

@ -0,0 +1,47 @@
# openstack ip conf
## mysql
```bash
# /etc/mysql/mariadb.conf.d/99-openstack.cnf
bind-address = controller
```
## memcache
```bash
# /etc/memcached.conf
-l controller
```
## etcd
```bash
# /etc/default/etcd
ETCD_NAME="controller"
ETCD_DATA_DIR="/var/lib/etcd"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER="controller=http://controller:2380"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://controller:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://controller:2379"
ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
ETCD_LISTEN_CLIENT_URLS="http://controller:2379"
```
## nova
```bash
# /etc/nova/nova.conf
[DEFAULT]
# ...
my_ip = local_ip (be set on contorller and compute)
```

62
openstack/neutron.md Normal file
View File

@ -0,0 +1,62 @@
# neutron 配置网络
## flat
用于配置外部网络
> https://blog.csdn.net/CloudMan6/article/details/52529828
```bash
# /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
tenant_network_types = flat
[ml2_type_flat]
flat_networks=default
#flat_networks = flat1,flat2
[linux_bridge]
physical_interface_mappings=default:eth1
#physical_interface_mappings = flat1:eth1,flat2:eth2
```
## vxlan
用于配置用户虚拟网络
> https://blog.csdn.net/CloudMan6/article/details/53082157
```bash
# /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
tenant_network_types = vxlan
vni_ranges = 1001 - 2000
# on controler
[vxlan]
l2_population = true
local_ip = controller_ip
enable_vxlan = true
# on compute
[vxlan]
l2_population = true
local_ip = compute_ip
enable_vxlan = true
```

View File

@ -1,6 +1,22 @@
# virtualenv not # virtualenv not
```bash
pip install virtualenv
pip install virtualenvwrapper
```
> virtualenv -p /usr/bin/python3 --system-site-packages venv > virtualenv -p /usr/bin/python3 --system-site-packages venv
> virtualenv -p /usr/bin/python2 --no-site-packages env > virtualenv -p /usr/bin/python2 --no-site-packages env
```bash
# .zshrc
WORKON_HOME=~/.virtualenv
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv rospy2 -p /usr/bin/python
```

23
ros/env.md Normal file
View File

@ -0,0 +1,23 @@
# ros base env
## use py3 with ros
```bash
source ...../python3
pip install catkin_pkg pyyaml empy rospkg numpy
mkdir -p catkin_ws/src # 用户开发目录
cd catkin_ws
catkin_make
cd ~
mkdir -p catkin_base/src # 第三方包编译目录
cd catkin_base/src
git clone https://github.com/ros/geometry
git clone https://github.com/ros/geometry2
cd ..
catkin_make
```

22
ros/errors.md Normal file
View File

@ -0,0 +1,22 @@
# errors
### error1
```bash
-- +++ processing catkin package: 'tf2_bullet'
-- ==> add_subdirectory(geometry2/tf2_bullet)
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'bullet'
-- No package 'bullet' found
CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:532 (_pkg_check_modules_internal)
geometry2/tf2_bullet/CMakeLists.txt:7 (pkg_check_modules)
```
> sudo apt install libbullet-dev

13
ubuntu/interface.md Normal file
View File

@ -0,0 +1,13 @@
# /etc/network/interface 配置
## static ip
``` bash
auto eth0
iface eth0 inet static
address 192.168.2.34
netmask 255.255.255.0
gateway 192.0.2.254
dns-nameservers 114.114.114.114
```

View File

@ -1,9 +1,54 @@
nnoremap <leader>[ :bp<CR>
nnoremap <leader>] :bn<CR>
" 映射<leader>num到num buffer
"nmap <tab> :bn<cr>
map <leader>1 :b 1<CR>
map <leader>2 :b 2<CR>
map <leader>3 :b 3<CR>
map <leader>4 :b 4<CR>
map <leader>5 :b 5<CR>
map <leader>6 :b 6<CR>
map <leader>7 :b 7<CR>
map <leader>8 :b 8<CR>
map <leader>9 :b 9<CR>
map q :bwipeout<CR>
nmap J 5j
nmap K 5k
nmap H 5h
nmap L 5l
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
" 在文件外修改时自动加载 " 在文件外修改时自动加载
set autoread set autoread
" make 项目 " make 项目
autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr> autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
if &filetype == 'c'
exec '!g++ % -o %<'
exec '!time ./%<'
elseif &filetype == 'cpp'
exec '!g++ % -o %<'
exec '!time ./%<'
elseif &filetype == 'python'
exec '!time python %'
elseif &filetype == 'sh'
:!time bash %
elseif &filetype == 'go'
exec 'GoRun'
endif
endfunc
"从不备份 "从不备份
set nobackup set nobackup
@ -49,6 +94,11 @@ set nobackup
set noswapfile set noswapfile
"搜索忽略大小写 "搜索忽略大小写
set ignorecase set ignorecase
" 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感
set ignorecase
set smartcase
"搜索逐字符高亮 "搜索逐字符高亮
set hlsearch set hlsearch
set incsearch set incsearch
@ -90,8 +140,16 @@ set whichwrap+=<,>,h,l
map <space>ma :set mouse=a<CR>:set nu<CR>:set nopaste<CR> map <space>ma :set mouse=a<CR>:set nu<CR>:set nopaste<CR>
map <space>mc :set mouse=c<CR>:set nu!<CR>:set paste<CR> map <space>mc :set mouse=c<CR>:set nu!<CR>:set paste<CR>
set mouse=a set mouse=a
set selection=exclusive
set selectmode=mouse,key " 选中状态下 Ctrl+c 复制
vnoremap <c-c> "+y
" Ctrl+v
"nmap <silent> <C-v> "+p
"set selection=exclusive
"set selectmode=mouse,key
" 通过使用: commands命令告诉我们文件的哪一行被改变过 " 通过使用: commands命令告诉我们文件的哪一行被改变过
set report=0 set report=0
" 在被分割的窗口间显示空白,便于阅读 " 在被分割的窗口间显示空白,便于阅读
@ -106,22 +164,6 @@ set scrolloff=3
set smartindent set smartindent
" 高亮显示普通txt文件需要txt.vim脚本 " 高亮显示普通txt文件需要txt.vim脚本
au BufRead,BufNewFile * setfiletype txt au BufRead,BufNewFile * setfiletype txt
"自动补全
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
":inoremap { {<CR>}<ESC>O
":inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endfunction
filetype plugin indent on filetype plugin indent on
"打开文件类型检测, 加了这句才可以用智能补全 "打开文件类型检测, 加了这句才可以用智能补全
set completeopt=longest,menu set completeopt=longest,menu
@ -146,3 +188,9 @@ if has("autocmd")
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces() autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces()
endif endif
colorscheme slate
highlight Comment ctermfg=blue
au BufNewFile,BufRead *.launch,*.urdf set filetype=xml