星期四, 三月 11, 2010

Postfix 列出 所有 設定參數 的 預設值

Postfix 是 Linux 上, 很常使用的 Mail Server 軟體 / 套件, 主要的設定檔是 /etc/postfix/main.cf (於 Ubuntu / Debian Linux).

 (閱讀全文)

星期三, 三月 10, 2010

Linux 指定使用各種不同版本軟體 - update-alternatives

在 Ubuntu / Debian Linux 常常會有各種不同版本的軟體, 但是是做同樣的事(或類似的事).

最常見的 vi、java、gcc 等等, 這些都有各種不同的版本, 另外 scim / gcin 等輸入法, 是需要指定權重.

 (閱讀全文)

星期二, 三月 09, 2010

MPlayer 影片播放時, 常會停住不動問題修復

於 Ubuntu Linux 中, 使用 MPlayer 來看影片, 但是自從升級到 9.10 後, 影片播放時就常常會卡住不動, 然後快轉後再往回轉之類的讓他繼續播放.

 (閱讀全文)

星期二, 三月 02, 2010

Debian linux - sysv-rc dependency-based boot system 修復

Debian linux 做 apt-get dist-upgrade, 升級到 sysv-rc 時, 出現下述訊息:

  • sysv-rc
    Unable to migrate to dependency-based boot system
    Tests have determined that problems in the boot system exist which prevent migration to dependency-based
    boot sequencing:
    package exim4-base removed but not purged, package mysql-server-5.0 removed but not purged

    If the reported problem is a local modification, it needs to be fixed manually. If it's a bug in the package, it should be reported to the BTS and fixed in the package.
    See http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot for more information about how to fix the problems preventing migration.
    To reattempt the migration process after the problems have been fixed, run "dpkg-reconfigure sysv-rc".

問題出在 沒有把 exim4-base、mysql-server-5.0 移除乾淨. (移除乾淨要用 apt-get remove --purge exim4-base mysql-server-5.0)

 (閱讀全文)

星期一, 三月 01, 2010

PHP 5.3.x 的 strtotime() 時區設定 警告訊息修正

Debian Linux 使用 testing 的話, 若於上星期有做過 dist-upgrade 的話, 就會發現 PHP 已經被升級到 5.3.1-5, 而且出現一堆警告訊息.

我遇到的有下面這三種錯誤訊息:

  1. PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /tmp/a.php
  2. PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/imagick.so' /usr/lib/php5/20090626/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
  3. PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imagick.ini on line 1 in Unknown on line 0
 (閱讀全文)

星期四, 二月 18, 2010

使用 netstat 找出不正常的連線

我最常用的是 netstat -tln, 發現這篇文章把查看不尋常連線的方式都寫出來了. (適用於 Ubuntu、Debian Linux、FreeBSD.等)

註: 此文抓出來的 IP, 可再搭配 nslookup、traceroute 等反查追蹤看看.

 (閱讀全文)

星期四, 元月 28, 2010

Linux 透過 SSH SOCKS 連線 來 使用 Firefox / Pidgin(MSN, GTalk..)

現在不少醫院都有無線網路, 但是使用後, 體驗被限制只有開 80, 443 Port 的感覺.

但是我在這邊最少要待三天, 陪產(n天) + 生產完(3~7天), 至少要讓 SSH、MSN 能通才行.

  • 註1: 於 Ubuntu Linux, Windows 可以利用 Putty 來達成.
  • 註2: 此篇重點 sudo ssh -D 80 user@example.com -p 443
  • 註3: 在醫院連國外網站(ex: YouTube 被擋掉的話),透過自己的 Server 當 Proxy 會快很多. XD
 (閱讀全文)

星期三, 元月 27, 2010

Crontab 不會自動執行 修復、處理步驟

發現 Crontab 已經好幾天都不會執行, 有點詭異.

直接 crontab -e 再去 新增 / 修改 也都不會動, 手動執行都是正常.

註: crontab 寫法都是正確的.

 (閱讀全文)

星期一, 元月 25, 2010

為 Debian Linux Kernel 2.6.32 補上 e100 Firmware library

Debian Linux 做 apt-get dist-upgrade 時, kernel 居然直接升到 Debian GNU/Linux, with Linux 2.6.32-trunk-amd64, 再來似乎有不少的慘劇要處理.

出現 Possible missing firmware /lib/firmware/ 等訊息, 詳細如下:

update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-amd64
W: Possible missing firmware /lib/firmware/e100/d102e_ucode.bin for module e100
W: Possible missing firmware /lib/firmware/e100/d101s_ucode.bin for module e100
W: Possible missing firmware /lib/firmware/e100/d101m_ucode.bin for module e100
W: Possible missing firmware /lib/firmware/rtl8168d-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl8168d-1.fw for module r8169

於 linux-image-2.6.32-trunk-amd64 缺少下述: (為何移出 Kernel? 可見最下面的相關網頁)

e100: e100/d102e_ucode.bin, e100/d101s_ucode.bin, e100/d101m_ucode.bin
r8169: rtl8168d-2.fw, rtl8168d-1.fw
 (閱讀全文)

星期五, 元月 22, 2010

mlterm 使用 ssh 連外部機器, 無法使用 screen 的問題修復

使用 mlterm ssh 連到其它機器, 使用 screen 出現下述訊息:

Cannot find terminfo entry for 'mlterm'.

於是就 無法使用 screen.

 (閱讀全文)

星期三, 元月 20, 2010

ADSL PPPoE 出現 unrecognize option '/dev/modem' 修復(Linux)

於 Ubuntu Linux 9.10 剛重灌完, 要設定斷線自動重新撥接的 Script.(Debian Linux: ADSL PPPoE 自動重撥 Script)

但是 repppoe 的 pon 出現下述訊息: (使用 ponpon -q 都出現下述訊息, 而無法撥接.)

/etc/ppp/peers/provider: unrecognize option '/dev/modem'
 (閱讀全文)

星期二, 元月 19, 2010

Linux 網路介面 一直啟動、關閉 的 問題排除

在重灌 Ubuntu Linux 後, 網路異常的慢, dmesg 看到一連串的 eth1 up / down 的訊息, 訊息如下:

[442.008556] eth1: link down
[446.051536] eth1: link up, 10Mbps, half-duplex, lpa 0x0000
[462.499119] eth1: link down
[463.352299] eth1: link up, 10Mbps, half-duplex, lpa 0x0000
..... 一直跑不停.
 (閱讀全文)

星期二, 元月 12, 2010

rtorrent 遇到 found bad chunks, consider using "safe_sync" 修復

於 rtorrent 下載 100%, 但是一直沒有出現完成訊息, 於檔案列表出現下述錯誤:

Hash check on download completion found bad chunks, consider using "safe_sync"
 (閱讀全文)

星期五, 元月 08, 2010

Linux ssh 選端登入訊息 查看、修改

Ubuntu Linux (Server版)在 ssh 登入後, 會秀出下述訊息: (cat /etc/motd # 亦可看到)

Linux desktop 2.6.28-14-server #47-Ubuntu SMP Sat Jul 25 02:03:55 UTC 2009 x86_64

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/

  System information as of 二  1月  5 23:00:48 CST 2010

  System load: 0.02               Memory usage: 30%   Processes:       152
  Usage of /:  9.4% of 732.45GB   Swap usage:   26%   Users logged in: 0

  => There is 1 zombie process.

  Graph this data and manage this system at https://landscape.canonical.com/

*** System restart required ***
No mail.
Last login: Tue Jan  5 11:49:45 2010 from user-desktop.local

但是在 Debian Linux 或 一般Ubuntu Desktop 都沒看到這些訊息, 於是來找找是怎麼產生的.

註: /etc/motd 是已經產生好的文字內容, 由此看不出任何東西.

 (閱讀全文)

星期四, 元月 07, 2010

Linux 列出系統 Zombie 狀態的程式資源 與 計算 CPU 總使用量

Zombie 就是已經呈現 殭屍狀態(Z) 的 Process, 平常的系統裡面不應該看到這種狀態才對.

註: 我的 Desktop 似乎蠻常看到. XD

 (閱讀全文)