February 2012 Archives

出現此訊息 Warning: mysql_connect() [function.mysql-connect]: Headers and client library minor version mismatch.
是因為 PHP 在編譯時, MySQL 的 header 跟 library 不一致所造成,
有可能系統中曾經裝了兩個版本以上的 MySQL, 可能是套件或 tarball 安裝

解決方式: 把所有 MySQL 套件移除及 /usr 其下所有 MySQL 相關 header 及 library 刪除, 再重裝 MySQL (用套件或 tarball 均可)
rpm -qa | grep -i mysql | xargs rpm -e --nodeps # 僅適用 RPM 系 Linux
find /usr -name "mysql" -exec rm -rf {} \;
find /usr -name "my*" -exec rm {} \;

Show QR Codes in Web Pages

user-pic
Vote 0 Votes

使用 Google APIs 可以很輕易地把 QR Code 顯示在網頁上, 不用自已寫程式, 中文也沒問題

Getting Started with Infographics
https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=Hello%20world
參數:
chs - QR Code 大小, 格式 寬x高
cht - 類型, 'qr' 表示 QR code, 固定參數
chl - 要編碼的資料, 必需是 URL-encoded.

chs 最小是 30x30 左右, 因資料量而異

因為有 300000 pixels 上限, chs 最大是 547x547

除了 GET 方式之外, 也可以用 POST 的方式, 因為 URL 長度有 2K 的限制, 用 POST 則無,
可參考 POST Requests

Install DropBox for Linux

user-pic
Vote 0 Votes

DropBox for Linux 在 CLI 環境就可以安裝了, 不需要圖形環境, 寫這篇文章時的版本是 1.2.51
官網的說明是這樣 Install Dropbox via command line
The Dropbox daemon works fine on all 32-bit and 64-bit Linux servers. To install, run the following command in your Linux terminal.
32-bit:
$ cd ~ && wget -O - http://www.dropbox.com/download?plat=lnx.x86 | tar xzf -
64-bit:
$ cd ~ && wget -O - http://www.dropbox.com/download?plat=lnx.x86_64 | tar xzf -
Next, run the Dropbox daemon from the newly created .dropbox-dist folder.
$ ~/.dropbox-dist/dropboxd
然後 Console 會出現如下訊息:
This client is not linked to any account...
Please visit https://www.dropbox.com/cli_link?host_id=8430c241f1d910381d129605c2e1dd89&cl=en_US to link this machine.
上面的連結可以用不同的電腦連, 登入 DropBox 後即可完成帳號連結, 隨即會開始同步檔案

若您是用 root 帳號來跑 DropBox, 可以加到 rc.local, 以利下次開機執行
echo ~/.dropbox-dist/dropboxd >> /etc/rc.local

新增或刪除檔案, 很快就進行同步, 跟 Windows 版沒什麼兩樣.

HiNet CloudBox

user-pic
Vote 0 Votes

中華電信的個人雲 CloudBox 服務, 跟 DropBox 是類似的服務
不限 HiNet 用戶申請, 非 HiNet 用戶提供 2G 空間, 還沒有購買額外空間的功能,
HiNet 用戶提供 10G 空間, 光世代 50M or 100M 客戶, 或是手機 mpro450m、mpro950客戶, 可領用額外 5GB or 10GB 雲空間!
現階段還沒有 DropBox 的一些功能, 例如: 檔案歷史版本、LAN Sync、資料夾分享等

優點: 台灣速度很快
缺點: 分享的 HTTP Link 無法直連, 到下載頁面還需輸入驗證碼

沒有 HTTP 直連, 就少掉一些功能的應用, 利如當圖床等.
CloudBox 最大的好處在就是速度快, 若不需要 HTTP 直連, CloudBox 仍是不錯的服務.

AWS Free Usage Tier with Windows

user-pic
Vote 0 Votes

Amazon 在 2012-01-19 開始提供 AWS Free Usage Tier with Windows 服務

Dear Amazon EC2 Customer,

We are excited to announce that starting today, the AWS Free Usage Tier will now include Amazon EC2 instances running Microsoft Windows Server. Customers eligible for the AWS Free Usage tier can now use up to 750 hours per month of t1.micro instances running Microsoft Windows Server for free.

With this announcement, customers familiar with Windows Server can gain hands-on-experience with AWS at no-cost. Customers can select from a range of pre-configured Amazon Machine Images with Microsoft Windows Server 2008 R2. Once running, customers can connect via Microsoft Remote Desktop Client to begin building, migrating, testing, and deploying their web applications on AWS in minutes. The expanded Free Usage Tier with Microsoft Windows Server t1.micro instances is available today in all regions, except for AWS GovCloud.

For more information about the AWS Free Usage Tier, please visit the AWS Free Usage Tier web page.
To get started using Microsoft Windows Server on AWS, visit the AWS Windows web page.

AWS Free Usage Tier with Windows 有三種可選
Microsoft Windows Server 2008 Base
Microsoft Windows Server 2008 R2 Base
Microsoft Windows Server 2008 R2 with SQL Server Express and IIS
硬碟空間 30 GB, RAM 615MB

最棒的是 instance hours 和 Linux 是獨立計算的, 也就是 Linux、Windows 各有 750 小時, 可以同時跑
Q: Does an AWS customer have access to 750 instance hours each of the Linux and Windows Server 2008 R2Windows Server 2008 R2 t1.micro instances under the AWS Free Usage Tier?
Yes. A customer with access to the AWS Free Usage Tier can use up to 750 instance hours each of t1.micro instances running Linux and Windows Server 2008 R2Windows Server 2008 R2. Usage of the Linux and Windows Server 2008 R2 t1.micros is counted independently.

建立機器所花的時間很久, 不像 Linux 只要一分鐘就可以連上去,
要先用 Key Pair 取得登入密碼, 產生密碼就至少要等 15 分鐘了, 連線是用 RDP 遠端桌面連線
Password generation and encryption can sometimes take more than 30 minutes.
Please wait at least 15 minutes after launching an instance before trying to retrieve the generated password.

Chrome for Android Beta

user-pic
Vote 0 Votes

Chrome for Android Beta
台灣還不能透過 Market 安裝 (出現您的國家/地區不支援這個項目)
可以用以下 APK 檔安裝嘗鮮, for ICS 4.0 only

http://db.tt/sLYEFPLC
裝好後的版本是 16.0.912.75 (同時間 PC 版是 16.0.912.77)


Output to console and file

user-pic
Vote 0 Votes

有時想要在 console 看到輸出資料而且又想留下 log, 可以這樣做

command 2>&1 | tee file.log

2>&1 是指 stderr 導到 stdout
tee 可以把 stdout 複製一份到檔案

Galaxy Nexus 4.0.2

user-pic
Vote 0 Votes

2/6 台灣的 Galaxy Nexus 4.0.2 收到更新通知了
更新檔 20.3M
還以為是 4.0.3, 有點小失望

rm -f /var/lib/rpm/__db*
db_verify /var/lib/rpm/Packages
rpm --rebuilddb

tshark -V | egrep -iw "select|update|delete"

可觀察整台機器送了那些 command 出去
tshark 是 wireshark 的 CLI 版本, 在 wireshark 套件中

About this Archive

This page is an archive of entries from February 2012 listed from newest to oldest.

January 2012 is the previous archive.

March 2012 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives