摘要:
VirtualBox的提供了四种网络接入模式,它们分别是:1、NAT 网络地址转换模式(NAT,Network Address Translation)2、Bridged Adapter 桥接模式3、Internal 内部网络模式4、Host-only Adapter 主机模式第一种 NAT模式解释:NAT模式是最简单的实现虚拟机上网的方式,你可以这样理解:Vhost访问网络的所有数据都是由主机提供的,vhost并不真实存在于网络中,主机与网络中的任何机器都不能查看和访问到Vhost的存在。虚拟机与主机关系:只能单向访问,虚拟机可以通过网络访问到主机,主机无法通过网络访问到虚拟机。虚拟机与网络 阅读全文
摘要:
因为使用的是centosmini,所以上面缺少下载工具wget,还有make也不存在,所以首先安装他们yum -y install wgetyum -y install make然后使用wget下载pcre 和zlib nginx因为nginx要前面两个库wgethttp://nginx.org/download/nginx-1.5.3.tar.gzwgethttp://zlib.net/zlib-1.2.8.tar.gzwgetftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.gz首先解压三个压缩文件tar 阅读全文
摘要:
默认安装vim7.2所以需要安装一个gcc 和g++命令依次是yum -y install gccyum -y install gcc gcc-c++首先要联网则是修改/etc/sysconfig/network-scripts/ifcfg-eth0 将NOBOOT从no改为yes增加一个用户useradd demps -s /bin/sh -d /home/demps创建用户后在root用户下passwd设置用户密码Centos里的VI只默认安装了vim-minimal-7.x。所以无论是输入vi或者 vim查看文件,syntax功能都无法正常启用。因此需要用yum安装另外两个组件:vim- 阅读全文
摘要:
pread 这个函数必须要有,别的都不是很重要还有记住不能同时在一个函数内同时调用pread和pwrite要不会出错的 阅读全文
摘要:
订购的办法是发送 subscribe linux-c-programming到Majordomo@vger.kernel.org然后会接收到一个确认信息,If you really want this action to be taken, please send the followingcommands (exactly as shown) back to "Majordomo@vger.kernel.org":auth e72140e3 subscribe linux-c-programming ***@gmail.com然后把auth e72140e3 subscr 阅读全文
摘要:
安装visudo apt-get install vimsudo apt-get install cscopesudo apt-get install ctags然后在/etc/vim/vimrc 中添加if has("cscope")set cscopetagset csto=0if filereadable("cscope.out") cs add cscope.out " else add the database pointed to by environment variable elseif $CSCOPE_DB != " 阅读全文
摘要:
char s[]= "/home";opendir(s);char s1[] = " /home"char *p = s + 2;opendir(p); 都没有错误。 阅读全文
摘要:
#include #include int main(){ DIR *d1; struct dirent *dir1; const int maxline = 100; char buf[maxline]; printf("please input command\n"); scanf("%s",buf); int i = 0; char c; for(i = 0;i d_name); closedir(d1); ... 阅读全文
摘要:
七天 阅读全文
摘要:
typedef int(*a)(int b);typedef int(c)(int a);int f1(int i){ return i * i;}int f2(a a1,c c1){ int i = 99; printf("%5d %5d\n",a1(i),c1(i)); return a1(i) + c1(i);}int main(){ int j = 199; c c2 = f1; printf("%d\n",c2(j)); printf("%d\n",f2(f1,f1)); return 0;} 阅读全文