This Site Enabled SSL

Today I finally got some time to work on my own site.

This small blog used to on a small VPS.

I moved it to Vultr because I heard it is a powerful VPS and it’s price is fair too.

I also enabled SSL, using Free SSL certificate supplier Tencent Cloud service. It’s good, easy to config and doesn’t need to verify again in 1 years.

Got A+ 🙂

iPhone 6S 自动关机问题可能比苹果想象的要严重

在中消协发出查询函以后,苹果对iPhone 6S 近期大量出现的自动关机问题给出的回复是, 电池相关的某个部件在组装前由于长时间暴露在受控环境空气中的时间过长。导致装有这批电池的6S会出现在较寒冷温度下自动关机的问题。

苹果定义的是“一小批”在2015年9月和10月出产的手机会有这样的问题, 并提供了查询网页让消费者查询自己的手机是否在这“一小批”中。符合此条件的手机将可以免费更换电池,若此前已经付费更换电池的用户,则可以报销费用。

我本人的6S也不幸中招,然而并非苹果说的较寒冷的温度下。根据我的使用记录,在室温14度左右下,依然出现电量高达40%以上的时候关机,室温6度左右的时候,出现电量迅速消耗的情况,大约每一分钟掉2%左右的电量,而我仅仅是在浏览文字网页。

而根据我加的几个相关QQ群内的反应,很多并非2015年9月、10月生产的iPhone也有相应的问题,型号从5到6 PLUS都有。而在其他社交媒体上抱怨自己手机这一问题的也很多,遍布全球。因此有理由相信,这并非苹果说的一小批。

其实去年我的一部5C也出现一样的情况,好在当时在保,苹果给换机了事。可惜后来不就这部5C就丢了。

虽然之前给出了免费更换电池的解决措施,然而很多用户反应,即使在更换新电池以后,依然会出现自动关机现象,有些人在更换电池以后这一问题虽然得以缓解,但并未完全解决。不少用户猜测问题可能出在主板上。出于此原因,我一直未去更换自己电池。

苹果说本周推出的iOS10系统更新将包含可以更有效诊断这一问题的内容,期待苹果能给出一个满意的解答。

 

KickAssTorrent is down… for a stupid mistake

The world’s biggest torrent sharing website KickAssTorrent was shutdown at 22/7/2016.

This is what happens:

  • An undercover agent of FBI contacted the owner of kickass for advertisement, got his email ID
  • The Owner then purchased something with same email ID in Apple’s store
  • Got exposed. The police arrested him in Poland
  • KickAssTorrent website was shutdown

He hided so many years for running this website, how comes he use the same email to purchase in Apple store and contact with others?

So stupid.

Firefox: How to install and use addon that is not from AMO

In former version, users can install Firefox addon easily by drag and drop the addon file (.xpi file)  into Firefox to install and use it.

But now, user can not do this by default. User can only install addon from AMO (https://addon.mozilla.org). If you download an addon from other website or like me develop addon self. when you drag and drop the file into Firefox. it will be disabled and can not be enable. It says : ADDON NAME could not be verified for use in Firefox and has been disabled.  like this(I’m using Nightly Firefox):

Unnamed QQ Screenshot20151104000045

well, it’s easy to pass this by these steps.

1: Navigate to about:config in Firefox (input about:config into Firefox’s address bar and hit Enter)

2: You might see a warning screen warning the action is not safe. Just hit the blue button  I’ll be careful, I promise .

3:You will see a long list. Input the keywords xpinstall  in the search bar.

4: Find the xpinstall.signatures.required, it’s value should be true now. click this line, change the value to false.

xpinstall

5: You are done, you will see that your addon enabled and working:)

 

Google will shut down Google Code

Well, Google said, there are more great services like Github and Bitbucket, so Google code is not needed any more,  it will shut down Google code service soon. And there is some tools to export your projects to other platform like Github, Bitbucket or SourceForge.

The shut down schedule is:

  • March 12, 2015 – New project creation disabled.
  • August 24, 2015 – The site goes read-only. You can still checkout/view project source, issues, and wikis.
  • January 25, 2016 – The project hosting service is closed. You will be able to download a tarball of project source, issues, and wikis. These tarballs will be available throughout the rest of 2016.

At the same time, Google says it will continue serve some projects like Android and Chrome so that user can continue git them. And also will continue maintaining  mirrors for projects like Eclipse kenel.

Google also gives an export tool to export your project to Github.  And also here is another tool to export any of your projects to Github/Bitbucket/SourceForge.

SourceForge also supplies an import tool to import Google code project.

 

Firefox Addon: How to use gmail.js in Firefox Addon SDK

Well, gmail.js is a very nice script that if you want to work with Gmail (developing browser extensions for Gmail).

The author says that gmail.js is designed for Chrome extension development. There is also many examples about how to use it in Chrome extension. But, how to use it in Firefox addon development?

If you inject it directly in the page, you will got an error: GLOBAL is not defined.

it is because the gmail.js uses 2 variables in the Gmail page, GLOBAL  and also VIEW_DATA. If you inject it directly by pageMode, it can not access any page script.

So you need to modify the gmail.js, in line 6 and 7 (if line number is different, just search it ). By using unsafeWindow , you can access the Gmail page variable:
change

api.tracker.globals =GLOBALS;

to
api.tracker.globals = unsafeWindow.GLOBALS;

change

api.tracker.view_data = typeof VIEW_DATA !== "undefined" ? VIEW_DATA : [];

to

api.tracker.view_data = typeof unsafeWindow.VIEW_DATA !== "undefined" ? unsafeWindow.VIEW_DATA : [];

Then you can use the gmail.js without error.

Actually in Chrome extension, you can not inject gmail.js with content script decoration in manifest.json directly, because in that way  you can not access GLOBAL too.

You need to use another content script to inject it  with add <script> block in the page, here  is the code snap

window.onload = function () {

    //inject jQuery
    var jq = document.createElement('script');
    jq.src = chrome.extension.getURL("lib/jquery-2.1.1.min.js");
    document.body.appendChild(jq)

    //inject gmail.js
    var sm = document.createElement('script');
    sm.src = chrome.extension.getURL("lib/gmail.js");
    document.body.appendChild(sm);
    //inject the script that actual do your things 
    var ct = document.createElement('script');
    ct.src = chrome.extension.getURL("content.js");
    document.body.appendChild(ct);
}

Then declare this file as content script in the manifest.json. and also declare all 3 scripts in web_accessible_resources.

BF4:got return from EA after half a month

About half a month ago, I purchased BF4 from origin.com.

When I was purchasing, there are 3 editions in the store page, standard edition, deluxe edition and premium edition. My friend told me  that the premium edition does not comes with base game. So I purchased the standard edition first and then purchased the premium edition after several days.

Today when another friend asked me to help him purchase BF4 from origin, I found another item called premium membership, I realized that the premium edition actually contains base game. So I tried to ask for return. After I chat with their advisor, told him I placed a wrong order , they gave me return very fast.

I really like EA’s customer service.