201906-21 在ubuntu中搜索文件或文件夹的方法 1. whereis+文件名 用于程序名的搜索,搜索结果只限于二进制文件(参数-b)、man说明文件(参数-m)和源代码文件(参数-s),如果省略参数,则返回所有信息。 2. find / -name +文件名 find是在指定的目录下遍历查找,如果目录使用 / 则表示在所有目录下查找,f.... Read More >
201906-21 如何解决在Ubuntu中运行服务报错:libssh2.so.1:: cannot open shared object file: No such file or directory 首先你访问packages.ubuntu.com,搜索找不到的库文件名称libssh2 在搜索结果中,我们找到对应的libssh2对应软件包 libssh2-1-dev sudo apt-get install libssh2-1-dev.... Read More >
201906-21 如何解决在Ubuntu中运行服务报错:libssl3.so: cannot open shared object file 在Win10中的Linux子系统中运行服务时报错: error while loading shared libraries: libssl3.so: cannot open shared object file: No such file or directory 解决方法:sudo apt-get install libnss3.... Read More >
201906-21 ldconfig提示is not a symbolic link警告的去除方法 执行ldconfig提示./lib/liblog4cxx.so.10 is not a symbolic link警告的去除方法 解决的方法: sudo ln -sf ./liblog4cxx.so.10.0.0 liblog4cxx.so.10 .... Read More >
201906-20 如何解决代码中存在模板函数时编译出错的问题:error: expected primary-expression before ‘>’ token 在Ubuntu中编译C++项目时,其中GCC版本是7.4.0,调用模板函数的地方会报如下错误 error: expected primary-expression before ‘>’ token this->pCmd = this->pBuffer->constructTail<CmdT>(); error: expected primary-exp.... Read More >
201906-20 Ubuntu上报错“error This file was generated by a newer version of protoc” 问题背景 我在Win10上的Linux子系统上执行sudo apt-get install protobuf-compiler后,正常生成了协议代码,执行编译时报错“error This file was generated by a newer version of protoc”。 解决方法: 得执行完整的安装命令 sudo apt-get install libprotobuf-.... Read More >
201906-12 WSL执行python脚本报错"Operation not permitted Python"一例 在Windows 10 的Linux子系统中执行某个python脚本一直报错:Operation not permitted Python。 检查后发现是代码os.mknod(tempsql)导致的,原因不明!!!.... Read More >
201906-12 Shell脚本中获取本机ip地址的3个方法 方法一: /sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:" or /sbin/ifconfig|sed -n '/inet addr/s/^[^:]*:\([0-9.]\{7,15\}\) .*/\1/p' 方法二: local_host="`hostnam.... Read More >
201906-12 Python2.x 和 Python3.x 中 raw_input( ) 和 input( ) 区别 1、在 Python2.x 中 raw_input( ) 和 input( ),两个函数都存在,其中区别为: raw_input( ) 将所有输入作为字符串看待,返回字符串类型。 input( ) 只能接收"数字"的输入,在对待纯数字输入时具有自己的特性,它返回所输入的数字的类型( int, float )。 2、在 Python3.x 中 raw_input( ) 和 input( ).... Read More >
201906-12 在Ubuntu中如何执行Python脚本文件-有图有真相 如果你安装是Python 2.x版本,则在终端输入命令:python {python脚本文件} 如果你安装是Python 3.x版本,则在终端输入命令:python3 {python脚本文件} .... Read More >