随笔分类 -  Linux

摘要:1.ssl.SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure 原因:SSL版本错误解决:PROTOCOL_SSLv3->PROTOCOL_... 阅读全文
posted @ 2014-10-09 16:45 李伯波 阅读(585) 评论(0) 推荐(0) 编辑
摘要:1. 安装djandosudo apt-get install python-django2. 安装mod_wsgisudo apt-get install libapache2-mod-wsgisudo a2enmod wsgi//验证是否成功安装3. apache配置文件httpd.conf:W... 阅读全文
posted @ 2014-05-22 13:14 李伯波 阅读(189) 评论(0) 推荐(0) 编辑
摘要:http://wiki.ubuntu.org.cn/Tomcatsudo apt-get install tomcat7sudo /etc/init.d/tomcat7 startsudo /etc/init.d/tomcat7 stopTomcat 配置文件路径Tomcat home direc... 阅读全文
posted @ 2014-05-22 10:23 李伯波 阅读(341) 评论(0) 推荐(0) 编辑
摘要:crontab -e*/1 * * * * python a.py sudo service cron restartlog配置文件:/etc/rsyslog.d/50-default.conf 阅读全文
posted @ 2013-06-25 14:42 李伯波 阅读(142) 评论(0) 推荐(0) 编辑
摘要:iwpriv ra0 set SiteSurvey=1 iwpriv ra0 get_site_survey 阅读全文
posted @ 2013-05-04 20:05 李伯波 阅读(360) 评论(0) 推荐(0) 编辑
摘要:1,右键Finder,选择前往文件夹2,输入:~/Library/Containers/com.tencent.qq/Data/Library/Application Support/3,确定,找到QQ的文件夹里QQ号的文件夹删除即可 阅读全文
posted @ 2013-04-24 08:05 李伯波 阅读(352) 评论(0) 推荐(0) 编辑
摘要:摘自:http://fixlog.blog.sohu.com/136606622.html如何自动启动服务linux自动启动服务很简单,最简单的是把启动命令放到/etc/rc.d/rc.local文件里这样就可以每次启动的时候自动启动服务了,例如对于apache,编译好apache后会在安装目录的bin下生成apachectl文件,这是个启动脚本,我们只需要把这个命令加到rc.local里就可以了echo /usr/local/apache/bin/apachectl >> /etc/rc.d/rc.local此外我们还可以使用chkconfig命令来把某项服务加到系统的各项运行级 阅读全文
posted @ 2013-04-11 20:19 李伯波 阅读(691) 评论(0) 推荐(0) 编辑
摘要:摘自:http://www.cnblogs.com/youthlion/archive/2012/01/16/2274463.htmlai_family参数指定调用者期待返回的套接口地址结构的类型。它的值包括三种:AF_INET,AF_INET6和AF_UNSPEC。如果指定AF_INET,那么函数就不能返回任何IPV6相关的地址信息;如果仅指定了AF_INET6,则就不能返回任何IPV4地址信息。AF_UNSPEC则意味着函数返回的是适用于指定主机名和服务名且适合任何协议族的地址。如果某个主机既有AAAA记录(IPV6)地址,同时又有A记录(IPV4)地址,那么AAAA记录将作为sockad 阅读全文
posted @ 2013-03-30 16:00 李伯波 阅读(246) 评论(0) 推荐(0) 编辑
摘要:int sockfd; int len; struct sockaddr_in address; int result; char *strings="GET /default.html HTTP/1.1 Host:23.20.236.43 Connection: Close "; char ch; sockfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); struct hostent *pURL; pURL = gethostbyname("http://name.com/"); memset(&a 阅读全文
posted @ 2013-03-30 15:56 李伯波 阅读(395) 评论(0) 推荐(0) 编辑
摘要:1、获取&安装 sudo apt-get install make sudo apt-get install gccsudo apt-get install libssl-dev sudo apt-get install g++sudo make install http://mosquitto.org/files/binary/ 地址中获取。Windows系统下的安装过程非常简单,我们甚至可以把Mosquitto直接安装成为系统服务;但是,在实际应用中,我们更倾向于使用Linux系统的服务器,接下来我们就将重点介绍Linux版Mosquitto的安装方法。 在Linux系统上... 阅读全文
posted @ 2013-01-21 09:54 李伯波 阅读(2423) 评论(0) 推荐(0) 编辑
摘要:sudo apt-get install openssl sudo apt-get install libssl-dev 阅读全文
posted @ 2013-01-21 09:17 李伯波 阅读(528) 评论(0) 推荐(0) 编辑
摘要:mkdir 目录名 => 创建一个目录rmdir 空目录名 => 删除一个空目录rm 文件名 文件名 => 删除一个文件或多个文件rm –rf 非空目录名 => 删除一个非空目录下的一切touch 文件名 => 创建一个空文件重命名文件(夹) / 移动文件(夹)到指定文件夹执行格式: mv source destinationExample:mv file1 file2 => 将文件 file1,更改文件名为 file2。mv file1 dir1 => 将文件 file1,移到目录 dir1下,文件名仍为 file1。mv dir1 dir2 =&g 阅读全文
posted @ 2012-12-27 16:22 李伯波 阅读(193) 评论(0) 推荐(0) 编辑
摘要:CFile file[5];BYTE *szTxt[5];int nWidth = 0;int nHeight= 0;int nDataLen=0;int nLen;CString csFileName;for (int fileI = 1; fileI <= 5; fileI ++){ csFileName.Format("e:\\pics\\%d.bmp", fileI); file[fileI - 1].Open(csFileName,CFile::modeRead | CFile::typeBinary); nLen = file[fileI - 1].Get 阅读全文
posted @ 2012-12-03 13:49 李伯波 阅读(3515) 评论(0) 推荐(0) 编辑
摘要:avcodec_init(); // 初始化codec库avcodec_register_all(); // 注册编码器{ AVCodec *codec; // 编码器 AVCodecContext *c= NULL; // 编解码环境 int i, out_size, size, x, y, outbuf_size; FILE *f== fopen("C:\\mpeg4_dec1.yuv", "rb");; //视频源文件 AVFrame *picture; // 当前帧 uint8_t *outbuf, *picture_buf; codec = a 阅读全文
posted @ 2012-12-01 15:07 李伯波 阅读(345) 评论(0) 推荐(0) 编辑
摘要:最近遇到好几个人在问ffmpeg如何处理网络流,刚好前段时间也在做这方面,抽空整理了下,把主要代码发出来,希望对大家有用。为简单处理,我这里只简单介绍UDP接收TS流,其实只要是socket接收的都可以类似处理。#include "utils.h"#include <pthread.h>#include <libavcodec/avcodec.h>#include <libavformat/avformat.h>UdpQueue recvqueue;UdpParam udpParam;//注册av_read_frame的回调函数,这里只是 阅读全文
posted @ 2012-11-30 19:48 李伯波 阅读(1047) 评论(0) 推荐(0) 编辑
摘要:原:http://blog.csdn.net/xyyangkun/article/details/7255372/*** @note x264的编码示例.* 使用x264的版本为libx264-115* 1. 示例是个死循环,会源源不断的编码,然后将数据写文件.* 2. 示例的行为是:编码1000帧后,取空编码缓冲区,然后循环执行这两步.* @author*gcc -lx264**/#include <cassert>#include <iostream>#include <string>#include "stdint.h"#inclu 阅读全文
posted @ 2012-11-30 10:12 李伯波 阅读(607) 评论(0) 推荐(0) 编辑
摘要:error while loading shared libraries的解決方法 者 icq 21:03 | 靜態連結網址 | 迴響 (0) | 引用 (1) | 點閱次數 (270) | Programming 行程式時,如此遇到像下列這種錯誤: ./tests: error while loading shared libraries: xxx.so.0:cannot open shared ob... 阅读全文
posted @ 2012-11-30 08:45 李伯波 阅读(1256) 评论(0) 推荐(0) 编辑
摘要:http://www.xxlinux.com/linux/article/accidence/internet/20081226/14739.html安装好了ffmpeg后,如果你使用ffmpeg工具去把某个视频文件转成h264视频编码、mp3音频编码or其他ffmpeg自身不带的xxx 编码类型,就会看到报错信息,unknown encoder 'xxx'。此刻你需要的只要去安装其他的编码器就行了,本质上其实是把其他的编码器以库的形式安装好,例如,把正确的libx264.so or libx264.a存放在/usr/lib下 or /usr/local/lib下。 举两个例子 阅读全文
posted @ 2012-11-29 19:09 李伯波 阅读(541) 评论(0) 推荐(0) 编辑
摘要:1../configure 2.make3.make install正常安装结束。网上查阅,普遍提示两种解决方法:一、ffmpeg是纯C的库,应用程序用C++来编译。二、路径、需要的库包含不全。红色字体以及其后的参数表示要关联的动态库。以上具体就不说了,搜索下便是。我在无数遍仔细确认上述两种可能性后,仍然报错。郁闷了一个晚上。。后来查阅ffmpeg的 pkg-config,终于找到原因,错误导致过程让我痛苦,原因却很简单。错误:gcc test.c -o test -I/GA/gabin/include/ -L/GA/gabin/lib-lavcodec -lavformat -lavdevi 阅读全文
posted @ 2012-11-29 15:42 李伯波 阅读(246) 评论(0) 推荐(0) 编辑
摘要:采集音频和摄像头视频并实时H264编码及AAC编码http://www.cnblogs.com/haibindev/archive/2011/11/10/2244442.htmlffmpeg的编译、安装及使用(for x86,for arm)http://hi.baidu.com/iminway/blog/item/bda2db4e29ced701b2de05f1.html 最新的ffmpeg可以通过svn下载,SVN辅助的软件有:SubVersion,从 http://subversion.tigris.org/ 下载,支持linux。TortoiseSVN,从 http://torto.. 阅读全文
posted @ 2012-11-28 19:45 李伯波 阅读(251) 评论(0) 推荐(0) 编辑