国外VPS推荐0+

6,361 views / 2013.05.31 / 4:04 下午

不知道不觉中,本站使用的VPS已经三年多了,这三年不管从服务还是稳定性都比较满意。前文(http://www.71j.cn/archives/250)已经做过推荐了,忍不住再推荐下:
http://www.diahosting.com/client/aff.php?aff=1041
有任何使用问题可联系24小时QQ客服或者电话。

Categories: 感悟 Tags:

Cisco AnyConnect VPN 在linux系统下连接方法[通用]0+

11,014 views / 2013.05.30 / 4:04 下午

前文介绍了针对Cisco AnyConnect VPN在win8和mac系统下的连接方法,但有朋友反馈说在mac系统下的软件安装后无法使用。遂奉上@virtman 大师的linux通用方法。

首先安装openconnect

$ sudo yum install openconnect   (在Fedora上,会顺带安装:vpnc-script.noarch,这个包会被openconnect用到)

$ sudo openconnect –script /etc/vpnc/vpnc-script https://your-vpn-server.com

Attempting to connect to 121.0.29.22:443
SSL negotiation with vpn.taobao.org
Server certificate verify failed: signer not found
Certificate from VPN server “your-vpn-server.com” failed verification.
Reason: signer not found
Enter ‘yes’ to accept, ‘no’ to abort; anything else to view: yes
Connected to HTTPS on your-vpn-server.com
GET https://your-vpn-server.com/
Got HTTP response: HTTP/1.0 302 Object Moved
SSL negotiation with your-vpn-server.com
Server certificate verify failed: signer not found
Connected to HTTPS on your-vpn-server.com
GET https://your-vpn-server.com/+webvpn+/index.html
Please enter your username and password.
Username: your-name
PASSCODE: ********
POST https://your-vpn-server.com/+webvpn+/index.html
Got CONNECT response: HTTP/1.1 200 OK
CSTP connected. DPD 30, Keepalive 20
Connected tun0 as 10.1.25.155, using SSL

 

至此,连接成功。ctrl+z然后bg置入后台运行即可。

Categories: 分享 Tags:

奉献出一个封装的curl函数,便于调用0+

3,104 views / 2013.05.30 / 4:04 下午

抓数据专用

 

function curl($url, $ifpost = 0, $datafields = '', $cookiefile = '', $v = false) {
 $header = array("Connection: Keep-Alive","Accept: text/html, application/xhtml+xml, */*", "Pragma: no-cache", "Accept-Language: zh-Hans-CN,zh-Hans;q=0.8,en-US;q=0.5,en;q=0.3","User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)");
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_HEADER, $v);
 curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
 $ifpost && curl_setopt($ch, CURLOPT_POST, $ifpost);
 $ifpost && curl_setopt($ch, CURLOPT_POSTFIELDS, $datafields);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
 curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
 $cookiefile && curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
 $cookiefile && curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
 $r = curl_exec($ch);
 curl_close($ch);
 return $r;
}
Categories: 感悟 Tags: