`
mactonish
  • 浏览: 16306 次
  • 性别: Icon_minigender_2
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表

socket

    博客分类:
  • c
都是新建个socket 然后 客户端是connect +write+read 服务端是bind+while (read +write) client: #include <stdio.h> #include <netinet/in.h> #include <sys/types.h> #include <string.h> int main(){ char* echo_host="192.168.1.105"; int echo_port =7777; int sockfd; ...
转http://blog.yufeng.info/archives/1485 Linux下pipe使用注意事项 作者:Yu Feng 原创文章,转载请注明: 转载自Erlang非业余研究 本文链接地址: Linux下pipe使用注意事项 Linux下的pipe使用非常广泛, shell本身就大量用pipe来粘合生产者和消费者的. 我们的服务器程序通常会用pipe来做线程间的ipc通讯. 由于unix下的任何东西都是文件,只要是文件,在读取的时候,,就会设置last access time, 所以pipe也不例外., 但是这个时间对我们没有意义 如果pipe使用的非常频繁的时候会 ...

getpwnam

    博客分类:
  • c
#include <stdio.h> #include <pwd.h> int main() { struct passwd * pw; char *username = "apple"; pw = getpwnam(username); if (!pw) { printf("%s is not exist\n", username); return -1; } ...

signal

    博客分类:
  • c
信号,kill只是个传递信号的作用 apue10 fig10_2_signal.c 造一个死循环,无限等待 我们必须区分系统调用和函数。当捕捉到某个信号时,被中断的是 内核中执行的系统调用。 #include <stdio.h> #include <stdlib.h> #include <signal.h> static void sig_usr(int); /* one handler for both signals */ int main(void) { if (signal(SIGUSR1, sig_usr) == S ...
http://www.ollydbg.de/version2.html 参考http://baike.baidu.com/view/370622.htm#2 od od 命令用途:以指定格式显示文件。 语法   使用字符串类型显示文件,来格式化输出。   od [ -v ] [ -A AddressBase ] [ -N Count ] [ -j Skip ] [ -t TypeString ... ] [ File ... ]   使用标志显示文件,来格式化输出。   od [ -a ] [ -b ] [ -c ] [ -C ] [ -d ] [ -D ] [ -e ] [ -f ] [ - ...

字符串处理

expr index haohao ao expr length hao,hao expr substr hao,hao 2 3 [root@red54apple shell]# expr match "hao123" '[0-9]'  0 [root@red54apple shell]# expr match "123" '[0-9]*'    3 [root@red54apple shell]# expr match "123d" '[0-9]* 3 等价 [root@red54apple shell]# expr 123 ...

locate

mac下locate 文件名 会报错 sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist apple:~ apple$ locate errno.h WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the following command: sudo launchctl load -w /System/Library/Lau ...
apue 04.pdf S _ I S L N K ( ) S _ I S S O C K ( ) 符号连接( P O S I X . 1 或 S V R 4无此类型) 套接字( P O S I X . 1 或 S V R 4无此类型) 为了跨平台,代码写成#ifdef这种 #include "apue.h" int main(int argc, char *argv[]) { int i; struct stat buf; char *ptr; for (i = 1; i < arg ...

extern c

http://baike.baidu.com/view/2814224.htm (1) 被extern "C"限定的函数或变量是extern类型的   extern是C/C++语言中表明函数和全局变量作用范围(可见性)的关键字,该关键字告诉编译器,其声明的函数和变量可以在本模块或其它模块中使用。 (2) 被extern "C"修饰的变量和函数是按照C语言方式编译和连接的
grep --exclude=tags -R "socket" * 不在tags里面搜
转http://blog.163.com/mageng11@126/blog/static/14080837420110211753226/ :set list :set nolist

c++ string

    博客分类:
  • c
string----------- #include <string> #include <iostream> using std::string; int main(){ string aa="hao"; std::cout<<aa; return 0; } 基本输出------------- #include <stdio.h> main() { int c; while ((c = getchar()) != EOF) ...

转 lsof

转http://wowubuntu.com/lsof.html Unix 调试的瑞士军刀:lsof 23六 2011 # 作者: 投稿/转载 / 本文采用CC BY-NC-SA 2.5协议授权,转载请注明本文链接。 本文转载自黑客志 (这是一个多人协作的群体Blog,旨在为国内开发者提供新鲜和高质量的黑客文章,文章主要来源为 Hacker News。) 原文地址:Unix调试的瑞士军刀:lsof / 原作者: @Yuanyi Zhang 这是“你应该知道的Unix和Linux命令”系列的第三篇,在这篇文章中,我会介绍lsof这个工具,如果说netcat是进行网络诊断的瑞士军刀 ...

windows route

转 http://wenku.baidu.com/view/2d80662c0066f5335a81215e.html
转载http://312788172.iteye.com/blog/718083 linux安装中文语言包 今天一开发组同事写了个程序,跑出来的东西有乱码,我了解了一下可能是语言包不全导致,给他用yum安装了相应的中文语言包问题就解决了,相关配置如下: yum install fonts-chinese.noarch yum install m17n-db-common-cjk yum install m17n-db-chinese 安装上面的几个语言包重启就正常了
Global site tag (gtag.js) - Google Analytics