2015年1月19日 星期一

Send HTML POST data by Perl LWP

Reference:
How do I send POST data with LWP?

use LWP::UserAgent;
$ua = LWP::UserAgent->new();
$url = "http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/MI_INDEX.php";

$today7 = "1040115";
$response = $ua->post( $url, { 'download' => 'csv',  'qdate' => $today7, 'selectType' => 'ALLBUT0999'} );
$content  = $response->decoded_content();
my $file = 'stocks_twse.csv';
open $FH_o, ">", $file;
print $FH_o $content;
close $FH_o;

2015年1月11日 星期日

Windows 7 network adaptor enable/disable by command on shutdown/poweron

緣由:
有一台十年前的舊筆電重裝為Windows 7,但無線網路driver只出到Windows XP。
在Windows 7是可以用這個舊driver,但是關機時會出現藍底白字。
如果在關機前將無線網路卡停用就不會當機。

停用網路卡的指令
netsh interface set interface name="無線網路連線" admin=disable

啟用網路卡的指令
netsh interface set interface name="無線網路連線" admin=enable

設定關機時先執行指令
執行 gpedit.msc,在 電腦設定 / Windows設定 / 指令碼-(啟動/關機),
將上面兩個指令輸入進去。

註:
在 Windows 7 測試 netsh 指令時,請 "以系統管理員身分執行" 命令提示字元,否則會因為權限不足而出現錯誤訊息 "尚無具有這個名稱的介面向路由器登錄"。

參考:
區域連線斷線及連線指令碼
如何在關機時,指定執行某批次檔

2015年1月8日 星期四

windows 8 fruit ninja signing into xbox live problem

Hang on "Signing into xbox live".

Cause:
Windows region and xbox account region is different.

Change Windows region as xbox acount and it's OK.

2015年1月7日 星期三

不要吃胃乳液

今天聽陳總講到 "不要吃胃乳液/片",裡面成份有鋁,會得老年癡呆。
搜尋到這一篇也這樣說。


陳總說:
西醫治胃酸過多就吃鹼性胃乳,這是頭痛醫頭,不是治本的方法。
胃酸過多的原因是發炎,治療的方法要用老祖宗的生活經驗,早上喝一湯匙茶油或苦茶油,
橄欖油也可以。平常可以吃茶油拌麵線。

2015年1月6日 星期二

outlook 2007 简繁体转换

Reference:
outlook 2007 簡繁體轉換

首先新建一封空白郵件,然後單擊左上角的“Office按鈕”-“編輯器選項”-“自定義”,在“從下列位置選擇命令”選擇“所有命令”,找到並添加“簡轉繁”,“繁轉簡”和“簡繁轉換”。


2015年1月5日 星期一

CentOS / RHEL: Install iftop To Display Bandwidth Usage Per interface By Host

Reference:
CentOS / RHEL: Install iftop To Display Bandwidth Usage Per interface By Host

找出 Linux 的網路頻寬被誰用掉。

yum -y install iftop

iftop -i eth0
(如果只有一張網路卡可以不下參數)

CentOS 4.x 可以用 Red Hat el4 的 RPM。
http://www.rpmfind.net/linux/rpm2html/search.php?query=iftop