2013-07-05

TOOL - 解決 win7 無法設定 default gateway 的問題

在家使用的 win7 不想使用 dhcp, 想要自己指定區網中的 ip
但在每次重開機後, 預設閘道都會被清空, 也太怪了吧
google 後找到以下的解決方式

2013-07-04

TOOL - 使用 synergy 連線 win7 & mac air

分享 win7 的 keyboard & mouse with mac air

server : win7
synergy 1.4.12

client : mac air
synergy 1.4.10

2013-06-15

MISC - PPI (Pixels Per Inch) 怎麼計算


√(螢幕長度像素平方+螢幕寬度像素平方) / 螢幕尺寸

iPhone 5
1136 x 1136 + 640 x 640 -> 開根號 / 4 = 325 ppi

SH930W
1920 x 1920 + 1080 x 1080 -> 開根號 / 5 = 440 ppi

Lumia 920
1280 x 1280 + 768 x 768 -> 開根號 / 4.5 = 331 ppi

小米 2S
1280 x 1280 + 720 x 720 -> 開根號 / 4.3 = 341 ppi



2013-04-17

LINUX - 備份/還原 SUSE 的 crontab


把 crontab 備份到 /tmp/trully/crontab
crontab -l > /tmp/trully/crontab

由 /tmp/trully/crontab 還原 crontab
crontab /tmp/trully/crontab

2013-04-14

LINUX - lighttpd 停機設定

在 /home/lighttpd/etc/lighttpd.conf 增加
include "url.rewrite-once.conf"

vi /home/lighttpd/etc/url.rewrite-once.conf
url.rewrite-once = (
    ".*" => "/_manager/maintain.php",
)

2013-04-13

CODE - 執行 php 出現的 Host key verification failed. 255 / Host key verification failed

php code
$cmd = '/usr/bin/ssh root@x.x.x.x cat /home/logs/consumer.log 2>&1';
$last_line = system($cmd, $retval);
echo json_encode($retval).' / '.$last_line;

會顯示
Host key verification failed. 255 / Host key verification failed.
(或用 exec , retval 是 255 的情況)

解決方法 :
由執行 php code 的機器(這裡是 stage), 用 wwwrun 的身份去 ssh 該主機, 按 yes 即可
大概是因為 vm clone 好後, 雖 stage 的 public key 已加在該主機的 authorized_keys2 裡,
但實際上卻未曾連過, 只要連過 public key 便可在 authorized_keys2 裡生效