2015年4月20日 星期一

話說之前從Kickstarter贊助了一台3D印表機

Boots Industries的第二世代3D印表機,從拿到這台印表機,就註定是個災難的開始。

順帶一提把噴頭換成E3D v6,因為長度比原本的噴頭長,本來打算用別人設計的固定件,但是需要CNC切割,最後還是用原本的固定件把E3D v6鎖住,而校正器則用了偷懶的方式,使用長螺絲來調整。

因為這台的設計不太好,再加上生產的品質很糟,有不少人在論壇打算賣出自己的BI V2.5。

2015年3月2日 星期一

更換NAS的硬碟

因為家中的Synology DS413 NAS,其中有一顆日立1TB的硬碟出現壞軌,便添購Toshiba 3TB的硬碟來更換。

不過這Toshiba 3TB的硬碟居然是2014年2月出廠的,在倉庫放了一年嘛?

因為當初建置時是用SHR(Synology Hybrid Raid),將NAS關機之後,直接抽換掉有問題的硬碟然後開機進行修復。歷經rebuild->reshape->resize的過程,大約花了一天的時間,其中歷時最久的是進行reshape。

下次要換硬碟應該會整台重做,用兩顆一組做SHR,不然修復的時間有夠久的... Orz

2015年2月4日 星期三

Chrome對於Linux的支援依然很爛

大概Chrome的工程師都是用Mac的,他們對Linux的使用者一點也不在乎。

在Linux上頭安裝思源黑體,並在fontconfig裡頭設定。

Chrome 40.0.2214.95
Firefox 35.0.1
Chrome不知道為什麼選了 Source Han Sans Light,內文沒辦法閱讀。相對來說Firefox則十分正常。

這個問題從2013年就有人回報,到現在依然沒有任何改進。
Chrome ignores fontconfig pixelsize settings

2015年1月22日 星期四

之前我的朋友因為支付寶退款的問題,需要打電話到中國,而Hangout之前有推出撥打電話的服務,就試著撥過去看看,沒想到通話似乎完全沒有延遲,費用還非常低廉。

以台灣為例,手機撥市話以每分鐘計算,Hangout是0.6元,中華4G是6元,雖然中華是以秒計費,但是只要講超過6秒,就比Hangout貴了。 XD


Google Hangout calling rates
https://www.google.com/voice/b/0/rates?hl=en&p=hangout

中華4G費率
http://www.emome.net/data_plan/4g_rate

2015年1月5日 星期一

Roundcube使用password plugin (chpasswd driver)的方式

基本上參考這一篇
http://www.roundcubeforum.net/index.php?topic=21861.0
之前實作的時候一直碰到密碼更改失敗的情況,看log也看不出所以然,只看到Unable to execute sudo。原來sudoers裡頭預設有"Defaults    requiretty"這個設定,php在執行chpasswd是沒有console的,所以無法執行,照這篇文章修改就行。
1) enable password function

vi /var/www/html/roundcube/config/config.inc.php

- alter the following line as follows:

$config['plugins'] = array('password');

cd /var/www/html/roundcube/plugins/password
cp config.inc.php.dist config.inc.php

2) enable the password plugin

cd /var/www/html/roundcube/plugins/password
cp config.inc.php.dist config.inc.php

vi config.inc.php

- alter the following as follows:

$config['password_driver'] = 'chpasswd';

3) allow apache to run the script

visudo

- add to bottom

Defaults:apache !requiretty
apache ALL=(root) NOPASSWD: /usr/sbin/chpass-wrapper.py

4) add blacklisted users and minimum UID below

vi /var/www/html/roundcube/plugins/password/helpers/chpass-wrapper.py

BLACKLIST = (
    # add blacklisted users here comma separated
    'root'
)

if user.pw_uid < 494:
    sys.exit('Changing the password for user id < 494 is forbidden')

5) copy the helper to executable directory & set make it executable
   
cp /var/www/html/roundcube/plugins/password/helpers/chpass-wrapper.py /usr/sbin
chmod 755 /usr/sbin/chpass-wrapper.py

6) alter the driver to run the helper which in turn runs the driver (wraps it)

vi /var/www/html/roundcube/plugins/password/config.inc.php

old:
$config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpasswd 2> /dev/null';
new:
$config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpass-wrapper.py 2> /dev/null';