2017年10月31日 星期二

Failed to install MySQL-python in Centos 7.0

In recently, I tried to install mysql client library  in Centos 7.0.  But I encountered Error for "Environment Error: mysql_config not found"

After googled, I found the simplest way is to install mysql-devel first

 

#!yum -y install mysql-devle

#! pip install MySQL-python

2017年10月26日 星期四

How to determine and change file character encoding

1) You can use file command to see the file character encoding

# file -bi httpd.log.20171026.0001
text/plain; charset=utf-8
# file -bi  httpd.log.20171025.0001
text/plain; charset=us-ascii

 

2) how to write  unicode support to file in python 2.7

use codecs.open to replace open directly .

[Ascii code] 

fp = open(name, 'a')

 

[unicode] 

import codecs

fp= codecs.open(name,'a',encoding='utf-8')

2017年10月23日 星期一

漏天拍賣,全家取件物流查詢記錄

昨天在網路上買了一件東西,很快就收到店家給的寄件編號,然後就很直覺的上全家網站查詢(w1)

結果沒有,上網查了一下,有人說有可能是透過ezship而非店到店,就繼續上ezship網站查詢

還是沒有,最後死馬當活馬醫,搜尋漏天 + 全家,才查到便利達康網站可以查詢,一查果然就有資料。

對於漏天這樣的資訊給了一個編號,卻沒告訴買家要到哪裡去查詢,這服務實在還是需要加強

 

w1:全家:http://www.famiport.com.tw/distribution_search.asp?page=4

w2:ezship:https://www.ezship.com.tw/receiver_query/ezship_query_shipstatus_2017.jsp

w3:cvs:https://b2b.cvs.com.tw/RutenOrderSearch/

2017年10月3日 星期二

[Mac] How to change the DHCP server ip range when using parallels host only model

1.shutdown all parallels process

2.edit parallel prefence

 #sudo subl /Library/Preferences/Parallels/network.desktop.xml

3.modify host only ip address to specific you wanted

4.sudo launchctl stop com.parallels.desktop.launchdaemon

5.sudo launchctl stop com.parallels.desktop.launchdaemon

How to restore a deleted onenote page

復原不小心誤刪的onenote