參考資料:
安裝 phpMyAdmin(MySQL 的網頁版圖形操作介面)
天兒啊 發表在 痞客邦 留言(0) 人氣(11,556)
參考資料:巳解決 iPad2 上 Whatsapp 與 itune "授權同步"問題!! 天兒啊 發表在 痞客邦 留言(0) 人氣(3,164)

參考資料:http://www.ibm.com/developerworks/cn/linux/l-cn-screen/
開始使用Screen
簡單來說,Screen是一個可以在多個進程之間多路復用一個物理終端的窗口管理器。Screen中有會話的概念,用戶可以在一個screen會話中創建多個screen窗口,在每一個screen窗口中就像操作一個真實的telnet/SSH連接窗口那樣。在screen中創建一個新的窗口有這樣幾種方式:
天兒啊 發表在 痞客邦 留言(0) 人氣(581)
PostFix之postqueue指令
看被Queue的信:
postqueue -q (我都是用這個)
or
mailq
強迫將Queue信寄出:
postqueue -f
刪除所有被Queue的信:
postsuper -d ALL
刪除某封Queue的信:
先用postqueue -q or mailq
查queue_id
postsuper -d queue_id
刪除所有正在
deferred 佇列中的郵件 ( 刪除曾經發送失敗的信 ):
postsuper -d ALL deferred
刪除所有正在
deferred 佇列中的郵件 ( 可看出哪些信被刪除了 ):
find /var/spool/postfix/deferred -type f -exec rm -vf {} ;
刪掉「三天以前」無法發出的郵件:
find /var/spool/postfix/deferred -type f -mtime +3 -exec rm -f {} ;
列出目前所有無法發出的郵件:
find /var/spool/postfix/deferred -type f -exec ls -l
--time-style=+%Y-%m-%d_%H:%M:%S {} ;
刪除超過 5 天的 "defer" 佇列中的退信紀錄:
find /var/spool/postfix/defer -type f -mtime +5 -exec rm -f {} ;
附帶一提:
如何讓PostFix支援MailDir格式:
在main.cf中設置:
home_mailbox =
Maildir/
任何相對路徑末尾加上「/」號都表示打開了maildir支持,home_mailbox設置的值將會追加到使用者的home目錄,也就是如果你指定home_mailbox = mymail/,那麼postfix也認為打開了maildir支持,並把信件投遞到使用者home目錄下的mymail目錄中。
天兒啊 發表在 痞客邦 留言(0) 人氣(1,942)
參考資料:http://www.xxlinux.com/linux/article/accidence/technique/20080124/13683.html
1. 最簡單的一個例子:
mail -s test yangfang@fudan.edu.cn
這條命令的結果是發一封標題為test的空信給後面的郵箱,如果你有mta並且後面的郵箱不會擋這種可能莫名奇妙的信的時候,就能收到這封信了。如果你不想被這種亂七八糟的事情幹擾,後面的郵箱請使用本地帳戶。
2. 第二個例子:
三種常用格式發信
mail -s test yangfang@fudan.edu.cn #第一種方法,你可以把當前shell當成編輯器來用,編輯完內容後Ctrl-D結束
echo 「mail content」|mail -s test yangfang@fudan.edu.cn #第二種方法,我用的最多,可能是喜歡管道的緣故吧
mail -s test yangfang@fudan.edu.cn < file #第三種方法,以file的內容為郵件內容發信
其實你很容易發現mail從標準輸入讀取文件內容並發信,我也只想讓你知道這一點,到此,第二個例子結束。
3. 第三個例子,帶附件的郵件
如果你的系統裡沒有uuencode命令的話,請先安裝sharutils(yum install sharutils)
uuencode 需要兩個參數,第一個是你要發送的文件(們),當然這個也可以用管道來做,第二個是顯示的文件名
uuencode /home/yfang/a.gif a.gif|mail -s pictest yangfang@fudan.edu.cn
tar czf - /home/yfang/ | uuencode home.tgz |mail -s pictest yangfang@fudan.edu.cn
ps: 順便補一句,slackware下的mail好像有一個-a參數,可以直接添加附件,我沒有用過。
天兒啊 發表在 痞客邦 留言(0) 人氣(13,111)
參考資料:鳥哥的 Linux 私房菜
#!/bin/bash
#
# ========================================================
# 程式說明:
# 歡迎使用 iptables.rule 這個 script 來建立您的防火牆!
# 這支 script 還需要您的額外設定方可適合您的主機環境!
# 基本規則定義為『拒絕所有,開放特定』的模式!
#
# 強烈建議:
# 不了解 Linux 防火牆機制 iptables 的朋友使用這支 script
# 可能會不太瞭解每個指令列的意義,果真如此的話,
# 歡迎參考底下幾個網頁:
# http://www.study-area.org/linux/servers/linux_nat.htm
# http://linux.vbird.org/linux_server/0240network-secure-1.php
# http://linux.vbird.org/linux_server/0250simple_firewall.php
#
# 使用說明:
# 確定這個程式僅有 Linux 的斷行字元:
# dos2unix iptables.rule
# 請先將這個 scripts 的權限更改為可執行:
# chmod 755 iptables.rule
# 在將這個程式放置在 /usr/local/virus/iptables 目錄下:
# mkdir -p /usr/local/virus/iptables
# mv /完整的路徑/iptables.rule /usr/local/virus/iptables
# 執行測試:
# /usr/local/virus/iptables/iptables.rule
# iptables -L -n (這個動作在檢查防火牆規則)
# 將底下這一行加入 /etc/rc.d/rc.local 當中
# /usr/local/virus/iptables/iptables.rule
# 取消防火牆:
# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
#
iptables -t filter -F
iptables -t filter -P INPUT DROP
modprobe ip_conntrack_ftp
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #local can ping outside
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #local can ping outside
iptables -t filter -A INPUT -p all -i lo -j ACCEPT
# iptables -A INPUT -i ppp0 -p TCP -d 59.124.70.141 --dport 22 -j ACCEPT #SSH
iptables -A INPUT -i eth1 -s 192.168.11.0/24 -j ACCEPT #內部IP全開通
iptables -A INPUT -i ppp0 -p TCP -s x.x.x.x(來源IP) -d x.x.x.x(目的IP) --dport 3306 -j ACCEPT #MW.4 MYSQL
iptables -A INPUT -i ppp0 -p TCP -s x.x.x.x(來源IP) -d x.x.x.x(目的IP) --dport 3306 -j ACCEPT #IDC MYSQL
iptables -A INPUT -i ppp0 -p TCP -s x.x.x.x(來源IP) -d x.x.x.x(目的IP) --dport 10000 -j ACCEPT #WEBMIN
iptables -A INPUT -i ppp0 -p TCP -s x.x.x.x(來源IP) -d x.x.x.x(目的IP) --dport 10000 -j ACCEPT #MW.4 WEBMIN
iptables -A INPUT -i ppp0 -p TCP -s x.x.x.x(來源IP) -d x.x.x.x(目的IP) --dport 10000 -j ACCEPT #IDC WEBMIN
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 20 -j ACCEPT #FTP
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 21 -j ACCEPT #FTP
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 25 -j ACCEPT #SMTP
iptables -A INPUT -i ppp0 -p UDP -d x.x.x.x(目的IP) --dport 53 -j ACCEPT #DNS
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 53 -j ACCEPT #DNS
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 80 -j ACCEPT #HTTP
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 110 -j ACCEPT #POP3
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 137 -j ACCEPT #SMB
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 138 -j ACCEPT #SMB
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 139 -j ACCEPT #SMB
iptables -A INPUT -i ppp0 -p TCP -d x.x.x.x(目的IP) --dport 3128 -j ACCEPT #SQUID
iptables -A INPUT -i ppp0 -p UDP -d x.x.x.x(目的IP) --dport 3128 -j ACCEPT #SQUID
# iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT # Can ping rule
# iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT # Can ping rule
iptables -A INPUT -p icmp --icmp-type echo-request -s x.x.x.x(來源IP) -j ACCEPT # Can ping rule
iptables -A OUTPUT -p icmp --icmp-type echo-reply -d x.x.x.x(目的IP) -j ACCEPT # Can ping rule
iptables -A INPUT -p icmp --icmp-type echo-request -s x.x.x.x(來源IP) -j ACCEPT # Can ping rule MW.4
iptables -A OUTPUT -p icmp --icmp-type echo-reply -d x.x.x.x(目的IP) -j ACCEPT # Can ping rule MW.4
iptables -A INPUT -p icmp --icmp-type echo-request -s x.x.x.x(來源IP) -j ACCEPT # Can ping rule IDC
iptables -A OUTPUT -p icmp --icmp-type echo-reply -d x.x.x.x(目的IP) -j ACCEPT # Can ping rule IDC
天兒啊 發表在 痞客邦 留言(0) 人氣(1,518)
參考資料:Google搜尋到的已忘了真正出處了,如有大大知道請告知,小弟再補上,如有侵權,也請告知,小弟將移除
安裝proftp MySQL 模組
天兒啊 發表在 痞客邦 留言(0) 人氣(543)
天兒啊 發表在 痞客邦 留言(0) 人氣(221)
參考資料:Google搜尋到的已忘了真正出處了,如有大大知道請告知,小弟再補上,如有侵權,也請告知,小弟將移除
要使用 YUM 必須做一些設定。預設在 /etc/yum.conf 裡面就可以做設定,不過 yum.conf 也有提到,若沒有在裡面做任何配置,它就會自動去尋找 /etc/yum.repos.d/ 裡面的 CentOS-Base.repo 這個檔案。因此我們要針對此檔案做一些調校。
天兒啊 發表在 痞客邦 留言(0) 人氣(132)
參考資料:Google搜尋到的已忘了真正出處了,如有大大知道請告知,小弟再補上,如有侵權,也請告知,小弟將移除
1. Creating authentication key
用ssh-keygen生成公/私鑰對:
天兒啊 發表在 痞客邦 留言(0) 人氣(1,739)