使用方法:
putty左侧分类选择Connection->Data,右侧一目了然。填好账号密码后,可以在Session中保存。现在是明文保存,存在一定风险,请勿保存未做安全措施线上服务器信息。
修改方法:
0. 网上搜索了教程,基本都是针对putty0.6版本的,对于C++水平较弱的人来说,参考教程给的思路,整理了一下方法。大体思路就是利用ssh可以保存用户名的功能扩展成保存密码的功能,基本采用复制username修改为password的方式制作,目前只支持SSH2登录方式,对于大多数linux服务器来讲足够了。

1. 官网下载putty源码 http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
2. 使用VS2012以上C++编译项目
3. 修改config.c文件1952行,增加:

ctrl_editbox(s, "Auto-login password", 'w', 50,
HELPCTX(connection_password),
conf_editbox_handler, I(CONF_password), I(1));

4. 修改putty.h文件712行,增加:
X(STR, NONE, password) \
X(INT, NONE, password_from_env) \

5. 修改winhelp.h文件78行,增加:
#define WINHELP_CTX_connection_password "connection.password:config-password"
#define WINHELP_CTX_connection_password_from_env "connection.passwordfromenv:config-password-from-env"

6. 修改ssh.c文件,搜索Send the password packet
在注释下面增加:
oYeah:;

找到ssh2_pkt_addstring(s->pktout, s->password);
替换s->password为ssh->password

搜索Plain old password authentication.
在下面代码
add_prompt(s->cur_prompt, dupprintf("%s@%s's password: ",
ssh->username,
ssh->savedhost),
FALSE);
的后面增加:
ssh->password = conf_get_str(ssh->conf, CONF_password);
s->password = ssh->password;
if (strlen(ssh->password) == 0) {
ret = get_userpass_input(s->cur_prompt, NULL, 0);
while (ret < 0) {
ssh->send_ok = 1;
crWaitUntilV(!pktin);
ret = get_userpass_input(s->cur_prompt, in, inlen);
ssh->send_ok = 0;
}
}
else {
ret = 1;
goto oYeah;
}

dialog.c

增加

union control *ctrl_editpasswordbox(struct controlset *s, char *label, char shortcut,
int percentage,
intorptr helpctx, handler_fn handler,
intorptr context, intorptr context2)
{
union control *c = ctrl_new(s, CTRL_EDITBOX, helpctx, handler, context);
c->editbox.label = label ? dupstr(label) : NULL;
c->editbox.shortcut = shortcut;
c->editbox.percentwidth = percentage;
c->editbox.password = 1;
c->editbox.has_list = 0;
c->editbox.context2 = context2;
return c;
}

这里的c->editbox.password = 1;说明该文本框为密码类型

.config 引用的地方也要改为对应的函数

ctrl_editpasswordbox(s, "Auto-login password", 'w', 50,
HELPCTX(connection_password),
conf_editbox_handler, I(CONF_password), I(1));

点击下载:putty.0.64

download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-5-x86-devel.tar.gz">centos-5-x86-devel.tar.gz 21-Oct-2014 22:12 197M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-5-x86-devel.tar.gz.asc">centos-5-x86-devel.tar.gz.asc 21-Oct-2014 22:36 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-5-x86.tar.gz">centos-5-x86.tar.gz 21-Oct-2014 22:11 174M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-5-x86.tar.gz.asc">centos-5-x86.tar.gz.asc 21-Oct-2014 22:37 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-5-x86_64-devel.tar.gz">centos-5-x86_64-devel.tar.gz 21-Oct-2014 22:15 213M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-5-x86_64-devel.tar.gz.asc">centos-5-x86_64-devel.tar.gz.asc 21-Oct-2014 22:36 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-5-x86_64.tar.gz">centos-5-x86_64.tar.gz 21-Oct-2014 22:13 189M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-5-x86_64.tar.gz.asc">centos-5-x86_64.tar.gz.asc 21-Oct-2014 22:36 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-6-x86-devel.tar.gz">centos-6-x86-devel.tar.gz 21-Oct-2014 22:07 234M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-6-x86-devel.tar.gz.asc">centos-6-x86-devel.tar.gz.asc 21-Oct-2014 22:37 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-6-x86-minimal.tar.gz">centos-6-x86-minimal.tar.gz 21-Oct-2014 22:06 103M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-6-x86-minimal.tar.gz.asc">centos-6-x86-minimal.tar.gz.asc 21-Oct-2014 22:37 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-6-x86.tar.gz">centos-6-x86.tar.gz 21-Oct-2014 22:05 203M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-6-x86.tar.gz.asc">centos-6-x86.tar.gz.asc 21-Oct-2014 22:37 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-6-x86_64-devel.tar.gz">centos-6-x86_64-devel.tar.gz 21-Oct-2014 22:10 249M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-6-x86_64-devel.tar.gz.asc">centos-6-x86_64-devel.tar.gz.asc 21-Oct-2014 22:37 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-6-x86_64-minimal.tar.gz">centos-6-x86_64-minimal.tar.gz 21-Oct-2014 22:09 103M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-6-x86_64-minimal.tar.gz.asc">centos-6-x86_64-minimal.tar.gz.asc 21-Oct-2014 22:37 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-6-x86_64.tar.gz">centos-6-x86_64.tar.gz 21-Oct-2014 22:08 216M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-6-x86_64.tar.gz.asc">centos-6-x86_64.tar.gz.asc 21-Oct-2014 22:37 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-7-x86_64-minimal.tar.gz">centos-7-x86_64-minimal.tar.gz 21-Oct-2014 22:16 131M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-7-x86_64-minimal.tar.gz.asc">centos-7-x86_64-minimal.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/centos-7-x86_64.tar.gz">centos-7-x86_64.tar.gz 21-Oct-2014 22:16 201M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/centos-7-x86_64.tar.gz.asc">centos-7-x86_64.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/folder.gif" alt="[DIR]" /> download.openvz.org/template/precreated/contrib/">contrib/ 18-Nov-2014 13:04 -
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-6.0-x86-minimal.tar.gz">debian-6.0-x86-minimal.tar.gz 21-Oct-2014 22:03 77M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-6.0-x86-minimal.tar.gz.asc">debian-6.0-x86-minimal.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-6.0-x86.tar.gz">debian-6.0-x86.tar.gz 21-Oct-2014 22:02 148M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-6.0-x86.tar.gz.asc">debian-6.0-x86.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-6.0-x86_64-minimal.tar.gz">debian-6.0-x86_64-minimal.tar.gz 21-Oct-2014 22:04 79M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-6.0-x86_64-minimal.tar.gz.asc">debian-6.0-x86_64-minimal.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-6.0-x86_64.tar.gz">debian-6.0-x86_64.tar.gz 21-Oct-2014 22:04 150M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-6.0-x86_64.tar.gz.asc">debian-6.0-x86_64.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-7.0-x86-minimal.tar.gz">debian-7.0-x86-minimal.tar.gz 21-Oct-2014 22:00 84M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-7.0-x86-minimal.tar.gz.asc">debian-7.0-x86-minimal.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-7.0-x86.tar.gz">debian-7.0-x86.tar.gz 21-Oct-2014 21:59 224M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-7.0-x86.tar.gz.asc">debian-7.0-x86.tar.gz.asc 21-Oct-2014 22:39 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-7.0-x86_64-minimal.tar.gz">debian-7.0-x86_64-minimal.tar.gz 21-Oct-2014 22:01 84M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-7.0-x86_64-minimal.tar.gz.asc">debian-7.0-x86_64-minimal.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/debian-7.0-x86_64.tar.gz">debian-7.0-x86_64.tar.gz 21-Oct-2014 22:01 224M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/debian-7.0-x86_64.tar.gz.asc">debian-7.0-x86_64.tar.gz.asc 21-Oct-2014 22:38 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/fedora-19-x86.tar.gz">fedora-19-x86.tar.gz 21-Oct-2014 21:50 190M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/fedora-19-x86.tar.gz.asc">fedora-19-x86.tar.gz.asc 21-Oct-2014 22:39 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/fedora-19-x86_64.tar.gz">fedora-19-x86_64.tar.gz 21-Oct-2014 21:52 190M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/fedora-19-x86_64.tar.gz.asc">fedora-19-x86_64.tar.gz.asc 21-Oct-2014 22:39 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/fedora-20-x86.tar.gz">fedora-20-x86.tar.gz 21-Oct-2014 21:48 184M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/fedora-20-x86.tar.gz.asc">fedora-20-x86.tar.gz.asc 21-Oct-2014 22:39 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/fedora-20-x86_64.tar.gz">fedora-20-x86_64.tar.gz 21-Oct-2014 21:49 185M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/fedora-20-x86_64.tar.gz.asc">fedora-20-x86_64.tar.gz.asc 21-Oct-2014 22:39 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/scientific-6-x86.tar.gz">scientific-6-x86.tar.gz 21-Oct-2014 22:18 197M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/scientific-6-x86.tar.gz.asc">scientific-6-x86.tar.gz.asc 21-Oct-2014 22:40 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/scientific-6-x86_64.tar.gz">scientific-6-x86_64.tar.gz 21-Oct-2014 22:19 210M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/scientific-6-x86_64.tar.gz.asc">scientific-6-x86_64.tar.gz.asc 21-Oct-2014 22:39 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/suse-12.3-x86.tar.gz">suse-12.3-x86.tar.gz 21-Oct-2014 21:42 190M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/suse-12.3-x86.tar.gz.asc">suse-12.3-x86.tar.gz.asc 21-Oct-2014 22:40 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/suse-12.3-x86_64.tar.gz">suse-12.3-x86_64.tar.gz 21-Oct-2014 21:43 191M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/suse-12.3-x86_64.tar.gz.asc">suse-12.3-x86_64.tar.gz.asc 21-Oct-2014 22:40 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/suse-13.1-x86-minimal.tar.gz">suse-13.1-x86-minimal.tar.gz 21-Oct-2014 21:45 55M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/suse-13.1-x86-minimal.tar.gz.asc">suse-13.1-x86-minimal.tar.gz.asc 21-Oct-2014 22:40 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/suse-13.1-x86.tar.gz">suse-13.1-x86.tar.gz 21-Oct-2014 21:45 229M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/suse-13.1-x86.tar.gz.asc">suse-13.1-x86.tar.gz.asc 21-Oct-2014 22:40 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/suse-13.1-x86_64-minimal.tar.gz">suse-13.1-x86_64-minimal.tar.gz 21-Oct-2014 21:47 56M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/suse-13.1-x86_64-minimal.tar.gz.asc">suse-13.1-x86_64-minimal.tar.gz.asc 21-Oct-2014 22:40 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/suse-13.1-x86_64.tar.gz">suse-13.1-x86_64.tar.gz 21-Oct-2014 21:47 232M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/suse-13.1-x86_64.tar.gz.asc">suse-13.1-x86_64.tar.gz.asc 21-Oct-2014 22:40 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-10.04-x86.tar.gz">ubuntu-10.04-x86.tar.gz 21-Oct-2014 21:57 133M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-10.04-x86.tar.gz.asc">ubuntu-10.04-x86.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-10.04-x86_64.tar.gz">ubuntu-10.04-x86_64.tar.gz 21-Oct-2014 21:58 137M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-10.04-x86_64.tar.gz.asc">ubuntu-10.04-x86_64.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86-minimal.tar.gz">ubuntu-12.04-x86-minimal.tar.gz 21-Oct-2014 21:55 57M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86-minimal.tar.gz.asc">ubuntu-12.04-x86-minimal.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86.tar.gz">ubuntu-12.04-x86.tar.gz 21-Oct-2014 21:55 123M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86.tar.gz.asc">ubuntu-12.04-x86.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86_64-minimal.tar.gz">ubuntu-12.04-x86_64-minimal.tar.gz 21-Oct-2014 21:56 58M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86_64-minimal.tar.gz.asc">ubuntu-12.04-x86_64-minimal.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86_64.tar.gz">ubuntu-12.04-x86_64.tar.gz 21-Oct-2014 21:56 125M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-12.04-x86_64.tar.gz.asc">ubuntu-12.04-x86_64.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86-minimal.tar.gz">ubuntu-14.04-x86-minimal.tar.gz 21-Oct-2014 21:53 73M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86-minimal.tar.gz.asc">ubuntu-14.04-x86-minimal.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86.tar.gz">ubuntu-14.04-x86.tar.gz 21-Oct-2014 21:52 145M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86.tar.gz.asc">ubuntu-14.04-x86.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86_64-minimal.tar.gz">ubuntu-14.04-x86_64-minimal.tar.gz 21-Oct-2014 21:54 75M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86_64-minimal.tar.gz.asc">ubuntu-14.04-x86_64-minimal.tar.gz.asc 21-Oct-2014 22:41 198
download.openvz.org/icons/compressed.gif" alt="[ ]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86_64.tar.gz">ubuntu-14.04-x86_64.tar.gz 21-Oct-2014 21:54 147M
download.openvz.org/icons/text.gif" alt="[TXT]" /> download.openvz.org/template/precreated/ubuntu-14.04-x86_64.tar.gz.asc">ubuntu-14.04-x86_64.tar.gz.asc 21-Oct-2014 22:41 198

http://download.openvz.org/template/precreated/

http://npm.taobao.org/

淘宝 NPM 镜像

这是一个完整 npmjs.org 镜像,你可以用此代替官方版本(只读),同步频率目前为 10分钟 一次以保证尽量与官方服务同步。

  • 当前 registry.npm.taobao.org 是从 registry.npmjs.org 进行全量同步的.
  • 当前 npm.taobao.org 运行版本是: cnpmjs.org@2.0.0-beta3
  • 本系统运行在 Node.js@v0.11.14 上.
  • nodejs.org/dist 镜像: npm.taobao.org/dist
  • downloads">phantomjs downloads 镜像: phantomjs mirror
  • Node.js 文档镜像: Node.js Document
113,488 个模块 615,221 个模块版本 7 次删除
22,867 次本日下载 474,895 次本周下载 1,792,093 次本月下载
68,299 次昨日下载 488,804 次上周下载 2,211,639 次上月下载

同步状态

This registry will sync all packages from official registry.

上次同步完成时间: Fri Nov 28 2014 13:55:10 GMT+0800 (中国标准时间)

Code4App 原创文章。转载请注明出处:http://code4app.com/article/cocoapods-install-usage

目录

  • CocoaPods是什么?
  • 如何下载和安装CocoaPods?
  • 如何使用CocoaPods?
    • 场景1:利用CocoaPods,在项目中导入AFNetworking类库
    • 场景2:如何正确编译运行一个包含CocoPods类库的项目

CocoaPods是什么?

当你开发iOS应用时,会经常使用到很多第三方开源类库,比如JSONKit,AFNetWorking等等。可能某个类库又用到其他类库,所以要使用它,必须得另外下载其他类库,而其他类库又用到其他类库,“子子孙孙无穷尽也”,这也许是比较特殊的情况。总之小编的意思就是,手动一个个去下载所需类库十分麻烦。另外一种常见情况是,你项目中用到的类库有更新,你必须得重新下载新版本,重新加入到项目中,十分麻烦。如果能有什么工具能解决这些恼人的问题,那将“善莫大焉”。所以,你需要 CocoaPods。

CocoaPods应该是iOS最常用最有名的类库管理工具了,上述两个烦人的问题,通过cocoaPods,只需要一行命令就可以完全解决,当然前提是你必须正确设置它。重要的是,绝大部分有名的开源类库,都支持CocoaPods。所以,作为iOS程序员的我们,掌握CocoaPods的使用是必不可少的基本技能了。

如何下载和安装CocoaPods?

在安装CocoaPods之前,首先要在本地安装好Ruby环境。至于如何在Mac中安装好Ruby环境,请google一下,本文不再涉及。

软件仅供好友测试使用,无任何商业用途,如有人恶意传播或损害作者利益,将受到谴责。

一切非本作者博客发布的下载地址以外的任何渠道,无法保证其安全性和完整性,请网友注意。

申请方法:

在该页面下方评论中提交你的旺旺名,作者将不定期将旺旺名加入白名单中。

基本使用方法:

1.首先点击帮助右侧的按钮,输入你的旺旺名。前提是该用户名已经加入作者设定的白名单内。

2.在单品页面点击“返”按钮,如果存在返利数据,页面将自动跳转,只有跳转结束后的购买方可列入返利范畴。

QQ20130822115657

3.收入会存入登录旺旺名所在阿里妈妈平台的账户中,请确保你所使用的旺旺名已开通阿里妈妈(http://www.alimama.com/)并绑定支付宝,阿里妈妈的规则请自行参考阿里妈妈网站。

免责声明:

作者不会通过此软件获得任何利益,并无意于侵害他人利益。

请使用者注意以下几点(包括但不限于):

不得恶意修改他人淘宝客链接

不得通过本软件获得一切非法利益

仅限个人使用

下载地址:

download/fanli.rar" target="_blank">本地下载

最有爱的3D实景版马里奥视频

来源于威锋网

http://tech.weiphone.com/2012-12-03/3D_Virtual_Edition_Mario_video_love_540064.shtml

        马里奥游戏大家自然是再熟悉不过了,水管、蘑菇、乌龟壳和跳上跳下的高低平台都是我们童年到年长的记忆。但是你想象过当马里奥来到现实世界里是什么情景吗?来看看一位国外网友发表的现实场景版马里奥冒险视频,绝对原汁原味,超乎你的想象。

download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">

这部有爱的小短片里,马里奥世界和现实世界互相穿越到了一起,在我们日常的超市、厨房、书房、大街上、小花园里,看看马里奥大叔是如何以惊人适应力淡定地穿梭在现实世界中。然后视角一转,他竟然在房间里和路易、蘑菇头他们来了一把现实版的马里奥赛车,赛道还是用 SFC 卡带摆出来的,作者你晒够了没有!

马里奥和库巴大 Boss 的决斗在一辆行驶的汽车上进行,搞笑的是最后他用卡带机弹卡的卑鄙招式把库巴打飞了。视频全程充满各种笑点,但是又极具创意,毫无违和感,看得出做视频的一定是位高端任饭。这款游戏曾带给我们的欢乐已经无法说清,如今玩家们也在以不同的方式将这些欢乐再次传递和反馈,真的很可爱。

 

第2层隧道协议 (L2TP),是 VPN 隧道协议的一种,是 PPTP 的后续版本。L2TP 支持两端点间多隧道,但通常要由 IPSec 来提供加密和验证功能,可建立变动的客户端到固定服务器的连接。

一、安装 IPSec

IPSec 用于对 IP 数据包进行加密和验证,通常使用 Openswan 来实现 IPSec。

1.1、安装编译工具

1
apt-get -y install build-essential

1.2、安装 OpenSwan 依赖包

1
apt-get -y install libgmp3-dev flex bison

1.3、编译安装 OpenSwan

1
2
3
4
wget -c http://www.openswan.org/download/openswan-2.6.33.tar.gz
tar -zxf openswan-2.6.33.tar.gz
cd openswan-2.6.33
make programs install

1.4、编辑 IPSec 配置文件

注意将"192.168.1.102"换成服务器公网IP。

1
cp /etc/ipsec.conf /etc/ipsec.conf.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
cat >/etc/ipsec.conf<<EOF
version 2.0

config setup
    nat_traversal=yes
    virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12
    oe=off
    protostack=netkey

conn L2TP-PSK-NAT
    rightsubnet=vhost:%priv
    also=L2TP-PSK-noNAT

conn L2TP-PSK-noNAT
    authby=secret
    pfs=no
    auto=add
    keyingtries=3
    rekey=no
    ikelifetime=8h
    keylife=1h
    type=transport
    left=192.168.1.102
    leftprotoport=17/1701
    right=%any
    rightprotoport=17/%any
EOF

1.5、设置 PSK 预共享密钥

注意将"192.168.1.102"换成服务器公网IP。将"123456"换成你自己的PSK。

1
2
3
cat >/etc/ipsec.secrets<<EOF
192.168.1.102 %any: PSK "123456"
EOF

1.6、调整网络策略

for 循环语句,请一行一行地输入,输完后按回车。

1
2
3
4
5
for each in /proc/sys/net/ipv4/conf/*
do
echo 0 > $each/accept_redirects
echo 0 > $each/send_redirects
done

1.7、重启IPSec 服务

1
2
/etc/init.d/ipsec restart
/usr/local/sbin/ipsec verify

可尝试使用 L2TP/IPSec 客户端连接一次,以测试 IPSec 部分配置是否成功。

1
cat /var/log/auth.log | grep pluto

如出现"IPsec SA established transport mode"则成功了。

二、安装 L2TP

使用 xl2tpd 来实现 L2TP,另外要注意的是 xl2tpd 需要从 rp-l2tp 中提取 l2tp-control。

2.1、提取 l2tp-control

1
2
3
4
5
6
7
8
wget http://nchc.dl.sourceforge.net/project/rp-l2tp/rp-l2tp/0.4/rp-l2tp-0.4.tar.gz
tar zxvf rp-l2tp-0.4.tar.gz
cd rp-l2tp-0.4
./configure
make
cp handlers/l2tp-control /usr/local/sbin/
mkdir /var/run/xl2tpd/
ln -s /usr/local/sbin/l2tp-control /var/run/xl2tpd/l2tp-control

2.2、编译安装 xl2tpd

1
apt-get -y install libpcap-dev #安装依赖包
1
2
3
4
5
wget -c http://www.xelerance.com/wp-content/uploads/software/xl2tpd/xl2tpd-1.2.8.tar.gz
tar -zxf xl2tpd-1.2.8.tar.gz
cd xl2tpd-1.2.8
make install
mkdir /etc/xl2tpd

2.3、编辑 xl2tpd 配置文件

ip range 是连接上来的客户端所获得的服务器端内网的 IPv4 地址段。
local ip 是 pppX 所占用的那个 IP 地址。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
cat >/etc/xl2tpd/xl2tpd.conf<<EOF
[global]
ipsec saref = yes

[lns default]
local ip = 10.10.11.1
ip range = 10.10.11.2-10.10.11.245
refuse chap = yes
refuse pap = yes
require authentication = yes
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
EOF

三、PPP 的安装配置

3.1、安装 ppp 包

1
apt-get -y install ppp

3.2、配置 options.xl2tpd

主要是改MS-DNS,其他默认。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cat >/etc/ppp/options.xl2tpd<<EOF
require-mschap-v2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
asyncmap 0
auth
crtscts
lock
hide-password
modem
debug
name l2tpd
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
EOF

四、添加 VPN 用户

chap-secrets 文件为4段,分别是:用户名、服务器名称、密码、分配给客户端的IP。
服务器名可以是l2tpd 或 pptpd,*号代表全部。
密码以明文填写,不需进行加密。
最后的*号代表从remoteip指定的IP段随机分配

1
2
3
cat >>/etc/ppp/chap-secrets<<EOF
user * 123456 *
EOF

五、配置数据包转发

否则连接VPN后,只能访问服务器资源,而不能访问这台服务器以外的资源。

1
2
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
sysctl -p

开启iptables转发

1
iptables -t nat -A POSTROUTING -j MASQUERADE

设置MTU

1
iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356

六、启动 xl2tpd 服务

1
2
/usr/local/sbin/xl2tpd
/usr/local/sbin/xl2tpd -D #以调式模式启动

参考资料:

1. http://www.linuxhomenetworking.com/wiki/index.php
2. http://www.linode.com/wiki/index.php/AndroidL2TPPSKServer
3. https://humou.net/blog/201102061326.html
4. http://b.gkp.cc/2010/06/19/setup-ipsec-l2tp-on-centos-55/
5. http://apple4.us/2010/05/setting-up-l2tp-vpn-on-debian-ubuntu.html

原文地址 : http://wangyan.org/blog/debian-l2tp-ipsec-vpn.html
本站遵循 : 知识共享署名-非商业性使用-相同方式共享 3.0 版权协议
版权声明 : 原创文章转载时,请务必以超链接形式标明 文章原始出处

Hyper-V安装CentOS 6.3后无法安装LIC3.3,也就是Linux Integration Services V3.3 集成服务,安装时报错,显示kernel(clocksource_register)神马神马的,总之是不让装。

参考了洋同志们给的帮助 http://social.technet.microsoft.com/Forums/zh-CN/linuxintegrationservices/thread/0b94561d-9d15-4d9d-97ec-a67580c4db8a

顺利解决,貌似是将linux内核降到 2.6.32-71

我用的是64位的,所以找到以下内核的下载地址,进行安装。

Download

mirror.switch.ch kernel-devel-2.6.32-71.el6.x86_64.rpm
ftp.ntua.gr kernel-devel-2.6.32-71.el6.x86_64.rpm
ftp.icm.edu.pl kernel-devel-2.6.32-71.el6.x86_64.rpm
ftp.icm.edu.pl kernel-devel-2.6.32-71.el6.x86_64.rpm
ftp.pbone.net kernel-devel-2.6.32-71.el6.x86_64.rpm
ftp.pbone.net kernel-devel-2.6.32-71.el6.x86_64.rpm  

rpm -i --force kernel-2.6.32-71.el6.x86_64.rpm

reboot

然后再加载LIC3.3,安装即可。

原先在hyper-v下安装linux,只能搭配旧的网络适配器,不支持hyper-v内建的。所以我们需要安装Linux Integration Services。

Linux Integration Services 3.2下载地址

http://www.microsoft.com/downloads/zh-cn/details.aspx?FamilyID=216de3c4-f598-4dff-8a4e-257d4b7a1c12

用hyper-v管理工具加载Linux IC v3.2.iso,将里面的文件复制到一个目录下,如:/usr/local/data-original/cdrom

执行./install.sh

安装完毕后会提示reboot,我们这时执行halt,关闭服务器。

然后我们需要对虚拟机进行设置,移除旧的网络适配器,加入新的,这里必须选择手动指定MAC地址,记住这个MAC地址,一会儿要用到。

开启虚拟机

vi /etc/sysconfig/network-scripts/ifcfg-eth0

我们要注意一点,DEVICE这里要填seth0,HWADDR填写刚刚在hyper-v管理器中手动指定的MAC地址。如下:

DEVICE="seth0"
HWADDR="<Default MAC address>"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE=Ethernet
NAME="Seth0"
IPADDR="<IP Address>"
NETMASK="<Subnet Mask>"
GATEWAY="<Gatewat IP>"

好了,保存后,就可以重启了。

然后就没有然后了。

When installed on a virtual machine that is running a supported Linux operating system, Linux Integration Services for Hyper-V provides the following functionality:

  • Driver support for synthetic devices: Linux Integration Services supports the synthetic network controller and the synthetic storage controller that were developed specifically for Hyper-V.
  • Fastpath Boot Support for Hyper-V: Boot devices now take advantage of the block Virtualization Service Client (VSC) to provide enhanced performance.
  • Timesync: The clock inside the virtual machine will remain synchronized with the clock on the host.
  • Integrated Shutdown: Virtual machines running Linux can be shut down from either Hyper-V Manager or System Center Virtual Machine Manager, using the "Shut Down" command.
  • Symmetric Multi-Processing (SMP) Support: Supported Linux distributions can use up to 4 virtual processors (VP) per virtual machine.

 

1. Download Linux Integration Components v2.1

a. Download Linux Integration Components v2.1 from downloads/details.aspx?displaylang=en&FamilyID=eee39325-898b-4522-9b4c-f4b5b9b64551" target="_blank">Microsoft Download site.

b. Extract the .exe file into a temp folder. You will need only LinuxIC v21.iso file.

c. Place the LinuxIC v21.iso file into your VM host server where you can mount the ISO as a CDROM for your Centon Virtual Machine.

 

2. Installation

You will need Development Tools installed to be able to compile the Integration Components. You could do that by running yum:

yum groupinstall "Development Tools"

NOTE: This command will try to use your network connection to download and if you used Synthetic Network Adapter for your Hyper-V machine you will not have internet connection. So make sure to install Development Tools during your Centos initial installation.

Now make sure you added LinuxIC v21.iso file to your Hyper-V CDROM as Image.

As the root user, mount the CD in the virtual machine by issuing the following commands at a shell prompt:

mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

Copy Linux Integration Services to the virtual machine and unmount CDROM that no longer needed:

mkdir /opt/linux_ic_v21_rtm
cp –R /mnt/cdrom/* /opt/linux_ic_v21_rtm
umount /mnt/cdrom

As the root user, run the following command to compile and install the synthetic drivers:

cd /opt/linux_ic_v21_rtm/
make
make install

NOTE: If you're using the x64 version of Centos, you have perform an extra step.