iCloud face man-in-the-middle attack in China

Yesterday, I was posted an article to report iCloud got Man-in-the-middle attack in China,
and repost to two major Chinese geek community,

Chinese attacker is running a Man-in-the-middle attack on SSL encrypted traffic between iCloud server and China Unicom users. The ISP (probably asked by the government to do so) replaced the certificate of iCloud with a self-issued one. The government conducted similar attacks against GitHubGoogleWindows Live and Yahoo.


How to unescape cookie value in php which was escaped in javascript

I am a newbie study php recently, I want operate cookie by Javascript need escape and  unescape the value:

<script Language=Javascript>
function SetCookie(name,value)//两个参数,一个是cookie的名子,一个是值

var Days = 30; //此 cookie 将被保存 30 天

var exp = new Date(); //new Date(“December 31, 9998”);
exp.setTime(exp.getTime() + Days*24*60*60*10000);
document.cookie = name + “=”+ escape (value) + “;expires=” + exp.toGMTString();
function getCookie(name)//取cookies函数
var arr = document.cookie.match(new RegExp(“(^| )”+name+”=([^;]*)(;|$)”));
if(arr != null) return unescape(arr[2]); return null;



Sometime we need operate cookie in PHP, How to unescape cookie value in php which was escaped in javascript? I were google the solution hardly, finally I get the solution below :


function unescape($s) {
$s= preg_replace(‘/%u(….)/’, ‘&#x$1;’, $s);
$s= preg_replace(‘/%(..)/’, ‘&#x$1;’, $s);
return $s;

reference link from here

mark it and for your reference if you can google that 🙂


How to install Ushahidi on dreamhost server

ushahidi logo small
ushahidi logo

I heard a lot of people talk about Ushahidi, in official site said that The Ushahidi Platform is an open source web application for information collection, vizualisation and interactive mapping, it allows people to collect and share their own stories using various mediums such as SMS, Web Forms, Email or Twitter. so I try to install it on my Dreamhost hosting server. it is have iOS application, it is universal application means work well with iPhone/iPod/iPad once download.

go to then download Ushahidi, unzip,  open readme.html file, check out Required Extensions, Dreamhost offer all of bellowing php extensions:


disable post id increase automatically

wordpress make me in trouble ,for example, when I write blog post online, the post id increase automatically,I try google a solutions in, I get a method finaly, but I am not sure it is work.

copy below code into funtions.php , step by step , wp-amdin –> appearance –> editor –> Theme Functions, added below code

/* 关闭自动保存和修订版本 */
remove_action(‘pre_post_update’, ‘wp_save_post_revision’ );
add_action( ‘wp_print_scripts’, ‘disable_autosave’ );
function disable_autosave() {

I am put this notes here, now post  id is 13, will it increase after save draft ? hope not. let me wait for minutes。

after 30 minutes,modify post many times,

ok, seems it is work now.


How to export your blog article from google reader?

step by step:

  1. Locate your blog rss address ,ex:
  2. Make a simple web page, add code with below format : <a href=”” >save as atom </a> , red block is your blog rss address,replace it with your rss address,  green block is your maximum article number,you can change it to 10,000 if you want;
  3. Login to with your google account;
  4. Open your web page , click   “save as atom ” with right button,then you get a atom format file ,another simple ways is, sent a mail to yourself, body is a link like this , click   “save as atom ” with right button when you receive your email.
  5. upload atom format file to your own site, get a link
  6. Going to ,Specify your atom format file location URL, convert it ,get rss format file,transform done.
  7. Finally, we get all of your blog article with rss format, we can import to most blog ,include wordpress ,or

That idea is from you xu ‘s  ,source code form here:  ,I can’t run correctly in my server, so a write a manually method doing same thing, hope it give some help to you.

Xuyou has export Aiweiwei’s sina blog from google reader :

here link is a backup of Aiweiwei’s sina blog :