Skip to main content.
六月 20th, 2009

解決PHP的MAIL() 主旨亂碼

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 »

六月 18th, 2009

Linux 查詢顯示卡資訊

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 »

五月 11th, 2009

隱藏指令不出現在 Linux history 中

新增一些帳密資料,或都測試寫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 »

四月 30th, 2009

Apache 啟動時出現的錯誤:Too many open files

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 »

四月 12th, 2009

MySQL 秀目前執行的 SQL 語法

簡易型:

mysql > show processlist;

秀出完整指令型:

mysql > show full  processlist;

Posted by lawrence as Linux Server 系列, MySQL at 11:16 下午 CST

No Comments »

四月 10th, 2009

mysql 資料表中有保留字匯出方法

因為資料中有mysql 保留字,所以在匯入時會出現錯誤訊息。

可以利用phpmyadmin 的匯出功能,特別勾選「在資料表及欄位使用引號」,即可正常匯入,但儘量避免使用保留字

mysql 資料表中有保留字匯出方法如下:

2009-04-10_161235

Posted by lawrence as Linux Server 系列, MySQL at 4:15 下午 CST

No Comments »

三月 21st, 2009

Apache 使用捷徑目錄

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 »

三月 8th, 2009

比top更好用的htop

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 10:42 上午 CST

No Comments »

二月 21st, 2009

su 及 sudo 應用

Read the rest of this entry »

Posted by ago as other at 9:14 下午 CST

No Comments »

二月 3rd, 2009

MTR 網路診斷工具 for CentOS 5.2

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, Network at 1:55 上午 CST

No Comments »

二月 1st, 2009

安裝 MyDNS for CentOS5.2

Read the rest of this entry »

Posted by lawrence as DNS, Linux Server 系列 at 3:29 下午 CST

No Comments »

一月 31st, 2009

防止 DNS Cache Poisoning

Read the rest of this entry »

Posted by lawrence as DNS at 10:06 下午 CST

No Comments »

一月 4th, 2009

PPTP VPN Server

Read the rest of this entry »

Posted by lawrence as Linux Server 系列 at 12:08 上午 CST

No Comments »

十二月 18th, 2008

Example : cdomail-send.asp

Read the rest of this entry »

Posted by lawrence as Windows Server 系列, asp , asp.net at 10:24 上午 CST

No Comments »

Example : Jmail-Sendmail.asp

Read the rest of this entry »

Posted by lawrence as Windows Server 系列, asp , asp.net at 10:22 上午 CST

No Comments »

Example : .NET 2.0 sendmail.aspx

Read the rest of this entry »

Posted by lawrence as Windows Server 系列, asp , asp.net at 10:19 上午 CST

No Comments »

十二月 14th, 2008

fail2ban install

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, Network at 6:18 下午 CST

No Comments »

十二月 1st, 2008

pathping 路由追蹤狀態

Read the rest of this entry »

Posted by lawrence as Windows Server 系列 at 12:04 下午 CST

1 Comment »

十一月 15th, 2008

syslog-ng + logrotate 應用範例

Read the rest of this entry »

Posted by ago as Linux Server 系列, other at 11:56 下午 CST

No Comments »

十一月 1st, 2008

System: xferlog – ProFTPD server logfile

Read the rest of this entry »

Posted by lawrence as FTP, Linux Server 系列 at 4:41 下午 CST

No Comments »

十月 29th, 2008

排列指令 sort

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 11:31 上午 CST

No Comments »

十月 8th, 2008

安裝 GNOME Desktop

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 5:16 下午 CST

No Comments »

使用 yum 下載 rpm 檔案

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 2:03 下午 CST

No Comments »

十月 4th, 2008

windows 內建的惡意軟體移除工具

Read the rest of this entry »

Posted by lawrence as Windows Server 系列 at 7:08 下午 CST

No Comments »

九月 13th, 2008

如何開啟 Windows XP 中的自動登入

Read the rest of this entry »

Posted by lawrence as Windows Server 系列 at 6:49 下午 CST

No Comments »

九月 7th, 2008

mssql – osql 公用程式指令

Read the rest of this entry »

Posted by lawrence as Windows Server 系列 at 9:48 下午 CST

No Comments »

九月 4th, 2008

sql injection 先修正Datebase 資料的方法

Read the rest of this entry »

Posted by lawrence as Windows Server 系列 at 7:20 下午 CST

No Comments »

九月 2nd, 2008

MySQL + phpmyadmin 中文亂碼

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, MySQL, Network at 11:39 上午 CST

No Comments »

八月 29th, 2008

mysql 解決Client does not support authentication protocol requested by server

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, MySQL at 5:42 下午 CST

No Comments »

八月 26th, 2008

圖片格式轉換 netpbm

Read the rest of this entry »

Posted by ago as other at 2:29 下午 CST

No Comments »

八月 12th, 2008

常用指令

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 4:57 下午 CST

No Comments »

八月 4th, 2008

MySQL 限制 IP 連線設定

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, MySQL at 4:37 下午 CST

No Comments »

Avira for MSN

Read the rest of this entry »

Posted by lawrence as 資訊安全 at 1:04 上午 CST

No Comments »

六月 20th, 2008

MRTG CPU for Fedora Core 9

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, Network at 3:27 下午 CST

No Comments »

Install MRTG for Fedora Core 9

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, Network at 12:46 下午 CST

No Comments »

六月 19th, 2008

Fedora Kickstart Install

Read the rest of this entry »

Posted by ago as Linux Server 系列, other at 7:24 下午 CST

No Comments »

六月 14th, 2008

sed指令 – 從某個字串後開始取值

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 4:31 下午 CST

No Comments »

找PID值的利器 – pidof

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 3:41 下午 CST

No Comments »

六月 13th, 2008

Cisco Sw 更新ios

Read the rest of this entry »

Posted by lawrence as Cisco 網路設備 at 1:58 下午 CST

No Comments »

五月 27th, 2008

install nagios for CentOS 5.x

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, Network at 4:25 下午 CST

No Comments »

五月 24th, 2008

Install SmokePing for CentOS 5.X

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, Network at 4:12 下午 CST

No Comments »

五月 9th, 2008

mysql 顯示連線數、更改連線數

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, MySQL, Windows Server 系列 at 2:23 下午 CST

No Comments »

查看 mysql 編碼資訊

Read the rest of this entry »

Posted by lawrence as MySQL at 2:16 下午 CST

No Comments »

五月 6th, 2008

linux, mount usb storage

Read the rest of this entry »

Posted by lawrence as Linux Server 系列, other at 1:00 下午 CST

No Comments »

五月 4th, 2008

Cisco RFC1918 規範

Read the rest of this entry »

Posted by Lin as L3 Switch at 10:05 下午 CST

No Comments »

Cisco 6505 delete vlan.dat 路徑

Read the rest of this entry »

Posted by Lin as Cisco 網路設備, L3 Switch at 9:44 下午 CST

No Comments »

五月 2nd, 2008

webmail horde imp Allowed memory size of xx bytes exhausted

Read the rest of this entry »

Posted by lawrence as Apache, Linux Server 系列 at 2:41 下午 CST

No Comments »

Cisco 相關手冊下載網址

Read the rest of this entry »

Posted by ago as Cisco 網路設備 at 11:56 上午 CST

No Comments »

umount: /mnt/dir : device is busy 的一種解決方式

Read the rest of this entry »

Posted by admin as Linux Server 系列 at 11:56 上午 CST

No Comments »

稀疏檔案 sparse file

Read the rest of this entry »

Posted by ago as Linux Server 系列, other at 11:56 上午 CST

No Comments »

« Previous Entries  後一頁 »