随笔分类 - [技术]Linux
摘要:转自:http://blog.chinaunix.net/uid-24774106-id-3396220.html
在自己的目录下编辑自己的.vimrc, vim ~/.vimrc 添加下面的几行: : filetype indent on
set et
set ci
set shiftwidth=4
autocmd FileType make setlocal noexpandtab ...
阅读全文
摘要:不知道为啥,copy原来的eclipse环境到新的地方后,编译总是出错:
make:*** error 127
解决方案是:属性Properties---C++编译 c++build---build setting---build command 设置为 make -v
参考:http://www.eclipse.org/forums/index.php/t/523132/
原因不知道为啥。。
阅读全文
摘要:yum install vnc-server 提示安装成功
rpm -q vnc-server 返回 package vnc-server is not installed
然而再重新安装时 yum install vnc-server
提示:
Package tigervnc-server-module-1.1.0-5.e16_4.1.x86_64 already installed a...
阅读全文
摘要:参数说明
l-b不再输出统计图表中每个字段的详细描述。
l-p只输出函数的调用图(Callgraph的那部分信息)。
l-q只输出函数的时间消耗列表。
l-eName不再输出函数Name及其子函数的调用图(除非它们有未被限制的其它父函数)。可以给定多个-e标志。一个-e标志只能指定一个函数。
l-EName不再输出函数Name及其子函数的调用图,此标志类似于...
阅读全文
摘要:转自:http://ariasprado.name/2011/11/30/profiling-application-llc-cache-misses-under-linux-using-perf-events.html
In this post we will see how to do some profiling under Ubuntu Linux using Perf Events, p...
阅读全文
摘要:【转自】http://www.kankanews.com/ICkengine/archives/61043.shtml
文章来自KENGINE | Kankanews.com
摘要: 本文主要讲eclipse插件开发的具体步骤,第一个插件工程的开发,调试,导出,安装,适合初学 1.1.创建plug-in项目: 这次做的是eclipse插件,这...
阅读全文
摘要:【转自】http://blog.csdn.net/wind19/article/details/4822666
错误原因之一很有可能是你的脚本文件是DOS格式的, 即每一行的行尾以/r/n来标识, 其ASCII码分别是0x0D, 0x0A.
可以有很多种办法看这个文件是DOS格式的还是UNIX格式的, 还是MAC格式的
(1). vi filename
然后用命令
:set ff?
可以看到dos...
阅读全文
摘要:fdisk -l
无法挂载 NTFS格式的分区:mount: unknown filesystem type ‘ntfs’。 问题: # mount –t ntfs /dev/sdb1 /mnt/usb mount: unknown filesystem type ‘ntfs’ 这是由于CentOS release 5.3(Final)上无法识别N...
阅读全文
摘要:Declaration Following is the declaration for sprintf() function.int sprintf(char *str, const char *format, ...)
Example
The following example shows the usage of sprintf() function.
#include #include ...
阅读全文
摘要:1: #include 2: int system(const char *command); 3: 4: while (something) { 5: int ret = system("foo"); 6: if (WIFSIGNALED(ret) && ...
阅读全文
摘要:Source code: 1: #include 2: void myStartupFun (void) __attribute__ ((constructor)); 3: void myCleanupFun (void) __attribute__ ((destructor)); 4: 5: /...
阅读全文
摘要:Source file: 1: #define __USE_GNU //import! 2: #include 3: #include 4: void getFuncNameByAddr(void *this_fn, void *call_site) { 5: Dl_info DlInfo...
阅读全文
摘要:myFun.h 1: #include 2: 3: void __cyg_profile_func_enter(void *this_fn, void *call_site) 4: __attribute__((no_instrument_function)); 5: void _...
阅读全文
摘要:1: int save_out = dup(fileno(stdout));//backup stdout 2: int out = open("cout.log", O_RDWR|O_CREAT|O_APPEND, 0600); 3: int nRet; 4: fflush(stdout); 5...
阅读全文
摘要:使用rpm –qa vnc命令如果收到如下信息说明已经安装了vncserver, [root@localhost: ~]#rpm -qa |grep vnc
gtk-vnc-python-0.3.2-3.el5
vnc-server-4.1.2-14.el5
gtk-vnc-0.3.2-3.el5
vnc-4.1.2-14.el5 服务器安装:sudo yum install vnc-ser...
阅读全文
摘要:转自:http://dzmailbox.blog.163.com/blog/static/12053438520121752313440/
1. 模拟高CPU占用率
首先写一个C++程序,代码如下:#include #include #include #include #include int main(){int timeuse=0; struct timeval tpstar...
阅读全文
摘要:https://cpulimit.svn.sourceforge.net/svnroot/cpulimit/trunk/
限制方法:
如果限制进程名,比如将httpd这个进程名的CPU限制在40%
cpulimit --exe httpd --limit 40 cpulimit --exe /usr/local/bin/httpd --limit 40
将pid为2960的进程的CPU限制在5...
阅读全文
摘要:Redhat AS4和AS5的机器,升级和安装rpm包,需要License,平时经常需要安装和编译软件包,升级到Centos系统能够方便不少!
查看当前系统版本号
# less /etc/redhat-release 检查系统已安装的组件包中是否已存在Redhat的自带的yum系列组件包
# su root
# rpm -qa | grep yum 如果存在请逐一全部删除
# rpm -e...
阅读全文
摘要:mount -t cifs -o username="共享用户",password="密码" //ip/sharing_folder /mountpoint// 这是在redhat下。cifs在其他的系统下可能不对。刚知道还可以这样。。。。都不用samba.... [转] 如何在Windows和Linux中共享文件?samba也许是个不错的选择。但是我用的CentOS5中若用smbfs就是一个...
阅读全文
摘要:这是因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上. 如果需要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的用户执行如下命令
xhost + 远程访问时也会出现类似问题:
第一步:用root登陆linux,启动vnc服务;
第二步:根据vnc起来的端口,设置export DISPLAY=localhost:1(1表示vnc在第一...
阅读全文

浙公网安备 33010602011771号