随笔分类 -  linux

1

qt Cannot connect creator comm socket /tmp/qt_temp.S26613/stub-socket: No such
摘要:Tool->Options->Environment->General将terminal改为xterm-e 阅读全文

posted @ 2013-07-09 10:15 wps712 阅读(795) 评论(0) 推荐(0)

64位Ubuntu系统安装OpenCV 2.4.x+ffmpeg 完美解决方案
摘要:http://www.bfcat.com/index.php/2012/09/64bits-ubuntu-opencv-2-4-x-ffmpeg/ 阅读全文

posted @ 2013-07-07 09:33 wps712 阅读(708) 评论(0) 推荐(0)

vim按下ctrl+s僵死
摘要:CTRL+S表示停止向终端停止输出CTRL+Q恢复向终端输出流 阅读全文

posted @ 2013-07-03 13:03 wps712 阅读(221) 评论(0) 推荐(0)

ubuntu安装amd/ati显卡驱动
摘要:原网页:http://forum.ubuntu.org.cn/viewtopic.php?f=126&t=390372整合了几个帖子,大概如此:用以下命令卸载所有驱动:代码:sudo sh /usr/share/ati/fglrx-uninstall.sh代码:sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev* xorg-driver-fglrx重启一下,首先安装需要的的驱动环境:代码:sudo apt-get install dpkg build-essential cdbs dh-make dkm 阅读全文

posted @ 2013-06-28 10:19 wps712 阅读(5439) 评论(0) 推荐(0)

vim配置文件,解决没有颜色问题
摘要:在用户主目录下建立 .vimrc文件,用户也可以在/etc/vimrc(/etc/vim/vimrc不同版本,可能不一样),全局添加下面内容:"语法高亮syntax on"显示行号set nu"修改默认注释颜色hi Comment ctermfg=DarkCyan"允许退格键删除set backspace=2"启用鼠标set mouse=aset selection=exclusiveset selectmode=mouse,key"侦测文件类型filetype on"载入文件类型插件filetype plugin on&q 阅读全文

posted @ 2013-05-26 09:01 wps712 阅读(10071) 评论(0) 推荐(0)

dd for windows制作usb启动盘
摘要:1、打开命令行2、cd到dd目录3、运行命令:dd --list4、找到u盘(红色)Win32 Available Volume Information\\.\Volume{7cf2f59c-6207-11e1-b81a-806e6f6e6963}\ link to \\?\Device\HarddiskVolume1 fixed media Mounted on \\.\c:\\.\Volume{9ba58399-a85a-11e1-b19f-005056c00008}\ link to \\?\Device\HarddiskVolume5 removeable media Mounted 阅读全文

posted @ 2013-05-22 12:49 wps712 阅读(4682) 评论(0) 推荐(0)

ubuntu12.04 安装opencv
摘要:1 编译环境 sudo apt-get install build-essential2安装GTK环境 sudoapt-getinstalllibgtk2.0-dev 3编译GTK程序时自动找出头文件及库文件位置 sudoapt-getinstallpkg-config 4 安装cmake sudo apt-get install cmake5 下载源码 opencv2.4 并解压,进入opencv2.46 mkdirrelease ;cdrelease7生成makefile(..代表父目录) cmake.. 8 编译安装make;sudo make install9 配置必要的库sudoge 阅读全文

posted @ 2012-10-20 23:42 wps712 阅读(2196) 评论(0) 推荐(0)

linux主目录下的文件夹改回英文
摘要:方法一:首先把那几个中文名称修改成相应的英文,Desktop、 Documents、 Music、 Pictures、 Videos ……然后编辑配置文件:gedit ~/.config/user-dirs.dirs把文件夹指向改掉,例如:XDG_DESKTOP_DIR="$HOME/Desktop"XDG_DOWNLOAD_DIR="$HOME/Desktop"XDG_TEMPLATES_DIR="$HOME/Templates"XDG_PUBLICSHARE_DIR="$HOME/Public"XDG_DOCU 阅读全文

posted @ 2012-05-24 23:01 wps712 阅读(3890) 评论(0) 推荐(0)

tar: pax_global_header: Unknown file type 'g', extracted as normal file
摘要:tar版本太低,所以需升级下。tar的下载地址:http://ftp.gnu.org/gnu/tar/tar-1.20.tar.bz2安装:1.配置文件:./configure --prefix=/usr --bindir=/bin --libexecdir=/usr/bin注:后面的选项意思是将相应的安装到系统中覆盖旧版本的文件,要不然安装完后,查看版本还是旧版本2.make 编译3.make install 安装到系统中 阅读全文

posted @ 2012-05-12 21:38 wps712 阅读(950) 评论(0) 推荐(0)

linux下模块与模块间,模块与内核间共享变量
摘要:Linux symbol export method:[1] If we want export the symbol in a module, just use the EXPORT_SYMBOL(xxxx) in the C or H file. And compile the module by adding the compile flag -DEXPORT_SYMTAB. Then we can use the xxxx in the other module.[2] If we want export some symbol in Kernel that is not in a m 阅读全文

posted @ 2012-04-27 21:06 wps712 阅读(809) 评论(0) 推荐(0)

程序中有游离的...
摘要:编写linux内核实验时,出现——“程序中有游离的‘\200’”错误,原因在于输入法不同,切换到英文输入法重新输入,可得到正确结果。一般在复制代码时遇到这种问题。 阅读全文

posted @ 2012-04-25 19:40 wps712 阅读(647) 评论(0) 推荐(0)

fgets与fscanf读入一行
摘要:char *fgets(char *s, int n, FILE *stream);int fscanf(FILE *stream, char *format,[argument...]);fgets读入最后的\n,而fscanf不读入。所以在获得字符串长度是,int len = strlen(s)-1;//fgets对人的或者int len = strlen(s);//fscanf 读入的 阅读全文

posted @ 2012-04-22 12:03 wps712 阅读(3785) 评论(0) 推荐(0)

linux互斥操作——信号量
摘要:简单的互斥操作:#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<stdlib.h>#include<sys/types.h>#include <sys/ipc.h>#include<sys/sem.h>int p(int sem_id){ struct sembuf sb; sb.sem_num=0; sb.sem_op=-1; sb.sem_flg=SEM_UNDO; if(semop(sem_id,&sb,1)==-1) r 阅读全文

posted @ 2012-04-18 22:48 wps712 阅读(269) 评论(0) 推荐(0)

自己写的shell程序 多层管道、重定向、后台、命令历史
摘要:#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<fcntl.h>#include<string.h>#include<stdbool.h>#include<signal.h>#include <readline/readline.h>#include <readline/history.h>//#include<errno.h>//#include<sys/stat.h>#define M 阅读全文

posted @ 2012-04-14 18:45 wps712 阅读(664) 评论(0) 推荐(0)

键盘上键的ASCII码
摘要:字母 A 到 Z 和标准数字 0 到 9A(65) B(66) C(67) D(68) E(69) F(70) G(71) H(72) I(73) J(74) K(75) L(76) M(77) N(78) O(79) P(80) Q(81) R(82) S(83) T(84) U (85) V(86) W(87) X(88) Y(89) Z(90) 0(48) 1(49) 2(50) 3(51) 4(52) 5(53) 6(54) 7(55) 8(56) 9(57) 数字键盘上的键数字键盘0(96) 数字键盘1(97) 数字键盘2(98) 数字键盘3(99) 数字键盘4(100) 数字键盘5 阅读全文

posted @ 2012-04-14 10:19 wps712 阅读(4412) 评论(0) 推荐(0)

实现类似于shell中按“向上”,“向下”箭头的功能————readline库
摘要:[转载] 正确编译使用readline库The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes additional functions to maintain a list of previously-entered com 阅读全文

posted @ 2012-04-14 09:58 wps712 阅读(1281) 评论(0) 推荐(0)

open创建文件后,再读取出现Permission denied错误
摘要:函数 open(char *pathname, int flag, mode_t mode),当flag 指定有O_CREAT并忽略mode参数,在下次打开文件时,可能会提示没有权限之 类的错误原因:这样创建的文件权限是随机的,如果要指定创建的文件权限,就需要填写 mode 参数,这个参数是指定文件权限的,文件的权限分3组9位(rwx rwx rwx--对应用户,用户所在组,其它用户), mode 的值用4位表示,为3每组权限的和值。另外还有一个 umask 函数,这个函数是权限屏蔽,和 mode值 正好相反。 阅读全文

posted @ 2012-04-14 00:53 wps712 阅读(2448) 评论(0) 推荐(0)

open与fopen 文件描述符与文件指针
摘要:首先说一下文件描述符与文件指针区别:文件描述符:在linux系统中打开文件就会获得文件描述符,它是个很小的正整数。每个进程在PCB(Process Control Block)中保存着一份文件描述符表,文件描述符就是这个表的索引,每个表项都有一个指向已打开文件的指针。文件指针:C语言中使用文件指针做为I/O的句柄。文件指针指向进程用户区中的一个被称为FILE结构的数据结构。FILE结构包括一个缓冲区和一 个文件描述符。而文件描述符是文件描述符表的一个索引,因此从某种意义上说文件指针就是句柄的句柄(在Windows系统上,文件描述符被称作文件句 柄)。open和fopen的区别:open返回一个 阅读全文

posted @ 2012-04-13 19:33 wps712 阅读(2955) 评论(0) 推荐(0)

ubuntu下编译工具 lex yacc安装
摘要:sudo apt-get install lex yacc出现unable to locate package lex yaccubuntu使用flex和bison来代替lex和yaccsudo apt-get install flex biso 阅读全文

posted @ 2012-04-09 14:20 wps712 阅读(4519) 评论(0) 推荐(0)

apt-get常用命令
摘要:一,什么的是apt-get高级包装工具(英语:Advanced Packaging Tools,简称:APT)是Debian及其衍生发行版(如:ubuntu)的软件包管理器。APT可以自动下载,配置,安装二进制或者源代码格式的软 件包,因此简化了 Unix系统上管理软件的过程,apt-get命令一般需要root权限执行,所以一般跟着sudo命令。二,apt-get中文参数用法:apt-get [选项] 命令 apt-get [选项] install|remove pkg1 [pkg2 ...]apt-get [选项] source pkg1 [pkg2 ...]apt-get 是一个下载安装软 阅读全文

posted @ 2012-04-09 14:14 wps712 阅读(61040) 评论(0) 推荐(9)

1

导航