1 . 先在 header 宣告:
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
2. 再 subject 再宣告為:
$subject = "=?UTF-8?B?".base64_encode($subject)."?=";
這樣發送後主旨的地方就不會再有亂碼。
ref: http://blog.fesite.com/2009/04/02/php-mail-code/
Posted by lawrence as Linux Server 系列 at 8:13 下午 CST
No Comments »
Linux 查詢顯示卡資訊
# lspci | grep VGA
01:00.0 VGA compatible controller: VIA Technologies, Inc. KM400/KN400/P4M800 [S3 UniChrome] (rev 01) (型號)
# lspci -v -s 01:00.0
01:00.0 VGA compatible controller: VIA Technologies, Inc. KM400/KN400/P4M800 [S3 UniChrome] (rev 01) (prog-if 00 [VGA controller])
Subsystem: VIA Technologies, Inc. KM400/KN400/P4M800 [S3 UniChrome]
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 5
Memory at e8000000 (32-bit, prefetchable) [size=64M] (記憶體大小)
Memory at ec000000 (32-bit, non-prefetchable) [size=16M]
[virtual] Expansion ROM at ed000000 [disabled] [size=64K]
Capabilities: [60] Power Management version 2
Capabilities: [70] AGP version 2.0
Posted by lawrence as other at 10:16 下午 CST
No Comments »
新增一些帳密資料,或都測試寫scirpt 時,都會不小時把敏感的資料keyin 在 console ,那有心人士只要下 history 可得知你之前下的指令。
之前都會在退出console 時下 history -c 清除歷史資料,但有時候太忙就是會忘記,累積幾次後,祕密全被看看。
在 google 找到一篇文章,有記載以下方式:
# vi /etc/profile
> HISTCONTROL=ignorespace
# source /etc/profile (讓 profile 的設定,立即生效。)
example:
# mysql -uadmin -p"test1234"
# history (就會出現剛剛下過的指令)
mysql -uadmin -p"test1234"
改用 ignorespace 的用法:
#<space>mysql -uadmin -p"test1234" # <space> 代表一個空白鍵
# history
就不會出現剛剛下過的指令,之後在做敏感資料時,都可以在指令前多空一個空白,就不會記錄在 history 中。
參考文章:http://go-linux.blogspot.com/2009/04/spacehistory.html
Posted by lawrence as Linux Server 系列, other at 10:25 上午 CST
No Comments »
Wed Apr 29 15:33:33 2009] [error] (24)Too many open files: could not open mime types config file /etc/mime.types.
解決方法:
# nlimit -n
> 1024 (預設值)
# nlimit -n 8192
# nlimit -n
> 8192 (新值)
# service httpd restart
因為重開機後, nlimit -n 會變為預設值(1024), 需要更改 /etc/security/limit.conf 加入 nlimit -n 8192 。
但這樣 Apache 啟動時還是出現錯誤,於是在 /etc/rc.d/init.d/httpd 中加入 nlimit -n 8192 後,就順利啟動。
參考連結:
http://www.chinaitpower.com/2005September/2005-09-13/204427.html
Posted by lawrence as Apache at 12:19 上午 CST
No Comments »
簡易型:
mysql > show processlist;
秀出完整指令型:
mysql > show full processlist;
Posted by lawrence as Linux Server 系列, MySQL at 11:16 下午 CST
No Comments »
因為資料中有mysql 保留字,所以在匯入時會出現錯誤訊息。
可以利用phpmyadmin 的匯出功能,特別勾選「在資料表及欄位使用引號」,即可正常匯入,但儘量避免使用保留字
mysql 資料表中有保留字匯出方法如下:

Posted by lawrence as Linux Server 系列, MySQL at 4:15 下午 CST
No Comments »
0001
0002
0003
0004
0005
0006
|
# vi .htaccess
Options +FollowSymLinks
# sudo -u username ln -s source target
// 加上 sudo -u user 建立出來是symlinks 的權限是 user 而不是 root, 才不會出現 Error 403。
|
Posted by lawrence as Apache, Linux Server 系列 at 9:14 下午 CST
1 Comment »
Posted by lawrence as Cisco 網路設備 at 1:58 下午 CST
No Comments »