03 2013 档案
摘要:Enable your user to run gdb as root without beeing asked for any password:sudo visudoAdd the following line after all other rules:<youruser> ALL=(root) NOPASSWD:/usr/bin/gdbCreate or modify a debug configuration ineclipseto run gdb as roote.g. in Run > Debug Configurations > C/C++ Applic
阅读全文
摘要:# Ubuntu 用户安装文件较器meld使用,以及添加进右键菜单一:文件比较器Meld的安装sudo apt-get install meld# 整合到 Gedit :sudo apt-get install zenity然后打开 Gedit ,打开菜单 Edit - Preferences - Plugins ,开启 External Tools 插件,点击下面的 Configure Plugin ,按左下角的 + 号添加一个新的工具,输入以下代码,并设置一个快捷键。保存好后你就可以通过该快捷键来直接打开 Meld 并载入原始文档与当前编辑的文档进行比较了。(有时候是灰色的就没有办法做到下
阅读全文
摘要:#include <sys/types.h>#include <dirent.h>#include<unistd.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#include "proc.h"/* * 读proc目录文件,查看所指定进程产生的文件是否存在 */pid_t proc_find(const char* name) { DIR* dir; struct dirent* ent; char buf[512]; long pi
阅读全文
摘要:原文地址:http://blog.chinaunix.net/uid-24622573-id-276141.html对于很多服务来说,在同一个服务器上只能运行一个实例,那么通过什么方法来保证程序同一时刻只有一个实例运行呢?通过编写shell脚本来管理程序的启动、停止是个不错的方法。在启动时,shell脚本会创建进程标识文件(存储正在运行实例的pid)以表明已经有实例在运行,如果文件已存在,则说明已有实例在运行,不需要做任何事;在退出时,shell脚本会删除进程标识文件,表明没有实例运行。shell脚本管理方法在应用程序之上再包了一层,那么能不能直接在程序开始运行时自己判断是否有实例在运行呢,答
阅读全文
摘要:download and install:http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuAclient setup:http://ist.berkeley.edu/as-ag/tools/howto/subclipse-setup.html————————————————————————————————————————————————————————————————————Subclipse Eclipse plugin (v1.8.x) requires SVN/JavaHL 1.7.x 的问题:The mos
阅读全文
摘要:简介:相关的函数如下:1 int pthread_cond_init(pthread_cond_t *cond,pthread_condattr_t *cond_attr); 2 int pthread_cond_wait(pthread_cond_t *cond,pthread_mutex_t *mutex);3 int pthread_cond_timewait(pthread_cond_t *cond,pthread_mutex *mutex,const timespec *abstime);4 int pthread_cond_destroy(pthread_cond_t *c...
阅读全文