盛大云主机试用

相比阿里云,盛大的有适合小站长用的。我选择的是最低端的,1核、512M、8G、centos5.4、电信单线(江苏无锡的),超微配置按需租赁,每小时0.087元,现在盛大又送100元代金券,只能支付按需收费的产品,按需的还搞六折。申请提交上去后,大概3-5分钟就可以使用了。然后装好lnmp后(很久),后台制作了一个镜像,方便下次重装。悲剧的是没有重装按钮,只能删除,重新申请,选择镜像,但每次的IP又不一样的。

后台有个安全组菜单,要想做网站必须在这勾选80端口,想ping的通也要勾选相应的选项,这样的话linux自带的iptable就可以卸载掉了。

这是下载国外的100m文件速度,慢慢加速的。

ping的值。。。

AMD Opteron(tm) Processor 6172    十二核的CPU

8G的硬盘装了系统后剩3.8G多。。。

除了国内的访问速度,貌似没什么优势。。。

plist保存的两种文件类型

plist文件保存有两种方式,一种是正常的像xml一样保存的,一种是二进制保存的。二进制的文件头有bplist00这个关键字。这两种文件libplist都能解析出来。

// ReadPlist.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <Windows.h>
#include <stdio.h>
#include <plist/plist.h>

#pragma comment(lib, "libplist.lib")
int main(int argc, char* argv[])
{
 char file_name[MAX_PATH] = {0};

 char *data = NULL;

 plist_t pl = NULL;

 FILE *fp = NULL;

 int file_len = 0;

 char *p_data = NULL;
 unsigned __int32 p_len = 0;

 printf("请输入文件名:");

 scanf("%s", file_name);

 fp = fopen(file_name, "rb");
 if(!fp)
  goto _out;

 fseek(fp, 0, SEEK_END);
 file_len = ftell(fp);
 fseek(fp,0,SEEK_SET);

 data = (char*)malloc(file_len);
 if(!data)
  goto _out;

 fread(data, 1, file_len, fp);

 if(memcmp(data, "bplist00", 8))
 {
  printf("%s n", data);
 }
 else
 {
  plist_from_bin(data, file_len, &pl);
  plist_to_xml(pl, &p_data, &p_len);
  printf("%s n", p_data);
 }

 system("pause");

_out:
 if(fp)
  fclose(fp);
 if(pl)
  plist_free(pl);
 if (p_data)
  free(p_data);
 if(data)
  delete []data;

 return 0;
} 

需要注意的是libplist解析出来是utf-8编码的

VC6.0编译好的CURL-7.23.1静态库

费了九牛二虎之力。在网上找了很多资料。

libcurl能做什么???支持https、http、ftp、pop3、smtp、scp、sftp、tftp、等等。。。支持cookie等等。。。拿来采集什么的最方便了。。。

看官方介绍就知道有多强大了。。。http://curl.haxx.se/libcurl/

libcurl is a free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP. libcurl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos), file transfer resume, http proxy tunneling and more!

libcurl is highly portable, it builds and works identically on numerous platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX, IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, BeOs, Mac OS X, Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS and more...

libcurl is free, thread-safe, IPv6 compatible, feature rich, well supported, fast, thoroughly documented and is already used by many known, big and successful companies and numerous applications.

使用时要定义 #define CURL_STATICLIB  这个宏

curl依赖于openssl和zlib,编译时用的zlib-1.2.5,openssl-0.9.8r。

在vc6.0能用亲测的。。。

点我下载

参考:

http://blog.csdn.net/long80226/article/details/5988358

http://blog.sina.com.cn/s/blog_451aab2f010095or.html

 

编译好的windows版本的libplist

  这个解析苹果的plist专用的。用cmake搞了好久才弄出来的。运行要有libxml2.dll和zlib1.dll。经过试验可以用。源码demo都在。 点这里下载

// TestPlist.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <plist/plist.h>
#include <stdlib.h>

#pragma comment(lib, "libplist.lib")

int main(int argc, char* argv[])
{

 char *payload = NULL;
 unsigned __int32 payload_size = 0;

 plist_t dict = plist_new_dict();

 plist_dict_insert_item(dict, "这是key", plist_new_string("这是string"));

 plist_to_xml(dict, &payload, &payload_size);
 plist_free(dict);

 printf("%s n" , payload);
 free(payload);

 return 0;
}