diff --git a/.gitignore b/.gitignore index 9498627..8a1650a 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea *.pyc -.vscode/ \ No newline at end of file +.vscode/ +.tags diff --git a/git/change_repo.md b/git/change_repo.md index a0c5472..d9cea61 100755 --- a/git/change_repo.md +++ b/git/change_repo.md @@ -1,33 +1,35 @@ # 如何迁移git项目 -#### Create a new repository -``` bash -git clone *************.git -cd existing_repo +- git remote set-url origin ************(项目地址) +- git push + + +```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 git add README.md git commit -m "add README" git push -u origin master -``` -#### Existing folder - -``` bash +#Existing folder cd existing_folder git init -git remote add origin *************.git +git remote add origin git@git.vueadmin.com:light/test.git git add . git commit -m "Initial commit" git push -u origin master -``` -#### Existing Git repository - -```bash +#Existing Git repository cd existing_repo 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 --tags ``` \ No newline at end of file diff --git a/git/command.md b/git/command.md index cdb7b87..625802d 100644 --- a/git/command.md +++ b/git/command.md @@ -1,4 +1,16 @@ +# git command + +## 强制拉取 + +``` bash: git submodule update --init --recursive git fetch --all git reset --hard origin/master 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 +``` diff --git a/openstack/ip.md b/openstack/ip.md new file mode 100644 index 0000000..d4b3233 --- /dev/null +++ b/openstack/ip.md @@ -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) + +``` diff --git a/openstack/neutron.md b/openstack/neutron.md new file mode 100644 index 0000000..6eff55a --- /dev/null +++ b/openstack/neutron.md @@ -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 + + + + +``` + diff --git a/python/virtualenv.md b/python/virtualenv.md index 8a991e2..2643020 100755 --- a/python/virtualenv.md +++ b/python/virtualenv.md @@ -1,6 +1,22 @@ # virtualenv not +```bash +pip install virtualenv +pip install virtualenvwrapper +``` > virtualenv -p /usr/bin/python3 --system-site-packages venv > 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 + +``` diff --git a/ros/env.md b/ros/env.md new file mode 100644 index 0000000..85644e7 --- /dev/null +++ b/ros/env.md @@ -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 + +``` diff --git a/ros/errors.md b/ros/errors.md new file mode 100644 index 0000000..c555e83 --- /dev/null +++ b/ros/errors.md @@ -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 diff --git a/ubuntu/interface.md b/ubuntu/interface.md new file mode 100644 index 0000000..46536d5 --- /dev/null +++ b/ubuntu/interface.md @@ -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 +``` diff --git a/vim/clean.vimrc b/vim/clean.vimrc index d700a87..1053751 100644 --- a/vim/clean.vimrc +++ b/vim/clean.vimrc @@ -1,9 +1,54 @@ +nnoremap [ :bp +nnoremap ] :bn +" 映射num到num buffer +"nmap :bn +map 1 :b 1 +map 2 :b 2 +map 3 :b 3 +map 4 :b 4 +map 5 :b 5 +map 6 :b 6 +map 7 :b 7 +map 8 :b 8 +map 9 :b 9 +map q :bwipeout + +nmap J 5j +nmap K 5k +nmap H 5h +nmap L 5l + +nnoremap h +nnoremap l +nnoremap j +nnoremap k + + + " 在文件外修改时自动加载 set autoread " make 项目 autocmd FileType c,cpp map :w:make +map :call CompileRunGcc() + +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 @@ -49,6 +94,11 @@ set nobackup set noswapfile "搜索忽略大小写 set ignorecase +" 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感 +set ignorecase +set smartcase + + "搜索逐字符高亮 set hlsearch set incsearch @@ -90,8 +140,16 @@ set whichwrap+=<,>,h,l map ma :set mouse=a:set nu:set nopaste map mc :set mouse=c:set nu!:set paste set mouse=a -set selection=exclusive -set selectmode=mouse,key + +" 选中状态下 Ctrl+c 复制 +vnoremap "+y + +" Ctrl+v +"nmap "+p + + +"set selection=exclusive +"set selectmode=mouse,key " 通过使用: commands命令,告诉我们文件的哪一行被改变过 set report=0 " 在被分割的窗口间显示空白,便于阅读 @@ -106,22 +164,6 @@ set scrolloff=3 set smartindent " 高亮显示普通txt文件(需要txt.vim脚本) au BufRead,BufNewFile * setfiletype txt -"自动补全 -:inoremap ( ()i -:inoremap ) =ClosePair(')') -":inoremap { {}O -":inoremap } =ClosePair('}') -:inoremap [ []i -:inoremap ] =ClosePair(']') -:inoremap " ""i -:inoremap ' ''i -function! ClosePair(char) - if getline('.')[col('.') - 1] == a:char - return "\" - else - return a:char - endif -endfunction filetype plugin indent on "打开文件类型检测, 加了这句才可以用智能补全 set completeopt=longest,menu @@ -146,3 +188,9 @@ if has("autocmd") autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces() endif + +colorscheme slate +highlight Comment ctermfg=blue + + +au BufNewFile,BufRead *.launch,*.urdf set filetype=xml