因為家中的Synology DS413 NAS,其中有一顆日立1TB的硬碟出現壞軌,便添購Toshiba 3TB的硬碟來更換。
不過這Toshiba 3TB的硬碟居然是2014年2月出廠的,在倉庫放了一年嘛?
因為當初建置時是用SHR(Synology Hybrid Raid),將NAS關機之後,直接抽換掉有問題的硬碟然後開機進行修復。歷經rebuild->reshape->resize的過程,大約花了一天的時間,其中歷時最久的是進行reshape。
下次要換硬碟應該會整台重做,用兩顆一組做SHR,不然修復的時間有夠久的... Orz
2015年3月2日 星期一
2015年2月4日 星期三
Chrome對於Linux的支援依然很爛
大概Chrome的工程師都是用Mac的,他們對Linux的使用者一點也不在乎。
在Linux上頭安裝思源黑體,並在fontconfig裡頭設定。
Chrome不知道為什麼選了 Source Han Sans Light,內文沒辦法閱讀。相對來說Firefox則十分正常。
這個問題從2013年就有人回報,到現在依然沒有任何改進。
Chrome ignores fontconfig pixelsize settings
在Linux上頭安裝思源黑體,並在fontconfig裡頭設定。
![]() |
| Chrome 40.0.2214.95 |
![]() |
| Firefox 35.0.1 |
這個問題從2013年就有人回報,到現在依然沒有任何改進。
Chrome ignores fontconfig pixelsize settings
2015年1月22日 星期四
之前我的朋友因為支付寶退款的問題,需要打電話到中國,而Hangout之前有推出撥打電話的服務,就試著撥過去看看,沒想到通話似乎完全沒有延遲,費用還非常低廉。
以台灣為例,手機撥市話以每分鐘計算,Hangout是0.6元,中華4G是6元,雖然中華是以秒計費,但是只要講超過6秒,就比Hangout貴了。 XD
https://www.google.com/voice/b/0/rates?hl=en&p=hangout
http://www.emome.net/data_plan/4g_rate
以台灣為例,手機撥市話以每分鐘計算,Hangout是0.6元,中華4G是6元,雖然中華是以秒計費,但是只要講超過6秒,就比Hangout貴了。 XD
| Google Hangout calling rates |
| 中華4G費率 |
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的,所以無法執行,照這篇文章修改就行。
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';
2014年12月18日 星期四
CentOS 7, systemd, redis, max open files
在CentOS 7安裝好Redis,預設redis會開啟10000的檔案,所以啟動之後log總會顯示以下錯誤:
網路上有提示解法,就是修改redis的systemd配置檔案/lib/systemd/system/redis.service正確來說是/etc/systemd/system/redis.service.d/limit.conf,把LimitNOFILE=10240後面的數字改成所需的。
修改之後,要先重新載入systemd,否則會出現警告。如下
Current maximum open files is 1024. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.即使修改/etc/security/limits.conf也沒有用,這個檔案一開頭就說:
This file sets the resource limits for the users logged in via PAM.因為CentOS 7用systemd換掉ntsysv,
It does not affect resource limits of the system services.
修改之後,要先重新載入systemd,否則會出現警告。如下
$ service redis restart
Redirecting to /bin/systemctl restart redis.service
Warning: Unit file of redis.service changed on disk, 'systemctl daemon-reload' recommended.
訂閱:
文章 (Atom)
-
之前因為 製作Macross Frontier第一話的字幕 ,開始接觸到這塊領域。剛開始我使用Subtitle Workshop製 作字幕,這個軟體的介面還蠻人性化的,但是不支援Unicode是個大問題,時間軸的調整也很難做的精準,此外它對SubStation Alpha (....
-
在Firefox 3正式發布前夕,Mozilla基金會成員之一的 Deb Richardson ,撰寫了一篇圖文並茂的 說明 ,讓你徹底了解Firefox 3的新功能。這些新功能與改進有些非常巨大,有些細微到你完全不會注意到,但是卻讓Firefox 3變得更簡單易用。就整體而言,...
-
試了很久才發現成功的方程式…這是因為每次安裝ROCm都需要下載安裝超過30GB的檔案!!! tl;dr 直接說結論 OS: Ubuntu 22.04(因為ROCm 6.1只支援此以下的版本) ROCm: <= 6.1.2,6.2跟6.3都沒辦法正常運行 PyTorch...

