From 051d1db55d2a0a67782dfe29c94dd8b878d3c52e Mon Sep 17 00:00:00 2001 From: light jiang Date: Mon, 17 Dec 2018 18:09:45 +0800 Subject: [PATCH 1/6] update vim ocnf --- vim/vimrc | 64 +++++----- vim/ycm_extra_conf.py | 284 ++++++++++++++++++++++++++++++------------ 2 files changed, 237 insertions(+), 111 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 11b2ebf..fbf82ff 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,5 +1,7 @@ " set the runtime path to include Vundle and initialize set rtp+=~/.fzf/ +set nocompatible +filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() @@ -7,8 +9,8 @@ Plugin 'VundleVim/Vundle.vim' Plugin 'junegunn/fzf.vim' -nmap l :BLines -nmap L :Lines +nmap l :BLines +nmap L :Lines Plugin 'rking/ag.vim' @@ -66,8 +68,8 @@ Plugin 'https://github.com/tpope/vim-fugitive.git' Plugin 'airblade/vim-gitgutter' set updatetime=100 -Plugin 'https://github.com/plytophogy/vim-virtualenv.git' -let g:virtualenv_directory = '~/.virtualenv' +"Plugin 'https://github.com/plytophogy/vim-virtualenv.git' +"let g:virtualenv_directory = '~/.virtualenv' Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown' @@ -78,22 +80,20 @@ Plugin 'Valloric/YouCompleteMe' set runtimepath+=~/.vim/bundle/YouCompleteMe autocmd InsertLeave * if pumvisible() == 0|pclose|endif "离开插入模式后自动关闭预览窗口" let g:ycm_collect_identifiers_from_tags_files = 1 " 开启 YCM基于标签引擎 -let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释与字符串中的内容也用于补全 "let g:syntastic_ignore_files=[".*\.py$"] let g:ycm_seed_identifiers_with_syntax = 1 " 语法关键字补全 -let g:ycm_complete_in_comments = 1 let g:ycm_confirm_extra_conf = 0 " 关闭加载.ycm_extra_conf.py提示 let g:ycm_key_list_select_completion = ['', ''] " 映射按键,没有这个会拦截掉tab, 导致其他插件的tab不能用. let g:ycm_key_list_previous_completion = ['', ''] let g:ycm_complete_in_comments = 1 " 在注释输入中也能补全 let g:ycm_complete_in_strings = 1 " 在字符串输入中也能补全 let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释和字符串中的文字也会被收入补全 -"let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py' -let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py' +let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py' +"let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py' let g:ycm_show_diagnostics_ui = 0 " 禁用语法检查 "inoremap pumvisible() ? "\" : "\" " 回车即选中当前项 nnoremap :YcmCompleter GoToDefinitionElseDeclaration " 跳转到定义处 -let g:ycm_min_num_of_chars_for_completion=2 +let g:ycm_min_num_of_chars_for_completion=2 "python auto complete plugin Bundle 'davidhalter/jedi-vim' @@ -109,6 +109,12 @@ let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.launch' Plugin 'jiangmiao/auto-pairs' +Plugin 'Chiel92/vim-autoformat' +noremap :Autoformat:w +let g:autoformat_verbosemode=1 + + + Plugin 'vim-airline/vim-airline' Plugin 'vim-airline-themes' let g:airline_theme='bubblegum' @@ -143,26 +149,26 @@ map 8 :b 8 map 9 :b 9 map q :bwipeout -nmap J 5j -nmap K 5k -nmap H 5h -nmap L 5l +nmap J 5j +nmap K 5k +nmap H 5h +nmap L 5l -nnoremap h -nnoremap l -nnoremap j -nnoremap k +nnoremap h +nnoremap l +nnoremap j +nnoremap k -" ctags 配置 +" ctags 配置 map :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages=Python,C++ -f .tags . imap :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages=Python,C++ -f .tags . set tags=tags set tags+=.tags set tags+=./.tags "set tags+=~/.vim/systags -"set tags = +"set tags = Plugin 'https://github.com/majutsushi/tagbar.git' "ctags 配置:F3快捷键显示程序中的各种tags,包括变量和函数等。 @@ -173,7 +179,7 @@ Plugin 'The-NERD-tree' let NERDTreeIgnore=['\.pyc','\~$','\.swp'] "NERDTree 配置:F2快捷键显示当前目录树 map :NERDTreeToggle -let NERDTreeWinSize=25 +let NERDTreeWinSize=25 Plugin 'tiagofumo/vim-nerdtree-syntax-highlight' Plugin 'Xuyuanp/nerdtree-git-plugin' "Plugin 'ryanoasis/vim-devicons' @@ -221,7 +227,7 @@ func! CompileRunGcc() exec '!g++ % -o %<' exec '!time ./%<' elseif &filetype == 'cpp' - exec '!g++ % -o %<' + exec '!g++ % -o %< -lboost_system' exec '!time ./%<' elseif &filetype == 'python' exec '!time python %' @@ -276,9 +282,9 @@ set nobackup set noswapfile "搜索忽略大小写 set ignorecase -" 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感 -set ignorecase -set smartcase +" 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感 +set ignorecase +set smartcase "搜索逐字符高亮 @@ -324,9 +330,9 @@ map mc :set mouse=c:set nu!:set paste set mouse=a " 选中状态下 Ctrl+c 复制 -vnoremap "+y - -" Ctrl+v +vnoremap "+y + +" Ctrl+v "nmap "+p @@ -345,7 +351,7 @@ set scrolloff=3 " 为C程序提供自动缩进 set smartindent " 高亮显示普通txt文件(需要txt.vim脚本) - au BufRead,BufNewFile * setfiletype txt +au BufRead,BufNewFile * setfiletype txt filetype plugin indent on "打开文件类型检测, 加了这句才可以用智能补全 set completeopt=longest,menu @@ -364,7 +370,7 @@ fun! CleanExtraSpaces() silent! %s/\s\+$//e call setpos('.', save_cursor) call setreg('/', old_query) -endfun +endfun if has("autocmd") autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces() diff --git a/vim/ycm_extra_conf.py b/vim/ycm_extra_conf.py index e6483e5..77a6223 100644 --- a/vim/ycm_extra_conf.py +++ b/vim/ycm_extra_conf.py @@ -1,102 +1,222 @@ -#!/usr/bin/env python +# This file is NOT licensed under the GPLv3, which is the license for the rest +# of YouCompleteMe. +# +# Here's the license text for this file: +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# For more information, please refer to +from distutils.sysconfig import get_python_inc +import platform import os +import subprocess import ycm_core +project_path = os.path.abspath(os.path.dirname(__file__)) +DIR_OF_THIS_SCRIPT = "/home/light/.vim/bundle/YouCompleteMe" +DIR_OF_THIRD_PARTY = os.path.join(DIR_OF_THIS_SCRIPT, 'third_party') +SOURCE_EXTENSIONS = ['.cpp', '.cxx', '.cc', '.c', '.m', '.mm'] + +# These are the compilation flags that will be used in case there's no +# compilation database set (by default, one is not set). +# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ -'-Wall', -'-Wextra', -'-Werror', -'-fexceptions', -'-DNDEBUG', -'-std=c++11', -'-x', -'c++', -'-isystem', -'/usr/include', -'-isystem', -'/usr/local/include', -'-isystem', -'/opt/ros/' + os.getenv('ROS_DISTRO') + '/include', -'-isystem', -'~/catkin_ws/devel/include', + '-Wall', + '-Wextra', + '-Werror', + '-Wno-long-long', + '-Wno-variadic-macros', + '-fexceptions', + '-DNDEBUG', + # You 100% do NOT need -DUSE_CLANG_COMPLETER and/or -DYCM_EXPORT in your flags; + # only the YCM source code needs it. + '-DUSE_CLANG_COMPLETER', + '-DYCM_EXPORT=', + # THIS IS IMPORTANT! Without the '-x' flag, Clang won't know which language to + # use when compiling headers. So it will guess. Badly. So C++ headers will be + # compiled as C headers. You don't want that so ALWAYS specify the '-x' flag. + # For a C project, you would set this to 'c' instead of 'c++'. + '-x', + 'c++', + '-isystem', + 'cpp/pybind11', + '-isystem', + 'cpp/BoostParts', + '-isystem', + get_python_inc(), + '-isystem', + 'cpp/llvm/include', + '-isystem', + 'cpp/llvm/tools/clang/include', + '-I', + 'cpp/ycm', + '-I', + 'cpp/ycm/ClangCompleter', + '-isystem', + 'cpp/ycm/tests/gmock/gtest', + '-isystem', + 'cpp/ycm/tests/gmock/gtest/include', + '-isystem', + 'cpp/ycm/tests/gmock', + '-isystem', + 'cpp/ycm/tests/gmock/include', + '-isystem', + 'cpp/ycm/benchmarks/benchmark/include', + '-isystem', + project_path + '/includes', + '-I', + project_path + '/src', ] +# Clang automatically sets the '-std=' flag to 'c++14' for MSVC 2015 or later, +# which is required for compiling the standard library, and to 'c++11' for older +# versions. +if platform.system() != 'Windows': + flags.append('-std=c++11') + + +# Set this to the absolute path to the folder (NOT the file!) containing the +# compile_commands.json file to use that instead of 'flags'. See here for +# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html +# +# You can get CMake to generate this file for you by adding: +# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 ) +# to your CMakeLists.txt file. +# +# Most projects will NOT need to set this to anything; you can just change the +# 'flags' list of compilation flags. Notice that YCM itself uses that approach. compilation_database_folder = '' -if os.path.exists( compilation_database_folder ): - database = ycm_core.CompilationDatabase( compilation_database_folder ) +if os.path.exists(compilation_database_folder): + database = ycm_core.CompilationDatabase(compilation_database_folder) else: - database = None - -SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c' ] - -def DirectoryOfThisScript(): - return os.path.dirname( os.path.abspath( __file__ ) ) + database = None -def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): - if not working_directory: - return list( flags ) - new_flags = [] - make_next_absolute = False - path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] - for flag in flags: - new_flag = flag - - if make_next_absolute: - make_next_absolute = False - if not flag.startswith( '/' ): - new_flag = os.path.join( working_directory, flag ) - - for path_flag in path_flags: - if flag == path_flag: - make_next_absolute = True - break - - if flag.startswith( path_flag ): - path = flag[ len( path_flag ): ] - new_flag = path_flag + os.path.join( working_directory, path ) - break - - if new_flag: - new_flags.append( new_flag ) - return new_flags +def IsHeaderFile(filename): + extension = os.path.splitext(filename)[1] + return extension in ['.h', '.hxx', '.hpp', '.hh'] -def IsHeaderFile( filename ): - extension = os.path.splitext( filename )[ 1 ] - return extension in [ '.h', '.hxx', '.hpp', '.hh' ] +def FindCorrespondingSourceFile(filename): + if IsHeaderFile(filename): + basename = os.path.splitext(filename)[0] + for extension in SOURCE_EXTENSIONS: + replacement_file = basename + extension + if os.path.exists(replacement_file): + return replacement_file + return filename -def GetCompilationInfoForFile( filename ): - if IsHeaderFile( filename ): - basename = os.path.splitext( filename )[ 0 ] - for extension in SOURCE_EXTENSIONS: - replacement_file = basename + extension - if os.path.exists( replacement_file ): - compilation_info = database.GetCompilationInfoForFile( - replacement_file ) - if compilation_info.compiler_flags_: - return compilation_info - return None - return database.GetCompilationInfoForFile( filename ) +def PathToPythonUsedDuringBuild(): + try: + filepath = os.path.join( + DIR_OF_THIS_SCRIPT, 'PYTHON_USED_DURING_BUILDING') + with open(filepath) as f: + return f.read().strip() + # We need to check for IOError for Python 2 and OSError for Python 3. + except (IOError, OSError): + return None -def FlagsForFile( filename, **kwargs ): - if database: - compilation_info = GetCompilationInfoForFile( filename ) - if not compilation_info: - return None +def Settings(**kwargs): + language = kwargs['language'] - final_flags = MakeRelativePathsInFlagsAbsolute( - compilation_info.compiler_flags_, - compilation_info.compiler_working_dir_ ) - else: - relative_to = DirectoryOfThisScript() - final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) + if language == 'cfamily': + # If the file is a header, try to find the corresponding source file and + # retrieve its flags from the compilation database if using one. This is + # necessary since compilation databases don't have entries for header files. + # In addition, use this source file as the translation unit. This makes it + # possible to jump from a declaration in the header file to its definition + # in the corresponding source file. + filename = FindCorrespondingSourceFile(kwargs['filename']) - return { - 'flags': final_flags, - 'do_cache': True - } + if not database: + return { + 'flags': flags, + 'include_paths_relative_to_dir': DIR_OF_THIS_SCRIPT, + 'override_filename': filename + } + + compilation_info = database.GetCompilationInfoForFile(filename) + if not compilation_info.compiler_flags_: + return {} + + # Bear in mind that compilation_info.compiler_flags_ does NOT return a + # python list, but a "list-like" StringVec object. + final_flags = list(compilation_info.compiler_flags_) + + # NOTE: This is just for YouCompleteMe; it's highly likely that your project + # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR + # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT. + try: + final_flags.remove('-stdlib=libc++') + except ValueError: + pass + + return { + 'flags': final_flags, + 'include_paths_relative_to_dir': compilation_info.compiler_working_dir_, + 'override_filename': filename + } + + if language == 'python': + return { + 'interpreter_path': PathToPythonUsedDuringBuild() + } + + return {} + + +def GetStandardLibraryIndexInSysPath(sys_path): + for index, path in enumerate(sys_path): + if os.path.isfile(os.path.join(path, 'os.py')): + return index + raise RuntimeError('Could not find standard library path in Python path.') + + +def PythonSysPath(**kwargs): + sys_path = kwargs['sys_path'] + + sys_path.insert(0, DIR_OF_THIS_SCRIPT) + + for folder in os.listdir(DIR_OF_THIRD_PARTY): + if folder == 'python-future': + folder = os.path.join(folder, 'src') + sys_path.insert(GetStandardLibraryIndexInSysPath(sys_path) + 1, + os.path.realpath(os.path.join(DIR_OF_THIRD_PARTY, + folder))) + continue + + if folder == 'cregex': + interpreter_path = kwargs['interpreter_path'] + major_version = subprocess.check_output([ + interpreter_path, '-c', 'import sys; print( sys.version_info[ 0 ] )'] + ).rstrip().decode('utf8') + folder = os.path.join(folder, 'regex_{}'.format(major_version)) + + sys_path.insert(0, os.path.realpath(os.path.join(DIR_OF_THIRD_PARTY, + folder))) + return sys_path From 9aed47964ec670155687f8a8174ed2cc994d7926 Mon Sep 17 00:00:00 2001 From: light jiang Date: Mon, 17 Dec 2018 18:10:33 +0800 Subject: [PATCH 2/6] update --- .gitignore | 3 +- git/change_repo.md | 30 ++++++++-------- git/command.md | 12 +++++++ openstack/ip.md | 47 +++++++++++++++++++++++++ openstack/neutron.md | 62 ++++++++++++++++++++++++++++++++ python/virtualenv.md | 16 +++++++++ ros/env.md | 23 ++++++++++++ ros/errors.md | 22 ++++++++++++ ubuntu/interface.md | 13 +++++++ vim/clean.vimrc | 84 ++++++++++++++++++++++++++++++++++---------- 10 files changed, 279 insertions(+), 33 deletions(-) create mode 100644 openstack/ip.md create mode 100644 openstack/neutron.md create mode 100644 ros/env.md create mode 100644 ros/errors.md create mode 100644 ubuntu/interface.md 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 From e45e80c4196ebbb5257ef8ec8f79465617c31374 Mon Sep 17 00:00:00 2001 From: light jiang Date: Thu, 27 Dec 2018 15:39:57 +0800 Subject: [PATCH 3/6] update docker openstack vim --- docker/docker.md | 10 ++++++++ docker/gitlite.md | 8 +++++++ openstack/docker.md | 7 ++++++ openstack/ovs.md | 21 +++++++++++++++++ vim/ycm_extra_conf.py | 53 ++++++------------------------------------- 5 files changed, 53 insertions(+), 46 deletions(-) create mode 100644 docker/gitlite.md create mode 100644 openstack/docker.md create mode 100644 openstack/ovs.md diff --git a/docker/docker.md b/docker/docker.md index ae28607..d43ede8 100644 --- a/docker/docker.md +++ b/docker/docker.md @@ -53,3 +53,13 @@ reboot # or relogin ``` + + + +```bash +sudo apt install docker.io +sudo systemctl start docker +sudo systemctl enable docker +sudo adduser $USER docker + +``` diff --git a/docker/gitlite.md b/docker/gitlite.md new file mode 100644 index 0000000..0923a92 --- /dev/null +++ b/docker/gitlite.md @@ -0,0 +1,8 @@ +# normal + +## add git user + +```bash +useradd -ms /bin/bash git + +``` diff --git a/openstack/docker.md b/openstack/docker.md new file mode 100644 index 0000000..f70fdfa --- /dev/null +++ b/openstack/docker.md @@ -0,0 +1,7 @@ +# deploy with docker + + +```bash +docker run -dit --privileged --cap-add=ALL --network=host --name=controller -h controller -v /lib/modules:/lib/modules openstack_base:rocky_ovs +docker run -dit --privileged --cap-add=ALL --network=host --name=compute -h compute -v /lib/modules:/lib/modules openstack_compute:rocky_ovs +``` diff --git a/openstack/ovs.md b/openstack/ovs.md new file mode 100644 index 0000000..48c08c4 --- /dev/null +++ b/openstack/ovs.md @@ -0,0 +1,21 @@ +# open vswitch + +## install + + +```bash +git clone https://github.com/openvswitch/ovs.git +cd ovs +git checkout v2.7.0 +sudo apt-get install git autoconf automake libtool openssl libssl-dev make python-six -y + +./boot.sh + +./configure + +make + +sudo make install + +sudo modprobe openvswitch +``` diff --git a/vim/ycm_extra_conf.py b/vim/ycm_extra_conf.py index 77a6223..2bc0a2b 100644 --- a/vim/ycm_extra_conf.py +++ b/vim/ycm_extra_conf.py @@ -34,9 +34,9 @@ import os import subprocess import ycm_core -project_path = os.path.abspath(os.path.dirname(__file__)) -DIR_OF_THIS_SCRIPT = "/home/light/.vim/bundle/YouCompleteMe" -DIR_OF_THIRD_PARTY = os.path.join(DIR_OF_THIS_SCRIPT, 'third_party') +# DIR_OF_THIS_SCRIPT = "/home/light/.vim/bundle/YouCompleteMe/third_party/ycmd" +# DIR_OF_THIRD_PARTY = os.path.join(DIR_OF_THIS_SCRIPT, 'third_party') +DIR_OF_THIS_SCRIPT = os.path.abspath(os.path.dirname(__file__)) SOURCE_EXTENSIONS = ['.cpp', '.cxx', '.cc', '.c', '.m', '.mm'] # These are the compilation flags that will be used in case there's no @@ -60,34 +60,12 @@ flags = [ # For a C project, you would set this to 'c' instead of 'c++'. '-x', 'c++', - '-isystem', - 'cpp/pybind11', - '-isystem', - 'cpp/BoostParts', - '-isystem', - get_python_inc(), - '-isystem', - 'cpp/llvm/include', - '-isystem', - 'cpp/llvm/tools/clang/include', '-I', - 'cpp/ycm', + '/usr/include', + '-isystem', + 'includes', '-I', - 'cpp/ycm/ClangCompleter', - '-isystem', - 'cpp/ycm/tests/gmock/gtest', - '-isystem', - 'cpp/ycm/tests/gmock/gtest/include', - '-isystem', - 'cpp/ycm/tests/gmock', - '-isystem', - 'cpp/ycm/tests/gmock/include', - '-isystem', - 'cpp/ycm/benchmarks/benchmark/include', - '-isystem', - project_path + '/includes', - '-I', - project_path + '/src', + 'src', ] # Clang automatically sets the '-std=' flag to 'c++14' for MSVC 2015 or later, @@ -202,21 +180,4 @@ def PythonSysPath(**kwargs): sys_path.insert(0, DIR_OF_THIS_SCRIPT) - for folder in os.listdir(DIR_OF_THIRD_PARTY): - if folder == 'python-future': - folder = os.path.join(folder, 'src') - sys_path.insert(GetStandardLibraryIndexInSysPath(sys_path) + 1, - os.path.realpath(os.path.join(DIR_OF_THIRD_PARTY, - folder))) - continue - - if folder == 'cregex': - interpreter_path = kwargs['interpreter_path'] - major_version = subprocess.check_output([ - interpreter_path, '-c', 'import sys; print( sys.version_info[ 0 ] )'] - ).rstrip().decode('utf8') - folder = os.path.join(folder, 'regex_{}'.format(major_version)) - - sys_path.insert(0, os.path.realpath(os.path.join(DIR_OF_THIRD_PARTY, - folder))) return sys_path From bbfe5ed3a6cabdad4adbbe30ac270951ba7e385d Mon Sep 17 00:00:00 2001 From: light jiang Date: Thu, 3 Jan 2019 15:47:52 +0800 Subject: [PATCH 4/6] update gfw --- gfw/shadowsockes.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gfw/shadowsockes.md b/gfw/shadowsockes.md index d3b5201..02fd308 100755 --- a/gfw/shadowsockes.md +++ b/gfw/shadowsockes.md @@ -26,6 +26,11 @@ sudo pip install shadowsocks } ssserver -c /etc/shadowsocks.json -d start ssserver -c /etc/shadowsocks.json -d stop + +docker pull mritd/shadowsocks + +docker run -dt --name ss -p 3801:3801 mritd/shadowsocks -s "-s 0.0.0.0 -p 3801 -m rc4-md5 -k ssserver123 --fast-open" + ``` From 38e46d35cb56fecc0a2b15aef8d792d5bca29fcc Mon Sep 17 00:00:00 2001 From: light jiang Date: Fri, 25 Jan 2019 15:32:52 +0800 Subject: [PATCH 5/6] update --- cartographer/install.md | 22 ++++++++++++++++++++++ env/sysmonitor.sh | 2 +- go/gocode.md | 6 ++++++ go/iris/source.md | 12 ++++++++++++ openstack/docker.md | 1 + openstack/version.md | 6 ++++++ 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 cartographer/install.md create mode 100644 go/gocode.md create mode 100644 go/iris/source.md create mode 100644 openstack/version.md diff --git a/cartographer/install.md b/cartographer/install.md new file mode 100644 index 0000000..c1cb00b --- /dev/null +++ b/cartographer/install.md @@ -0,0 +1,22 @@ +# install cartographer + +```bash +sudo apt-get update +sudo apt-get install -y \ + cmake \ + g++ \ + git \ + google-mock \ + libboost-all-dev \ + libcairo2-dev \ + libeigen3-dev \ + libgflags-dev \ + libgoogle-glog-dev \ + liblua5.2-dev \ + libprotobuf-dev \ + libsuitesparse-dev \ + libwebp-dev \ + ninja-build \ + protobuf-compiler \ + python-sphinx +``` diff --git a/env/sysmonitor.sh b/env/sysmonitor.sh index 6f6f215..f17820f 100644 --- a/env/sysmonitor.sh +++ b/env/sysmonitor.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor -y -sudo apt-get -y install indicator-sysmonitor \ No newline at end of file +sudo apt -y install indicator-sysmonitor diff --git a/go/gocode.md b/go/gocode.md new file mode 100644 index 0000000..3fef00a --- /dev/null +++ b/go/gocode.md @@ -0,0 +1,6 @@ +# gocode vim不更新提示 + +```bash +# 退出gocode 服务 +gocode exit +``` diff --git a/go/iris/source.md b/go/iris/source.md new file mode 100644 index 0000000..e9724f5 --- /dev/null +++ b/go/iris/source.md @@ -0,0 +1,12 @@ +# 源码分析 + + + +## 入口 + +```go +app := iris.New() + +app.Run(iris.Addr("0.0.0.0:8080")) + +``` diff --git a/openstack/docker.md b/openstack/docker.md index f70fdfa..8857643 100644 --- a/openstack/docker.md +++ b/openstack/docker.md @@ -4,4 +4,5 @@ ```bash docker run -dit --privileged --cap-add=ALL --network=host --name=controller -h controller -v /lib/modules:/lib/modules openstack_base:rocky_ovs docker run -dit --privileged --cap-add=ALL --network=host --name=compute -h compute -v /lib/modules:/lib/modules openstack_compute:rocky_ovs +docker run -dit --privileged --cap-add=ALL --network=host --name=cinder -h cinder -v /lib/modules:/lib/modules openstack_cinder:dscloud ``` diff --git a/openstack/version.md b/openstack/version.md new file mode 100644 index 0000000..6309132 --- /dev/null +++ b/openstack/version.md @@ -0,0 +1,6 @@ +# version + +```bash +apt install software-properties-common +add-apt-repository cloud-archive:rocky +``` From 7f24f5478ec752ed372458c0c71d009b0dcfb37b Mon Sep 17 00:00:00 2001 From: light <1870499383@qq.com> Date: Wed, 30 Jan 2019 17:16:51 +0800 Subject: [PATCH 6/6] update --- .gitignore | 0 LICENSE | 0 README.md | 0 cartographer/install.md | 22 ++++++++++++++++ csdn_markdown.md | 0 database/mysql.md | 13 ++++++++-- env/fzf.md | 10 ++++++++ env/sysmonitor.sh | 2 +- esp/build_code_with_micropython.md | 0 esp/emqtt.md | 0 esp/http | 0 gfw/shadowsockes.md | 0 git/change_repo.md | 0 git/gitlab_nginx.md | 0 git/install_git.md | 0 git/install_gitlab.md | 0 git/ssh_key.md | 0 go/gocode.md | 6 +++++ go/iris/source.md | 12 +++++++++ go/安装go1.4.md | 0 light.md | 0 markdown/add image.md | 0 markdown/csdn_markdown.md | 0 mongodb/auth.md | 0 mongodb/use.md | 0 ngrok/ngrok.md | 0 nodejs/install.md | 0 openstack/apt_download.sh | 0 openstack/docker.md | 1 + .../compute/cinder/api-paste.ini | 0 .../openstack_conf/compute/cinder/cinder.conf | 0 .../compute/cinder/logging.conf | 0 .../compute/cinder/rootwrap.conf | 0 .../compute/cinder/rootwrap.d/volume.filters | 0 .../compute/neutron/neutron.conf | 0 .../openstack_conf/compute/nova/api-paste.ini | 0 .../openstack_conf/compute/nova/logging.conf | 0 .../compute/nova/nova-compute.conf | 0 .../openstack_conf/compute/nova/nova.conf | 0 .../openstack_conf/compute/nova/rootwrap.conf | 0 .../compute/nova/rootwrap.d/compute.filters | 0 .../controller/keystone/credential-keys/0 | 0 .../controller/keystone/credential-keys/1 | 0 .../controller/keystone/fernet-keys/0 | 0 .../controller/keystone/fernet-keys/1 | 0 .../controller/neutron/neutron.conf | 0 .../controller/nova/api-paste.ini | 0 .../openstack_conf/controller/nova/nova.conf | 0 openstack/version.md | 6 +++++ python/ReformFileName.py | 0 python/command.md | 0 python/pyqt.md | 0 python/uncompyle2.md | 0 python/virtualenv.md | 0 rabbitmq/install.md | 0 raspberry/main.md | 0 raspberry/router.md | 0 raspberry/sound.md | 0 raspberry/wifi.md | 0 redis/配置.md | 3 +-- ros/env.md | 9 +++++++ .../iptables_examples_network_topology.png | Bin static/img/iptables_frame.png | Bin static/img/ssh_key.png | Bin static/img/test.jpg | Bin ubuntu/apt_source.md | 17 +++++++++++++ ubuntu/aria2.md | 0 ubuntu/install_nginx.md | 0 ubuntu/iptables.md | 0 ubuntu/iptables设置端口转发.md | 0 ubuntu/minicom.md | 0 ubuntu/nmap.md | 0 ubuntu/scp.md | 0 ubuntu/screen.md | 0 ubuntu/synergy.md | 6 +++++ ubuntu/ubuntu_install_pyqt4.md | 0 ubuntu/uget.md | 0 ubuntu/update-alternatives.md | 0 ubuntu/user.md | 24 ++++++++++++++++++ ubuntu/网络相关命令.md | 0 vim/vimrc | 16 +++++++----- vue/start_project.md | 0 82 files changed, 136 insertions(+), 11 deletions(-) mode change 100755 => 100644 .gitignore mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.md create mode 100644 cartographer/install.md mode change 100755 => 100644 csdn_markdown.md create mode 100644 env/fzf.md mode change 100755 => 100644 esp/build_code_with_micropython.md mode change 100755 => 100644 esp/emqtt.md mode change 100755 => 100644 esp/http mode change 100755 => 100644 gfw/shadowsockes.md mode change 100755 => 100644 git/change_repo.md mode change 100755 => 100644 git/gitlab_nginx.md mode change 100755 => 100644 git/install_git.md mode change 100755 => 100644 git/install_gitlab.md mode change 100755 => 100644 git/ssh_key.md create mode 100644 go/gocode.md create mode 100644 go/iris/source.md mode change 100755 => 100644 go/安装go1.4.md mode change 100755 => 100644 light.md mode change 100755 => 100644 markdown/add image.md mode change 100755 => 100644 markdown/csdn_markdown.md mode change 100755 => 100644 mongodb/auth.md mode change 100755 => 100644 mongodb/use.md mode change 100755 => 100644 ngrok/ngrok.md mode change 100755 => 100644 nodejs/install.md mode change 100755 => 100644 openstack/apt_download.sh mode change 100755 => 100644 openstack/openstack_conf/compute/cinder/api-paste.ini mode change 100755 => 100644 openstack/openstack_conf/compute/cinder/cinder.conf mode change 100755 => 100644 openstack/openstack_conf/compute/cinder/logging.conf mode change 100755 => 100644 openstack/openstack_conf/compute/cinder/rootwrap.conf mode change 100755 => 100644 openstack/openstack_conf/compute/cinder/rootwrap.d/volume.filters mode change 100755 => 100644 openstack/openstack_conf/compute/neutron/neutron.conf mode change 100755 => 100644 openstack/openstack_conf/compute/nova/api-paste.ini mode change 100755 => 100644 openstack/openstack_conf/compute/nova/logging.conf mode change 100755 => 100644 openstack/openstack_conf/compute/nova/nova-compute.conf mode change 100755 => 100644 openstack/openstack_conf/compute/nova/nova.conf mode change 100755 => 100644 openstack/openstack_conf/compute/nova/rootwrap.conf mode change 100755 => 100644 openstack/openstack_conf/compute/nova/rootwrap.d/compute.filters mode change 100755 => 100644 openstack/openstack_conf/controller/keystone/credential-keys/0 mode change 100755 => 100644 openstack/openstack_conf/controller/keystone/credential-keys/1 mode change 100755 => 100644 openstack/openstack_conf/controller/keystone/fernet-keys/0 mode change 100755 => 100644 openstack/openstack_conf/controller/keystone/fernet-keys/1 mode change 100755 => 100644 openstack/openstack_conf/controller/neutron/neutron.conf mode change 100755 => 100644 openstack/openstack_conf/controller/nova/api-paste.ini mode change 100755 => 100644 openstack/openstack_conf/controller/nova/nova.conf create mode 100644 openstack/version.md mode change 100755 => 100644 python/ReformFileName.py mode change 100755 => 100644 python/command.md mode change 100755 => 100644 python/pyqt.md mode change 100755 => 100644 python/uncompyle2.md mode change 100755 => 100644 python/virtualenv.md mode change 100755 => 100644 rabbitmq/install.md mode change 100755 => 100644 raspberry/main.md mode change 100755 => 100644 raspberry/router.md mode change 100755 => 100644 raspberry/sound.md mode change 100755 => 100644 raspberry/wifi.md mode change 100755 => 100644 redis/配置.md mode change 100755 => 100644 static/img/iptables_examples_network_topology.png mode change 100755 => 100644 static/img/iptables_frame.png mode change 100755 => 100644 static/img/ssh_key.png mode change 100755 => 100644 static/img/test.jpg create mode 100644 ubuntu/apt_source.md mode change 100755 => 100644 ubuntu/aria2.md mode change 100755 => 100644 ubuntu/install_nginx.md mode change 100755 => 100644 ubuntu/iptables.md mode change 100755 => 100644 ubuntu/iptables设置端口转发.md mode change 100755 => 100644 ubuntu/minicom.md mode change 100755 => 100644 ubuntu/nmap.md mode change 100755 => 100644 ubuntu/scp.md mode change 100755 => 100644 ubuntu/screen.md create mode 100644 ubuntu/synergy.md mode change 100755 => 100644 ubuntu/ubuntu_install_pyqt4.md mode change 100755 => 100644 ubuntu/uget.md mode change 100755 => 100644 ubuntu/update-alternatives.md create mode 100644 ubuntu/user.md mode change 100755 => 100644 ubuntu/网络相关命令.md mode change 100755 => 100644 vue/start_project.md diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/cartographer/install.md b/cartographer/install.md new file mode 100644 index 0000000..c1cb00b --- /dev/null +++ b/cartographer/install.md @@ -0,0 +1,22 @@ +# install cartographer + +```bash +sudo apt-get update +sudo apt-get install -y \ + cmake \ + g++ \ + git \ + google-mock \ + libboost-all-dev \ + libcairo2-dev \ + libeigen3-dev \ + libgflags-dev \ + libgoogle-glog-dev \ + liblua5.2-dev \ + libprotobuf-dev \ + libsuitesparse-dev \ + libwebp-dev \ + ninja-build \ + protobuf-compiler \ + python-sphinx +``` diff --git a/csdn_markdown.md b/csdn_markdown.md old mode 100755 new mode 100644 diff --git a/database/mysql.md b/database/mysql.md index 1aba218..09487e7 100644 --- a/database/mysql.md +++ b/database/mysql.md @@ -11,7 +11,16 @@ cd ~ mkdir mysql cd mysql -docker run -p 3306:3306 --name mymysql -v ~/mysql/conf:/etc/mysql/conf.d -v ~/mysql/logs:/logs -v ~/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 +docker run -p 3306:3306 -p 8090:80 --name mymysql -v ~/mysql/conf:/etc/mysql/conf.d -v ~/mysql/logs:/logs -v ~/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 docker exec -i -t id /bin/bash -``` \ No newline at end of file +``` + + +## 可视化 + +```bash +docker pull quantumobject/docker-mywebsql +docker run --rm-p 8090:80 --name mywebsql quantumobject/docker-mywebsql +docker run -dit --name mywebsql --network=container:mymysql quantumobject/docker-mywebsql +``` diff --git a/env/fzf.md b/env/fzf.md new file mode 100644 index 0000000..e52fb96 --- /dev/null +++ b/env/fzf.md @@ -0,0 +1,10 @@ +# install fzf ag autojump + + +```bash +git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf +~/.fzf/install +sudo apt install silversearcher-ag +sudo apt install autojump +echo ". /usr/share/autojump/autojump.sh" >> ~/.zshrc +``` diff --git a/env/sysmonitor.sh b/env/sysmonitor.sh index 6f6f215..f17820f 100644 --- a/env/sysmonitor.sh +++ b/env/sysmonitor.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor -y -sudo apt-get -y install indicator-sysmonitor \ No newline at end of file +sudo apt -y install indicator-sysmonitor diff --git a/esp/build_code_with_micropython.md b/esp/build_code_with_micropython.md old mode 100755 new mode 100644 diff --git a/esp/emqtt.md b/esp/emqtt.md old mode 100755 new mode 100644 diff --git a/esp/http b/esp/http old mode 100755 new mode 100644 diff --git a/gfw/shadowsockes.md b/gfw/shadowsockes.md old mode 100755 new mode 100644 diff --git a/git/change_repo.md b/git/change_repo.md old mode 100755 new mode 100644 diff --git a/git/gitlab_nginx.md b/git/gitlab_nginx.md old mode 100755 new mode 100644 diff --git a/git/install_git.md b/git/install_git.md old mode 100755 new mode 100644 diff --git a/git/install_gitlab.md b/git/install_gitlab.md old mode 100755 new mode 100644 diff --git a/git/ssh_key.md b/git/ssh_key.md old mode 100755 new mode 100644 diff --git a/go/gocode.md b/go/gocode.md new file mode 100644 index 0000000..3fef00a --- /dev/null +++ b/go/gocode.md @@ -0,0 +1,6 @@ +# gocode vim不更新提示 + +```bash +# 退出gocode 服务 +gocode exit +``` diff --git a/go/iris/source.md b/go/iris/source.md new file mode 100644 index 0000000..e9724f5 --- /dev/null +++ b/go/iris/source.md @@ -0,0 +1,12 @@ +# 源码分析 + + + +## 入口 + +```go +app := iris.New() + +app.Run(iris.Addr("0.0.0.0:8080")) + +``` diff --git a/go/安装go1.4.md b/go/安装go1.4.md old mode 100755 new mode 100644 diff --git a/light.md b/light.md old mode 100755 new mode 100644 diff --git a/markdown/add image.md b/markdown/add image.md old mode 100755 new mode 100644 diff --git a/markdown/csdn_markdown.md b/markdown/csdn_markdown.md old mode 100755 new mode 100644 diff --git a/mongodb/auth.md b/mongodb/auth.md old mode 100755 new mode 100644 diff --git a/mongodb/use.md b/mongodb/use.md old mode 100755 new mode 100644 diff --git a/ngrok/ngrok.md b/ngrok/ngrok.md old mode 100755 new mode 100644 diff --git a/nodejs/install.md b/nodejs/install.md old mode 100755 new mode 100644 diff --git a/openstack/apt_download.sh b/openstack/apt_download.sh old mode 100755 new mode 100644 diff --git a/openstack/docker.md b/openstack/docker.md index f70fdfa..8857643 100644 --- a/openstack/docker.md +++ b/openstack/docker.md @@ -4,4 +4,5 @@ ```bash docker run -dit --privileged --cap-add=ALL --network=host --name=controller -h controller -v /lib/modules:/lib/modules openstack_base:rocky_ovs docker run -dit --privileged --cap-add=ALL --network=host --name=compute -h compute -v /lib/modules:/lib/modules openstack_compute:rocky_ovs +docker run -dit --privileged --cap-add=ALL --network=host --name=cinder -h cinder -v /lib/modules:/lib/modules openstack_cinder:dscloud ``` diff --git a/openstack/openstack_conf/compute/cinder/api-paste.ini b/openstack/openstack_conf/compute/cinder/api-paste.ini old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/cinder/cinder.conf b/openstack/openstack_conf/compute/cinder/cinder.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/cinder/logging.conf b/openstack/openstack_conf/compute/cinder/logging.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/cinder/rootwrap.conf b/openstack/openstack_conf/compute/cinder/rootwrap.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/cinder/rootwrap.d/volume.filters b/openstack/openstack_conf/compute/cinder/rootwrap.d/volume.filters old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/neutron/neutron.conf b/openstack/openstack_conf/compute/neutron/neutron.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/nova/api-paste.ini b/openstack/openstack_conf/compute/nova/api-paste.ini old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/nova/logging.conf b/openstack/openstack_conf/compute/nova/logging.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/nova/nova-compute.conf b/openstack/openstack_conf/compute/nova/nova-compute.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/nova/nova.conf b/openstack/openstack_conf/compute/nova/nova.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/nova/rootwrap.conf b/openstack/openstack_conf/compute/nova/rootwrap.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/compute/nova/rootwrap.d/compute.filters b/openstack/openstack_conf/compute/nova/rootwrap.d/compute.filters old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/controller/keystone/credential-keys/0 b/openstack/openstack_conf/controller/keystone/credential-keys/0 old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/controller/keystone/credential-keys/1 b/openstack/openstack_conf/controller/keystone/credential-keys/1 old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/controller/keystone/fernet-keys/0 b/openstack/openstack_conf/controller/keystone/fernet-keys/0 old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/controller/keystone/fernet-keys/1 b/openstack/openstack_conf/controller/keystone/fernet-keys/1 old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/controller/neutron/neutron.conf b/openstack/openstack_conf/controller/neutron/neutron.conf old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/controller/nova/api-paste.ini b/openstack/openstack_conf/controller/nova/api-paste.ini old mode 100755 new mode 100644 diff --git a/openstack/openstack_conf/controller/nova/nova.conf b/openstack/openstack_conf/controller/nova/nova.conf old mode 100755 new mode 100644 diff --git a/openstack/version.md b/openstack/version.md new file mode 100644 index 0000000..6309132 --- /dev/null +++ b/openstack/version.md @@ -0,0 +1,6 @@ +# version + +```bash +apt install software-properties-common +add-apt-repository cloud-archive:rocky +``` diff --git a/python/ReformFileName.py b/python/ReformFileName.py old mode 100755 new mode 100644 diff --git a/python/command.md b/python/command.md old mode 100755 new mode 100644 diff --git a/python/pyqt.md b/python/pyqt.md old mode 100755 new mode 100644 diff --git a/python/uncompyle2.md b/python/uncompyle2.md old mode 100755 new mode 100644 diff --git a/python/virtualenv.md b/python/virtualenv.md old mode 100755 new mode 100644 diff --git a/rabbitmq/install.md b/rabbitmq/install.md old mode 100755 new mode 100644 diff --git a/raspberry/main.md b/raspberry/main.md old mode 100755 new mode 100644 diff --git a/raspberry/router.md b/raspberry/router.md old mode 100755 new mode 100644 diff --git a/raspberry/sound.md b/raspberry/sound.md old mode 100755 new mode 100644 diff --git a/raspberry/wifi.md b/raspberry/wifi.md old mode 100755 new mode 100644 diff --git a/redis/配置.md b/redis/配置.md old mode 100755 new mode 100644 index 8414ba8..d085310 --- a/redis/配置.md +++ b/redis/配置.md @@ -88,6 +88,5 @@ esac ``` bash docker pull redis -mkdir /db/redis/ docker run -p 127.0.0.1:6379:6379 --name myredis -v /db/redis/:/data -d redis redis-server --appendonly yes --requirepass "abc123456" -``` \ No newline at end of file +``` diff --git a/ros/env.md b/ros/env.md index 85644e7..60447fa 100644 --- a/ros/env.md +++ b/ros/env.md @@ -21,3 +21,12 @@ cd .. catkin_make ``` + + +## 安装依赖包 + +```bash + +rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y + +``` diff --git a/static/img/iptables_examples_network_topology.png b/static/img/iptables_examples_network_topology.png old mode 100755 new mode 100644 diff --git a/static/img/iptables_frame.png b/static/img/iptables_frame.png old mode 100755 new mode 100644 diff --git a/static/img/ssh_key.png b/static/img/ssh_key.png old mode 100755 new mode 100644 diff --git a/static/img/test.jpg b/static/img/test.jpg old mode 100755 new mode 100644 diff --git a/ubuntu/apt_source.md b/ubuntu/apt_source.md new file mode 100644 index 0000000..0b36538 --- /dev/null +++ b/ubuntu/apt_source.md @@ -0,0 +1,17 @@ +# apt 源 + +## ubuntu 18.04 + +```bash +deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted +deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted +deb http://mirrors.aliyun.com/ubuntu/ bionic universe +deb http://mirrors.aliyun.com/ubuntu/ bionic-updates universe +deb http://mirrors.aliyun.com/ubuntu/ bionic multiverse +deb http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse +deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted +deb http://mirrors.aliyun.com/ubuntu/ bionic-security universe +deb http://mirrors.aliyun.com/ubuntu/ bionic-security multiverse + +``` diff --git a/ubuntu/aria2.md b/ubuntu/aria2.md old mode 100755 new mode 100644 diff --git a/ubuntu/install_nginx.md b/ubuntu/install_nginx.md old mode 100755 new mode 100644 diff --git a/ubuntu/iptables.md b/ubuntu/iptables.md old mode 100755 new mode 100644 diff --git a/ubuntu/iptables设置端口转发.md b/ubuntu/iptables设置端口转发.md old mode 100755 new mode 100644 diff --git a/ubuntu/minicom.md b/ubuntu/minicom.md old mode 100755 new mode 100644 diff --git a/ubuntu/nmap.md b/ubuntu/nmap.md old mode 100755 new mode 100644 diff --git a/ubuntu/scp.md b/ubuntu/scp.md old mode 100755 new mode 100644 diff --git a/ubuntu/screen.md b/ubuntu/screen.md old mode 100755 new mode 100644 diff --git a/ubuntu/synergy.md b/ubuntu/synergy.md new file mode 100644 index 0000000..d34f476 --- /dev/null +++ b/ubuntu/synergy.md @@ -0,0 +1,6 @@ +# synergy + +```bash +sudo apt install synergy +sudo apt-get install sni-qt +``` diff --git a/ubuntu/ubuntu_install_pyqt4.md b/ubuntu/ubuntu_install_pyqt4.md old mode 100755 new mode 100644 diff --git a/ubuntu/uget.md b/ubuntu/uget.md old mode 100755 new mode 100644 diff --git a/ubuntu/update-alternatives.md b/ubuntu/update-alternatives.md old mode 100755 new mode 100644 diff --git a/ubuntu/user.md b/ubuntu/user.md new file mode 100644 index 0000000..34f032a --- /dev/null +++ b/ubuntu/user.md @@ -0,0 +1,24 @@ +# user + + +## create user + +```bash +useradd git + +# 制定用户默认的shell +chsh git -s /bin/bash + + +# 更改权限 +chown -R git:git /home/git +``` + + + +## auth + +```bash +## 只修改文件权限 -type d 为修改目录权限 +find workspace -type f -exec chmod 644 {} \; +``` diff --git a/ubuntu/网络相关命令.md b/ubuntu/网络相关命令.md old mode 100755 new mode 100644 diff --git a/vim/vimrc b/vim/vimrc index fbf82ff..99084fc 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -9,12 +9,15 @@ Plugin 'VundleVim/Vundle.vim' Plugin 'junegunn/fzf.vim' +" 搜索 nmap l :BLines nmap L :Lines +" 全局搜索,即使文件没打开 Plugin 'rking/ag.vim' +" 新建文件自动添加模板 Plugin 'aperezdc/vim-template.git' let g:templates_directory = '~/.vim/templates' @@ -73,7 +76,7 @@ set updatetime=100 Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown' -Plugin 'suan/vim-instant-markdown' +"Plugin 'suan/vim-instant-markdown' Plugin 'Valloric/YouCompleteMe' @@ -83,8 +86,8 @@ let g:ycm_collect_identifiers_from_tags_files = 1 " 开启 YCM基于 "let g:syntastic_ignore_files=[".*\.py$"] let g:ycm_seed_identifiers_with_syntax = 1 " 语法关键字补全 let g:ycm_confirm_extra_conf = 0 " 关闭加载.ycm_extra_conf.py提示 -let g:ycm_key_list_select_completion = ['', ''] " 映射按键,没有这个会拦截掉tab, 导致其他插件的tab不能用. -let g:ycm_key_list_previous_completion = ['', ''] +let g:ycm_key_list_select_completion = [''] " 映射按键,没有这个会拦截掉tab, 导致其他插件的tab不能用. +let g:ycm_key_list_previous_completion = [''] let g:ycm_complete_in_comments = 1 " 在注释输入中也能补全 let g:ycm_complete_in_strings = 1 " 在字符串输入中也能补全 let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释和字符串中的文字也会被收入补全 @@ -103,7 +106,7 @@ let g:SuperTabDefaultCompletionType = "" " xml html auto close Plugin 'alvan/vim-closetag' let g:jedi#documentation_command = "" -let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.launch' +let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.launch,*.vue' Plugin 'jiangmiao/auto-pairs' @@ -207,9 +210,10 @@ Plugin 'posva/vim-vue' "Plugin 'https://github.com/taketwo/vim-ros.git' +Plugin 'ctrlpvim/ctrlp.vim' - - +Plugin 'terryma/vim-multiple-cursors' +"Plugin 'Shougo/neocomplete.vim' call vundle#end() " required diff --git a/vue/start_project.md b/vue/start_project.md old mode 100755 new mode 100644