Yam 信箱轉給 Google GMail

蕃薯藤 漸漸的結束了,
從蕃薯藤到天空,現在會員信箱也轉給Google

未來的日子~~還有多少家服務廠商會轉給Google
這樣算是賣帳號~還是代管~

希望台灣的廠商可以堅持下去~走自已的路....

######################################
以下連結:http://gmgw.yam.com/mail_msg/letter1.html

親愛的yam天空會員您好:

yam天空信箱全面升級囉!

舊信箱服務將於2008/12/8(一)起停止服務,需要備份相關信件及通訊錄的會員 請於公告截止日期前進入備份(舊信箱位址:http://email.yam.com )。

感謝您的支持與愛護

如有任何問題,歡迎來信yam客服中心,我們將竭誠為您服務,謝謝。

Posted in 標籤: | 0 意見

FreeBSD System Backup Methods1

System is online, use tar command backup system os

Backup:
tar -zcvpf /backup.tgz --exclude=/proc --exclude=/compat --exclude=/home --exclude=/sys --exclude=/mnt --exclude=/tmp --exclude=/lost+found --exclude=/backup.tgz /

dd if=/dev/da0 of=/bsd.mbr bs=512 count=1


Restore:
tar -zxvpf /backup.tgz /
mkdir /proc /mnt /tmp
ln -s /usr/compat /compat
ln -s /usr/home /home
ln -s /usr/src/sys /sys

dd of=/bsd.mbr if=/dev/da0 bs=446 count=1



手動分割1
http://www.netlab.cse.yzu.edu.tw/~statue/freebsd/docs/completed/95.shtml.htm

fdisk -i da1
FreeBSD分區為165
DOS分區為6

disklabel -r -w da1s3 auto

disklabel -e da1s3
a這是指 root 分割區,也就是常說的根目錄「/」
b這是指 swap (虛擬記憶體置換裝置)
c這是指整個分配到的主要分層 (Primary Slice)
d這是指整顆硬碟
e可任意使用 (比如︰/tmp)
f可任意使用 (比如︰/var)
g可任意使用 (比如︰/usr)
h可任意使用 (比如︰/home)

newfs /dev/da1s1e

fsck -y /dev/da1s1e

mount /dev/da1s1e /mnt

swapon /dev/da1s1b



手動分割2
fdisk -BI /dev/ad0
bsdlabel -wB /dev/ad0s1
寫入:
bsdlabel -e /dev/ad0s1
bsdlabel /dev/ad0s1 > bsdlabel.txt
讀取:
bsdlabel -R /dev/ad0s1 bsdlabel.txt
newfs /dev/ad0s1a


OS RAID-1(gmirror)
http://www.freebsd.org/doc/zh_TW/articles/remote-install/installation.html

Posted in 標籤: | 0 意見

美ISP切斷最大spammer 全球垃圾信馬上少四成

根據華盛頓郵報報導,美國兩大ISP業者Global Crossing及Hurricane Electric在本周二(11/11)先後切斷惡名昭彰的垃圾郵件發源地McColo的流量,使得資安業者發現,周三全球垃圾郵件數量少了4成。

McColo為主機代管服務供應商,在多年前就受到安全研究人員的關注,因為有不少在網路上散佈偽藥、兒童色情、惡意程式的業者都是McColo的客戶,資安人員估計,自McColo送出的垃圾郵件約佔全球垃圾郵件總數的75%。

其中,Global Crossing並未說明切斷McColo流量服務的原因,僅說該公司的政策禁止惡意行為,而Hurricane Electric則坦率地說,在讀取對McColo指控的文件後決定斷絕所有連到該站的流量。

而根據IronPort Systems及MessageLabs等業者的垃圾郵件偵測機制,發現全球垃圾郵件數量在周三大幅下滑了41%。

Computerworld引述IronPort產品經理Nilesh Bhandari表示,今年10月平均每天有1900億的垃圾郵件,不過周三卻僅有1120億;McColo代管了全球最大的垃圾郵件僵屍網路伺服器,以從事垃圾郵件與惡意程式散布等犯罪行動。

目前McColo網站仍是無法連上的,不過Bhandari認為,相關服務遲早會重新登場,諸如換一家供應商或將據點移到海外。

現階段美國執法單位尚未透露是否已對McColo涉及違法的情事展開調查或採取行動。(編譯/陳曉莉)

資料來源:ITHOME Online
http://www.ithome.com.tw/itadm/article.php?c=52018


week mail flow


month mail flow


參考資料:
http://voices.washingtonpost.com/washingtonpostinvestigations/2008/11/spam_provider_shut_down_leads.html

Total spam report volume

These graphs show the number of messages submitted as spam along with the number of reports consumated regarding those messages. This data reflects more about SpamCop's usage patterns than it does about the spam. These numbers now reflect only a small fraction of total spam being processed by SpamCop, but they are still representative of the total.


Spamcop statistics :link

Posted in 標籤: | 0 意見

Sun Microsystems - TECH DAYS 台灣 活動



又是一個來不及報名的盛會!!!
這些訊息怎都收不到~~

Sun Microsystems 即將舉行的活動

17.11. 2008 - SUN TECH DAYS 2008-2009 全球開發人員盛會
2008年11月17日 上午 08:00
誠摯地邀請您參與SUN TECH DAYS 的全球技術盛會!匯聚全球精英與您分享在Java EE、Java SE、JavaFX、JavaScript、NetBeans、OpenSolaris、MySQL、GlassFish、Open Source、Web 2.0、Tools等相關技術的寶貴專業知識與開發技巧!這場難得的盛會將讓您提昇技能,藉此機會學習到新的開放性免費技術,發展更好的應用及基礎架構來達成重要目標,並對開發者技術社群的發展進行創新,學習更多!Empower You!
王朝大酒店(原環亞飯店)2 樓大會堂 / 台北市敦化北路100 號

06.6. 2008 - Sun開源碼資料庫軟體 MySQL技術與服務研討會
2008年6月6日 上午 08:00
為了讓您進一步了解MySQL的強大功能,包含在Solaris、Linux及Windows多種平台的廣泛支援,以及如何降低風險,並可擁有較大的彈性及選擇以達成不受限制的架構規模,將MySQL導入於關鍵應用的開發作業中。昇陽電腦(Sun Microsystems)將於逢甲大學舉辦一場「自由軟體的無限契機 - Sun開源碼資料庫軟體MySQL技術與服務研討會」,將精闢闡述最新MySQL的建置流程與分析操作,竭誠地邀請您一同參與!
逢甲大學(商學大樓8樓) 第八會議廳 (台中市西屯文化路100號)

22.4. 2008 - 2008昇陽電腦 開發者技術日
2008年4月22日 上午 08:00
Sun Developer Day –開發者技術日,是Sun Microsystems為開發者所提供的免費技術講座。主題包括Java,Open Solaris,MySQL,NetBeans,GlassFish等開發技術新知。
文化大 學推廣部 國際會議中心,台北市建國南路二段231號 B1

25.3. 2008 - 昇陽大學日
2008年3月25日 上午 08:00
專為現代學子們提供的免費技術講座

Posted in 標籤: , , | 0 意見

Google Developer Day 2008 Taiwan





過期很久了~~沒跟到!!
但是還是可以上去看看他vedio & point file

2008 年 6 月 14 日
台北國際會議中心
developerday-tw@google.com

「Google 2008 台北程式開發日」的目的,在於透過 Google 提供給開發者的技術,擴展網頁應用程式的界限。Google 工程師以及網頁開發專家會主持全日的分組議程及程式碼實驗室,務求讓您能更深入了解 Google 的最新技術。

「Google 2008 台北程式開發日」同時也是一次可以讓開發者交流心得的機會。您在會上將有充分的時間認識其他開發者,討論意見及分享您的發現。

http://sites.google.com/site/developerdaytaiwan/

http://code.google.com/

Posted in 標籤: | 0 意見

Gmail故障部分Google Apps企業用戶受害

Gmail發生長達將近30個小時的故障,並影響到Google Apps的企業用戶,雖然Google官方已發出信函表明問題已解決,不過還是讓許多公司因此而陷入緊張又忙碌的氣氛之中。

Google宣稱這次Gmail故障事件只影響到小部分的個人用戶,可是事實上,有些企業用戶使用的Google Apps確實也受到故障所影響。上週三大約下午三點左右,在Google Apps的官方討論區中就已被提出,Gmail使用者登遇到登入帳號的問題,而Google官方在5點時已作出回應,並預計希望可以在隔天早上9點解決。

當時,有些公司無法登入Gmail帳號,連帶無法使用Google Apps當中的服務。由於Google Apps是一套建基於網路上的協同合作與協同通訊的軟體與服務,企業用戶可以透過Google Apps擁有Gmail、獨立網址的專屬入口網站、Google Talk、獨立網址的行事曆、網頁空間等,而Google Apps Premier edition則有收費制度,每位使用者一年需花費50美元的費用。因此許多中小企業都可以透過Google Apps架起獨立的網站服務。

其實,Gmail在8月分也發生過3次重大的故障情況,不過那幾次的故障只影響到少數的免費電子郵件信箱的使用者,像是8月11日的故障約2個小時,8月6日與8月15日的故障則影響小部分Google Apps Premier edition的用戶,但有部分影響到某些用戶幾乎長達24個小時無法登入。

Google Apps是基於「軟體即服務」(Software as a Service,SAAS)的網路服務,是近年來企業用戶面對軟體服務的風潮。不過由於SAAS都是透過網路作業,無論存檔、溝通等都在網路上,企業用戶最關心的也是效能的表現,以及系統的穩定性。

當軟體業界不斷鼓勵SAAS服務時,企業不用再自建電子郵件系統,不把機器架在自己的機房,而交給像Google Apps這樣類似功能的管理,輕鬆又方便,但是提供服務的廠商在安全性、穩定性都需有一定的品質,否則一旦出現狀況或故障,也就只能等待對方來解決問題,而無法靠自己的IT人員來修復,等待的過程很可能就讓企業的CEO們急著跳腳。無論是Google或其他軟體業者,面對SAAS服務時,還是要特別謹慎。

更新日期:2008/10/20 16:07 薛怡青報導

資料來源:
Gmail故障 部分Google Apps企業用戶受害

相關訊息:
Systemwide GMail Outage
Gmail兩週三次出現無法登入問題
Google Apps及Gmail服務無預警中斷
谷歌稱Gmail正常訪問率高達99.9%

Posted in 標籤: | 0 意見

一起來 Racing ...

機車的新廣告.......Cool
(我看你只是愛 racing,妳也只是愛包包)



Day Job by Sunshine state



歌詞連結:http://silverwalker.pixnet.net/blog/post/22104148

Posted in 標籤: | 0 意見

NAS benchmark

Posted in 標籤: | 0 意見

VMware Infrastructure 3 Configuration Maximums

When you are selecting and configuring your virtual and physical equipment, you must stay at or below the
maximums supported by VMware® Infrastructure 3. The limits presented in the following tables represent
tested, recommended limits, and they are fully supported by VMware.

Configuration Maximums
Virtual Machine Maximums
ESX Server Host Maximums
Storage Maximums
Compute Maximums
Memory Maximums
Networking Maximums
Resource Pool Maximums
VirtualCenter Maximums

http://www.vmware.com/pdf/vi3_35/esx_3/r35/vi3_35_25_config_max.pdf

Posted in 標籤: | 0 意見

Virtualization ESX Server Switch Storage Configure MTU 9000

ESX Server, IP Storage, and Jumbo Frames

With the release of VMware Infrastructure version 3.5, VMware added support for jumbo frames. Although the documentation states that jumbo frames “are not supported for NAS and iSCSI traffic”, jumbo frames for NFS and iSCSI does actually work. Here’s some information on getting it working.

How I Tested

Keep in mind that this is not an “officially supported” configuration (see the section on the “Official” Support Statement below), so use at your own risk. I will not be held responsible if you blow up your production environment trying to make jumbo frames work.

Here’s how I tested the use of jumbo frames for software iSCSI and NFS datastores:

  • For the physical switch infrastructure, I used a Cisco Catalyst 3560G running Cisco IOS version 12.2(25)SEB4.
  • For the physical server hardware, I used a group of HP ProLiant DL385 G2 servers with dual-core AMD Opteron processors and a quad-port PCIe Intel Gigabit Ethernet NIC.
  • For the storage system, I used a NetApp FAS940 running Data ONTAP 7.2.4.

The exact commands and/or procedures may be different for you depending upon the hardware and/or software versions that you’re running in your environment. Keep that in mind.

Configuring the Physical Switch

Fortunately for me, the Cisco Catalyst 3560G does indeed support jumbo frames. (Naturally, you’ll want to ensure that your switch supports jumbo frames.) Jumbo frames are not, however, enabled by default; they must be enabled using the following command in global configuration mode:

system mtu jumbo 9000

Note that 9000 bytes seems to be the generally accepted size for jumbo frames, so that’s what I used.

After running this command, you must reboot the switch. The change doesn’t take effect until a reload. Fortunately, IOS reminds you of this after you enter the command. Once the switch has rebooted, you can verify the MTU setting with this command:

show system mtu

This should report that the system jumbo MTU size is 9000 bytes, confirming that the switch is ready for jumbo frames. Now we’re prepared to configure the storage system.

Configuring the Storage System

Using FilerView, increasing the MTU on the appropriate network interfaces to 9000 bytes is as simple as going to Network > Manage Interfaces and then clicking the Modify link for the interface to be changed. Set the “MTU size” to 9000 (from the default of 1500), click Apply, and you’re ready to roll.

You can verify the settings in FilerView using Network > Manage Interfaces > Show All Interface Details, or by using the “ifconfig -a” command from a Data ONTAP command prompt.

Configuring ESX Server

There is no GUI in VirtualCenter for configuring jumbo frames; all of the configuration must be done from a command line on the ESX server itself. There are two basic steps:

  1. Configure the MTU on the vSwitch.
  2. Create a VMkernel interface with the correct MTU.

First, we need to set the MTU for the vSwitch. This is pretty easily accomplished using esxcfg-vswitch:

esxcfg-vswitch -m 9000 vSwitch1

A quick run of “esxcfg-vswitch -l” (that’s a lowercase L) will show the vSwitch’s MTU is now 9000; in addition, “esxcfg-nics -l” (again, a lowercase L) will show the MTU for the NICs linked to that vSwitch are now set to 9000 as well.

Second, we need to create a VMkernel interface. This step is a bit more complicated, because we need to have a port group in place already, and that port group needs to be on the vSwitch whose MTU we set previously:

esxcfg-vmknic -a -i 172.16.1.1 -n 255.255.0.0 -m 9000 IPStorage

This creates a port group called IPStorage on vSwitch1—the vSwitch whose MTU was previously set to 9000—and then creates a VMkernel port with an MTU of 9000 on that port group. Be sure to use an IP address that is appropriate for your network when creating the VMkernel interface.

To test that everything is working so far, use the vmkping command:

vmkping -s 9000 172.16.1.200

Clearly, you’ll want to substitute the IP address of your storage system in that command.

That’s it! From here you should be able to easily add an NFS datastore or connect to an iSCSI LUN using jumbo frames from the ESX server.

“Official” Support Statement

Officially, jumbo frames are only supported by VMware for use by virtual machines. Technically, VMware does not support the use of jumbo frames for the software iSCSI initiator or for use with NFS datastores. At least, that’s my understanding.

So, feel free to tinker around with jumbo frames for IP-based storage, and when VMware adds official support for it in the future—I can’t imagine why they wouldn’t—then you’ll be able to hit the ground running with the configuration steps necessary to make it work.


Data link from : http://blog.scottlowe.org/2008/04/22/esx-server-ip-storage-and-jumbo-frames/

Posted in 標籤: | 0 意見

Sendmail Server IP In RBL List 會造成 Sendmail Server 誤判

對方主機給的訊息:RBL matched Blocked - see http://cbl.abuseat.org/lookup.cgi?ip=210.68.43.7
Sendmail主機Log卻產生誤判為:dsn=5.1.1, stat=User unknown,
造成管理者判斷錯誤,無法發現自已主機被列入RBL Blocklist,無法即時處理。

對方主機 Log
2008-08-20 14:43:49 H=(mailserver) [210.68.43.7]:49842 I=[210.68.43.8]:25 F= rejected RCPT : RBL matched Blocked - see http://cbl.abuseat.org/lookup.cgi?ip=210.68.43.7

Sendmail Log
Aug 18 14:43:49 mailserver sendmail[3463]: m7I6hnH2003461: to=, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=134598, relay=domain.com.tw. [210.68.43.7], dsn=5.1.1, stat=User unknown

Aug 18 17:05:06 mailserver sendmail[32762]: m7I9566c032758: to=, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=124478, relay=domain.com.tw. [210.68.43.7], dsn=5.1.1, stat=User unknown

Posted in 標籤: | 0 意見

Freebsd add new SCSI Disk

#camcontrol all

#disklabel -r -w da1s1 auto

# disklabel -e da1s1
# /dev/da1s1c:
type: SCSI
disk: IBM
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1114
sectors/unit: 17912412
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0

8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 17912412 0 unused 0 0 # (Cyl. 0 - 1114*)
~

# newfs /dev/da1s1c
Warning: Block size and bytes per inode restrict cylinders per group to 89.
Warning: 3492 sector(s) in last cylinder unallocated
/dev/da1s1c: 17912412 sectors in 4374 cylinders of 1 tracks, 4096 sectors
8746.3MB in 50 cyl groups (89 c/g, 178.00MB/g, 22144 i/g)
super-block backups (for fsck -b #) at:
32, 364576, 729120, 1093664, 1458208, 1822752, 2187296, 2551840, 2916384,
3280928, 3645472, 4010016, 4374560, 4739104, 5103648, 5468192, 5832736,
6197280, 6561824, 6926368, 7290912, 7655456, 8020000, 8384544, 8749088,
9113632, 9478176, 9842720, 10207264, 10571808, 10936352, 11300896, 11665440,
12029984, 12394528, 12759072, 13123616, 13488160, 13852704, 14217248,
14581792, 14946336, 15310880, 15675424, 16039968, 16404512, 16769056,
17133600, 17498144, 17862688


#mount /dev/da1s1c /data1

#df -h

可參考freebsd handbook作法:
http://www.freebsd.org/doc/zh_TW/books/handbook/disks-adding.html

Posted in 標籤: | 0 意見

one-lines for awk

好用的一行 awk 語法:

HANDY ONE-LINERS FOR AWK 22 July 2003
compiled by Eric Pement version 0.22
Latest version of this file is usually at:
http://www.student.northpark.edu/pemente/awk/awk1line.txt

USAGE:

Unix: awk '/pattern/ {print "$1"}' # standard Unix shells
DOS/Win: awk '/pattern/ {print "$1"}' # okay for DJGPP compiled
awk "/pattern/ {print \"$1\"}" # required for Mingw32

Most of my experience comes from version of GNU awk (gawk) compiled for
Win32. Note in particular that DJGPP compilations permit the awk script
to follow Unix quoting syntax '/like/ {"this"}'. However, the user must
know that single quotes under DOS/Windows do not protect the redirection
arrows (<, >) nor do they protect pipes (|). Both are special symbols
for the DOS/CMD command shell and their special meaning is ignored only
if they are placed within "double quotes." Likewise, DOS/Win users must
remember that the percent sign (%) is used to mark DOS/Win environment
variables, so it must be doubled (%%) to yield a single percent sign
visible to awk.

If I am sure that a script will NOT need to be quoted in Unix, DOS, or
CMD, then I normally omit the quote marks. If an example is peculiar to
GNU awk, the command 'gawk' will be used. Please notify me if you find
errors or new commands to add to this list (total length under 65
characters). I usually try to put the shortest script first.

FILE SPACING:

# double space a file
awk '1;{print ""}'
awk 'BEGIN{ORS="\n\n"};1'

# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
# NOTE: On Unix systems, DOS lines which have only CRLF (\r\n) are
# often treated as non-blank, and thus 'NF' alone will return TRUE.
awk 'NF{print $0 "\n"}'

# triple space a file
awk '1;{print "\n"}'

NUMBERING AND CALCULATIONS:

# precede each line by its line number FOR THAT FILE (left alignment).
# Using a tab (\t) instead of space will preserve margins.
awk '{print FNR "\t" $0}' files*

# precede each line by its line number FOR ALL FILES TOGETHER, with tab.
awk '{print NR "\t" $0}' files*

# number each line of a file (number on left, right-aligned)
# Double the percent signs if typing from the DOS command prompt.
awk '{printf("%5d : %s\n", NR,$0)}'

# number each line of file, but only print numbers if line is not blank
# Remember caveats about Unix treatment of \r (mentioned above)
awk 'NF{$0=++a " :" $0};{print}'
awk '{print (NF? ++a " :" :"") $0}'

# count lines (emulates "wc -l")
awk 'END{print NR}'

# print the sums of the fields of every line
awk '{s=0; for (i=1; i<=NF; i++) s=s+$i; print s}'

# add all fields in all lines and print the sum
awk '{for (i=1; i<=NF; i++) s=s+$i}; END{print s}'

# print every line after replacing each field with its absolute value
awk '{for (i=1; i<=NF; i++) if ($i < 0) $i = -$i; print }'
awk '{for (i=1; i<=NF; i++) $i = ($i < 0) ? -$i : $i; print }'

# print the total number of fields ("words") in all lines
awk '{ total = total + NF }; END {print total}' file

# print the total number of lines that contain "Beth"
awk '/Beth/{n++}; END {print n+0}' file

# print the largest first field and the line that contains it
# Intended for finding the longest string in field #1
awk '$1 > max {max=$1; maxline=$0}; END{ print max, maxline}'

# print the number of fields in each line, followed by the line
awk '{ print NF ":" $0 } '

# print the last field of each line
awk '{ print $NF }'

# print the last field of the last line
awk '{ field = $NF }; END{ print field }'

# print every line with more than 4 fields
awk 'NF > 4'

# print every line where the value of the last field is > 4
awk '$NF > 4'


TEXT CONVERSION AND SUBSTITUTION:

# IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
awk '{sub(/\r$/,"");print}' # assumes EACH line ends with Ctrl-M

# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
awk '{sub(/$/,"\r");print}

# IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format
awk 1

# IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
# Cannot be done with DOS versions of awk, other than gawk:
gawk -v BINMODE="w" '1' infile >outfile

# Use "tr" instead.
tr -d \r outfile # GNU tr version 1.22 or higher

# delete leading whitespace (spaces, tabs) from front of each line
# aligns all text flush left
awk '{sub(/^[ \t]+/, ""); print}'

# delete trailing whitespace (spaces, tabs) from end of each line
awk '{sub(/[ \t]+$/, "");print}'

# delete BOTH leading and trailing whitespace from each line
awk '{gsub(/^[ \t]+|[ \t]+$/,"");print}'
awk '{$1=$1;print}' # also removes extra space between fields

# insert 5 blank spaces at beginning of each line (make page offset)
awk '{sub(/^/, " ");print}'

# align all text flush right on a 79-column width
awk '{printf "%79s\n", $0}' file*

# center all text on a 79-character width
awk '{l=length();s=int((79-l)/2); printf "%"(s+l)"s\n",$0}' file*

# substitute (find and replace) "foo" with "bar" on each line
awk '{sub(/foo/,"bar");print}' # replaces only 1st instance
gawk '{$0=gensub(/foo/,"bar",4);print}' # replaces only 4th instance
awk '{gsub(/foo/,"bar");print}' # replaces ALL instances in a line

# substitute "foo" with "bar" ONLY for lines which contain "baz"
awk '/baz/{gsub(/foo/, "bar")};{print}'

# substitute "foo" with "bar" EXCEPT for lines which contain "baz"
awk '!/baz/{gsub(/foo/, "bar")};{print}'

# change "scarlet" or "ruby" or "puce" to "red"
awk '{gsub(/scarlet|ruby|puce/, "red"); print}'

# reverse order of lines (emulates "tac")
awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' file*

# if a line ends with a backslash, append the next line to it
# (fails if there are multiple lines ending with backslash...)
awk '/\\$/ {sub(/\\$/,""); getline t; print $0 t; next}; 1' file*

# print and sort the login names of all users
awk -F ":" '{ print $1 | "sort" }' /etc/passwd

# print the first 2 fields, in opposite order, of every line
awk '{print $2, $1}' file

# switch the first 2 fields of every line
awk '{temp = $1; $1 = $2; $2 = temp}' file

# print every line, deleting the second field of that line
awk '{ $2 = ""; print }'

# print in reverse order the fields of every line
awk '{for (i=NF; i>0; i--) printf("%s ",i);printf ("\n")}' file

# remove duplicate, consecutive lines (emulates "uniq")
awk 'a !~ $0; {a=$0}'

# remove duplicate, nonconsecutive lines
awk '! a[$0]++' # most concise script
awk '!($0 in a) {a[$0];print}' # most efficient script

# concatenate every 5 lines of input, using a comma separator
# between fields
awk 'ORS=%NR%5?",":"\n"' file



SELECTIVE PRINTING OF CERTAIN LINES:

# print first 10 lines of file (emulates behavior of "head")
awk 'NR < 11'

# print first line of file (emulates "head -1")
awk 'NR>1{exit};1'

# print the last 2 lines of a file (emulates "tail -2")
awk '{y=x "\n" $0; x=$0};END{print y}'

# print the last line of a file (emulates "tail -1")
awk 'END{print}'

# print only lines which match regular expression (emulates "grep")
awk '/regex/'

# print only lines which do NOT match regex (emulates "grep -v")
awk '!/regex/'

# print the line immediately before a regex, but not the line
# containing the regex
awk '/regex/{print x};{x=$0}'
awk '/regex/{print (x=="" ? "match on line 1" : x)};{x=$0}'

# print the line immediately after a regex, but not the line
# containing the regex
awk '/regex/{getline;print}'

# grep for AAA and BBB and CCC (in any order)
awk '/AAA/; /BBB/; /CCC/'

# grep for AAA and BBB and CCC (in that order)
awk '/AAA.*BBB.*CCC/'

# print only lines of 65 characters or longer
awk 'length > 64'

# print only lines of less than 65 characters
awk 'length < 64'

# print section of file from regular expression to end of file
awk '/regex/,0'
awk '/regex/,EOF'

# print section of file based on line numbers (lines 8-12, inclusive)
awk 'NR==8,NR==12'

# print line number 52
awk 'NR==52'
awk 'NR==52 {print;exit}' # more efficient on large files

# print section of file between two regular expressions (inclusive)
awk '/Iowa/,/Montana/' # case sensitive


SELECTIVE DELETION OF CERTAIN LINES:

# delete ALL blank lines from a file (same as "grep '.' ")
awk NF
awk '/./'


CREDITS AND THANKS:

Special thanks to Peter S. Tillier for helping me with the first release
of this FAQ file.

For additional syntax instructions, including the way to apply editing
commands from a disk file instead of the command line, consult:

"sed & awk, 2nd Edition," by Dale Dougherty and Arnold Robbins
O'Reilly, 1997
"UNIX Text Processing," by Dale Dougherty and Tim O'Reilly
Hayden Books, 1987
"Effective awk Programming, 3rd Edition." by Arnold Robbins
O'Reilly, 2001

To fully exploit the power of awk, one must understand "regular
expressions." For detailed discussion of regular expressions, see
"Mastering Regular Expressions, 2d edition" by Jeffrey Friedl
(O'Reilly, 2002).

The manual ("man") pages on Unix systems may be helpful (try "man awk",
"man nawk", "man regexp", or the section on regular expressions in "man
ed"), but man pages are notoriously difficult. They are not written to
teach awk use or regexps to first-time users, but as a reference text
for those already acquainted with these tools.

USE OF '\t' IN awk SCRIPTS: For clarity in documentation, we have used
the expression '\t' to indicate a tab character (0x09) in the scripts.
All versions of awk, even the UNIX System 7 version should recognize
the '\t' abbreviation.

#---end of file---

data from http://www.student.northpark.edu/pemente/awk/awk1line.txt


new link:http://www.catonmat.net/blog/awk-one-liners-explained-part-one/

Posted in 標籤: | 2 意見

分享經營管理

閱讀資訊與管理一書,取自其中的一段內容,感受很深,所以紀錄下來。

一個要將產量提升百分之三十的經理,就必須向其主管爭取更多的經費以購買新廠或新的生產系統;

一個要提高員工素質的主管也必須與其上司協商提高員工薪水與福利。


摘錄:資訊與管理 理論與實務 85頁

Posted in 標籤: | 0 意見

MS SQL 2005 Server Change Listen Port

"SQL Server Configuration Manager"

in menu "Start -> All Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager",把TCP/IP設Enabled

SQL Server 2005 網路組態 -> MSSQLServer 的通訊協定 -> TCP/IP -> IP位址 -> TCP 通訊埠

MSSQL Server 改 port:

修改前:
1433

修改後:
15000

MSSQL Server 多聽一個 port:
修改前:
1433

修改後:
1433,15000

Posted in 標籤: | 0 意見

Solaris useradd & passwd

Solaris useradd 開帳號 passwd 改密碼

create account:
#useradd -m -g staff -d /export/home/lani -s /usr/bin/tcsh -c 'lani' lani

set user password:
#passwd lani

手動修改user & password
#vipw

user info:
/etc/passwd

pass info:
/etc/shadow

Posted in 標籤: | 2 意見

隱藏 Blogger Navigation Bar

隱藏 Blogger 最上方的搜尋工具列(Navigation Bar)

版面配置-->修改HTML,將.navbar {display:none;}貼到body{}上方,如下:

.navbar {display:none;}
body { ... }

Posted in 標籤: | 0 意見

抱飲抱食(德國菜)

朋友介紹的店--抱飲抱食(德國菜)
上網找了資料,照片看起來真的會讓人"暴飲暴食",
先紀錄下來,等有空再去吃。




圖片引用:http://blog.pixnet.net/patrica/post/4310902

地址:台北縣新店市中央三街5號(就在小碧潭站出口對面的巷子裡)
電話:02-22182018(用餐時間記得要訂位)

價位:
http://blog.sstin.org/archives/266
資料連結:
http://www.mobile01.com/waypointtopicdetail.php?f=190&t=548653

Posted in 標籤: | 0 意見

Yahoo 無名小站 -- 被我看到壞了

很抱歉,現在無法立即處理您的需求 -- 錯誤 999.






Posted in 標籤: | 2 意見

安裝 PHP 支援 GD

GD 安裝
第一部需要做的是先要安裝 GD 到系統內,而安裝 GD 前需要安裝 jpeg-6b, libpng, zlib。以下是下載網址:

GD 2.0.33
jpeg-6b
libpng 1.2.8
zlib 1.2.2

下載完成後鍵入以下指令進行安裝。

安裝 zlib
01 tar zxvf zlib-1.2.2.tar.gz
02 cd zlib-1.2.2
03 ./configure
04 make
05 make install


安裝 libpng
01 tar zxvf libpng-1.2.8-config.tar.gz
02 cd libpng-1.2.8-config
03 ./configure
04 make
05 make install


安裝 jpeg-6b
01 tar zxvf jpegsrc.v6b.tar.gz
02 cd jpeg-6b
03 ./configure
04 make
05 make install


安裝 GD
01 tar zxvf gd-2.0.33.tar.gz
02 cd gd-2.0.33
03 ./configure
04 make
05 make install


因為以上各套件均使用預設值安裝,所以安裝時所遇到的問題會較少,下一步需要配置 PHP 。

PHP 配置
現在需要重新編譯 PHP,並選擇支援 GD,如果系統內已刪除了 PHP 的原始碼,可以到 php.net 下載,然後輸入以下指令:

01 tar zxvf php-4.3.11.tar.gz
02 cd php-4.3.11
03 ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --prefix=/usr/local/php --with-gd --with-zlib-dir=/usr/local
04 make
05 make install

以上在 ./configure 裡的選項只可以參考,在編譯時必須根據自己的環境配置而修改,而 --with-gd 及 --with-zlib-dir=/usr/local 就是設定成支援 GD。


====================================================
歡迎轉載,但轉載時請保留此宣告,不得作為商業用途
作者: Sam Tang
來源網站: http://www.phpdc.com/

http://www.phpdc.com/article/21/

Posted in 標籤: | 0 意見

JAVA 開始學習

今天開始去上JAVA課,
一直想學,但是都沒有行動,
終於有時間安排去上課。

節次 課程內容
課程大綱
Course Introduction、Java Introduction
Your First Cup of Java
變數、運算子、運算式與敘述
程式流程控制(Decision Making)
程式流程控制(Looping and Branching)
方法(Method)、參數傳遞
方法(Method)、Overloading
物件導向概念與物件基礎
基本物件:數字、數學和陣列物件
基本物件:字元、字串與字串緩衝物件
類別、成員、建構元與 this 關鍵字
JCreator、存取控制與 static 關鍵字
繼承、同名異型、super 關鍵字
java.lang.Object 與 final
虛擬類別(abstract class)
巢狀類別(inner class)
介面(interface)
套件(package)
例外處理(Exception)
Java IO (1)
十一 Java IO (2)
物件序列化(Object Serialization)
十二 Network Basics、Java Conventions
結業測驗

Posted in 標籤: | 0 意見

FreeBSD Rescan SCSI device

Pav said I should now be able to see the CD-RW as a SCSI device. I started searching:

# camcontrol rescan all

FreeBSD 重新抓取 SCSI 裝置

參考資料:http://www.freebsddiary.org/cdrecord-ide.php

Posted in 標籤: | 0 意見

Freebsd make kernel

Procedure 1. Building a Kernel the “Traditional” Way

1.Run config(8) to generate the kernel source code.

# /usr/sbin/config MYKERNEL

2.Change into the build directory. config(8) will print the name of this directory after being run as above.

# cd ../compile/MYKERNEL

For FreeBSD versions prior to 5.0, use the following form instead:

# cd ../../compile/MYKERNEL

3.Compile the kernel.

# make depend
# make

4.Install the new kernel.

# make install

Procedure 2. Building a Kernel the “New” Way

1.Change to the /usr/src directory.

# cd /usr/src

2.Compile the kernel.

# make buildkernel KERNCONF=MYKERNEL

3.Install the new kernel.

# make installkernel KERNCONF=MYKERNEL

8.3 重新調配、編譯 kernel

Posted in 標籤: | 0 意見

Network File System (NFS)

最近因為Mail server 使用NFS方式 mount nas ,
但是一直因為NFS server file lock,造成NFS client cyrus ioerror:
IOERROR: locking header for user.lani: Operation not supported

NFS Server and NFS Client OS 皆是FreeBSD
為了解此問題,所以查詢了一下NFS man page.

其實Frebsd NFS 針對 locking 說明:

If real locking between the NFS clients and NFS server is not required, it is possible to let the NFS client do locking locally by passing -L to mount_nfs(8). Refer to the mount_nfs(8) manual page for further details.

參考資料:
FreeBSD mount NFS file systems
mount_nfs -- mount NFS file systems
Red Hat Enterprise Linux Reference Guide Network File System

基本設定可參考此說明:
http://turtle.ee.ncku.edu.tw/~ac/FreeBSD/50_NFS/nfs.html
http://mgtcc.mgt.ncu.edu.tw/faq_in.php?op=Linux&oop=NFS.htm

Posted in 標籤: | 0 意見

BSD big5 to utf8

將 big5 的文字檔轉換為 utf8 的文字檔

Usage: iconv [-c] [-s] [-f fromcode] [-t tocode] [file ...]
or: iconv -l

iconv -l :顯示支援的字形

iconv -f BIG5 -t UTF-8 big5.txt > utf8.txt

Posted in 標籤: | 0 意見

Exim Multidomain 測試二

The rewrite flag ``S'' specifies a rewrite of incoming envelope addresses at SMTP time, as soon as an address is received in a MAIL or RCPT command, and before any other processing

參考資料:
31.8. Flags specifying which headers and envelope addresses to rewrite
31.9. The SMTP-time rewriting flag

######################################################################
# REWRITE CONFIGURATION #
######################################################################

參數如下:
begin rewrite

\N^(.*)@(.*)$\N "${lookup mysql {SELECT pridomain FROM multidomaindb WHERE secdomain='$2'}{$1@$value}fail}" SE

S The SMTP-time rewriting flag
E rewrite all envelope fields

Posted in 標籤: | 0 意見

Exim Multidomain 測試一

建構想法:
1、不影嚮原主機架構
2、快速建置符合需求
3、決定使用rewrite方式

新增一個資料表 multidomain,新增兩欄位 Pridomain & Secdomain。

Pridomain:為主要Domain
Secdomain:為次要Domain 或第三筆、第四筆Domain

修改 Exim configure rewrite 區
######################################################################
# REWRITE CONFIGURATION #
######################################################################

參數如下:
begin rewrite
*@* "${lookup mysql {SELECT pridomain FROM multidomaindb WHERE secdomain='$2'}{$1@$value}fail}" Tbct

其中使用到 Tbct 表示意義如下:
T rewrite the envelope To field
b rewrite the Bcc: header
c rewrite the Cc: header
t rewrite the To: header

參數用意:
將進來的emailaddress,凡有第二筆Domain以上,皆置換為主要Domain後,送往後端主機。

測試結論,rewrite 在acl check之後,所以必須克服此問題。

Posted in 標籤: | 0 意見

Benchmark pop 、 smtp

# rabid:

./rabid
Usage: rabid [-r max-connections-per-minute] [-p processes] [-l local-address]
[-c messages-per-connection] [-a] [-i imap-percentage]
[-s ssl-percentage] [-d download-percentage[:delete-percentage]]
[-[z|Z] debug-file]
pop-server user-list-filename conversion-filename

./rabid -r 400 -c 100 127.0.0.1 users loqueseael
fichero users lo creareemos con: echo “username@oio.idv.tw password”

# postal:

./postal
Usage: postal [-m maximum-message-size] [-p processes] [-l local-address]
[-c messages-per-connection] [-r messages-per-minute] [-a]
[-b [no]netscape] [-[z|Z] debug-file]
[-s ssl-percentage]
smtp-server user-list-filename conversion-filename

Posted in 標籤: | 0 意見

MySQL Select db outfile

使用指令:

mysql> Select * from userdb into outfile "/tmp/result.txt";

注意示項:

outfile 存放路徑 & 存放所在位置的權限,

為了避免權限問題,建議存放在 /tmp

Posted in 標籤: | 0 意見

Exim How To Test system filter 測試

Exim system filter

測試指令:

#exim -f abc@oio.idv.tw -bfl cde -bfd ezbuy.idv.tw -bF system_filter < testmail.message

測試結果:
Sender = abc@oio.idv.tw
Recipient = cde@oio.idv.tw
Testing Exim filter file /usr/exim4/system_filter

Logfile /var/log/exim4/exim_filterlog
Filtering did not set up a significant delivery.
Normal delivery will occur.


指令說明:
-f



This option sets the address of the envelope sender of a locally-generated message (also known as the return path). The option can normally be used only by a trusted user, but untrusted_set_sender can be set to allow untrusted users to use it.


-bF

This option is the same as -bf except that it assumes that the filter being tested is a system filter. The additional commands that are available only in system filters are recognized.


-bfd

This sets the domain of the recipient address when a filter file is being tested by means of the -bf option. The default is the value of $qualify_domain.


-bfl

This sets the local part of the recipient address when a filter file is being tested by means of the -bf option. The default is the username of the process that calls Exim. A local part should be specified with any prefix or suffix stripped, because that is how it appears to the filter when a message is actually being delivered.

資料來源:
http://www.exim.org/exim-html-current/doc/html/spec_html/ch05.html

Posted in 標籤: | 1 意見

Telnet Testing SMTP AUTH connections

資料引用
Telnet Testing AUTH:http://qmail.jms1.net/test-auth.shtml

Find your authentication information

#perl -MMIME::Base64 -e 'print encode_base64("\000jms1\@jms1.net\000not.my.real.password")'
AGptczFAam1zMS5uZXQAbm90Lm15LnJlYWwucGFzc3dvcmQ=

Connecting to the server

% telnet 1.2.3.4 25
220 a.mx.jms1.net NO UCE ESMTP
ehlo testing
250-a.mx.jms1.net NO UCE
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-PIPELINING
250 8BITMIME

Sending the AUTH command

Assuming the server supports AUTH, we will send the actual AUTH command to try and authenticate.

AUTH PLAIN AGptczFAam1zMS5uZXQAbm90Lm15LnJlYWwucGFzc3dvcmQ=
235 ok, go ahead (#2.0.0)

If you see this message, you are authenticated. If you see this one instead...

AUTH PLAIN AGptczFAam1zMS5uZXQAbm90Lm15LnJlYWwucGFzc3dvcmQ=
535 authorization failed (#5.7.0)

Sending the message

Once you are authenticated, you may continue with a normal SMTP conversation and the server should accept any message from you, whether you are relaying to an outside domain or not. Even if you don't authenticate, the server will still accept messages from you- it just won't relay (it will act the same as if you had never entered an AUTH command at all.)

mail from:
250 ok
rcpt to:
250 ok
data
354 go ahead
From: John
To: Nobody
Subject: fnord

hail eris!
.
250 ok 1113954693 qp 29052
quit
221 a.mx.jms1.net NO UCE



資料引用
SMTP & POP Telnet Command:http://forum.shareget.com/t287532/

SMTP 命令簡介

什麼是 SMTP
SMTP (Simple Mail Transfer Protocol) : 電子郵件從客戶機傳輸到服務器或從某一個服務器傳輸到另一個服務器使用的傳輸協議。 SMTP 是請求/響應協議,命令和響應都是基於 ASCII 文本,並以 CR 和 LF 符結束。響應包括一個表示返回狀態的三位數字代碼。SMTP 在 TCP 協議 25 端口監聽連接請求。
什麼是 ESMTP
ESMTP (Extended SMTP),顧名思義,擴展 SMTP 就是對標準 SMTP 協議進行的擴展。它與 SMTP 服務的區別僅僅是,使用 SMTP 發信不需要驗證用戶帳戶,而用 ESMTP 發信時,服務器會要求用戶提供用戶名和密碼以便驗證身份。驗證之後的郵件發送過程與 SMTP 方式沒有兩樣。
SMTP 命令
SMTP 命令包括:
HELO 向服務器標識用戶身份。發送者能欺騙,說謊,但一般情況下服務器都能檢測到。
EHLO 向服務器標識用戶身份。發送者能欺騙,說謊,但一般情況下服務器都能檢測到。
MAIL FROM 命令中指定的地址是發件人地址
RCPT TO 標識單個的郵件接收人;可有多個 RCPT TO;常在 MAIL 命令後面。
DATA 在單個或多個 RCPT 命令後,表示所有的郵件接收人已標識,並初始化數據傳輸,以 CRLF.CRLF 結束
VRFY 用於驗證指定的用戶/郵箱是否存在;由於安全方面的原因,服務器常禁止此命令
EXPN 驗證給定的郵箱列表是否存在,擴充郵箱列表,也常被禁用
HELP 查詢服務器支持什麼命令
NOOP 無操作,服務器應響應 OK
RSET 重置會話,當前傳輸被取消
QUIT 結束會話

連接 Winmail Server 使用 SMTP 命令發送郵件
例如:安裝 Winmail 的郵件服務器IP是192.168.0.1 (藍色字體內容由客戶端輸入,紅色字體內容是服務返回的)
telnet 192.168.0.1 25 --------------------------------------- 使用 telnet 命令連接服務器 25 端口
Trying 192.168.0.1... --------------------------------------- 正在連接服務器 25 端口
Connected to 192.168.0.1. ----------------------------------- 連接服務器 25 端口成功
220 Winmail Mail Server ESMTP ready ------------------------- 顯示服務器的標識名稱 (Winmail 管理工具->高級設置->系統參數->基本參數中可更改)
helo cnu.com ------------------------------------------------ 向服務器標識用戶身份,發信不要認證,跳過下面幾步直接發送 mail from 命令
250 Winmail Mail Server
ehlo cnu.com ------------------------------------------------ ESMTP 命令,發信需要認證。
250-Winmail Mail Server
250-PIPELINING
250-AUTH=LOGIN PLAIN
250-AUTH LOGIN PLAIN
250-SIZE 20480000
250 8BITMIME
auth login ------------------------------------------------- 進行用戶身份認證
334 VXNlcm5hbWU6
Y29zdGFAYW1heGl0Lm5ldA== ----------------------------------- BASE64 加密後的用戶名
334 UGFzc3dvcmQ6
MTk4MjIxNA== ----------------------------------------------- BASE64 加密後的密碼
235 auth successfully -------------------------------------- 身份認證成功
(535 auth failure ------------------------------------------ 身份認證失敗)
發到本系統中域名下的賬戶可跳過身份認證。
mail from: ------------------------------ mail from 地址 test1@domain.com
250 ok ----------------------------------------------------- 命令執行成功
rcpt to: -------------------------------- 遞送給地址 test2@domain.com
250 ok ----------------------------------------------------- 命令執行成功
data ------------------------------------------------------- 數據傳輸初始化
354 go ahead ----------------------------------------------- 開始傳輸數據
From: test1@domain.com
To: test2@domain.com
Date: Mon, 25 Oct 2004 14:24:27 +0800
Subject: test mail

Hi, test2
This is a test mail, you don't reply it.

.
------------------------------------------------------------ 數據內容,包括BASE64加密後的郵件內容, 以 CRLF.CRLF 結束數據傳輸
250 ok message accepted for delivery ----------------------- 命令執行成功
quit ------------------------------------------------------- 結束會話
221 Winmail Mail Server
Connection closed by foreign host .------------------------- 斷開連接



POP3 命令簡介

什麼是 POP3
POP3 (Post Office Protocol 3) 即郵局協議的第 3 個版本,它規定怎樣將個人計算機連接到 Internet 的郵件服務器和下載電子郵件的電子協議。它是因特網電子郵件的 第一個離線協議標準, POP3 允許用戶從服務器上把郵件存儲到本地主機(即自己的計算機)上,同時刪除保存在郵件服務器上的郵件,而POP3服務器則是遵循 POP3 協議的接收郵件服務器,用來接收電子郵件的。
POP3 命令
POP3 命令包括:
USER username 認證用戶名
PASS password 認證密碼認證,認證通過則狀態轉換
APOP name,digest 認可一種安全傳輸口令的辦法,執行成功導致狀態轉換,請參見 RFC 1321 。
STAT 處理請求 server 回送郵箱統計資料,如郵件數、 郵件總字節數
UIDL n 處理 server 返回用於該指定郵件的唯一標識, 如果沒有指定,返回所有的。
LIST n 處理 server 返回指定郵件的大小等
RETR n 處理 server 返回郵件的全部文本
DELE n 處理 server 標記刪除,QUIT 命令執行時才真正刪除
RSET 處理撤消所有的 DELE 命令
TOP n,m 處理 返回 n 號郵件的前 m 行內容,m 必須是自然數
NOOP 處理 server 返回一個肯定的響應
QUIT 希望結束會話。如果 server 處於"處理" 狀態,則現在進入"更新"狀態,刪除那些標記成刪除的郵件。如果 server 處於"認可"狀態,則結束會話時 server 不進入"更新"狀態 。
使用 telnet 連接 Winmail Server 收信
例如:安裝 Winmail 的郵件服務器 IP 是 192.168.0.1(藍色字體內容由客戶端輸入,紅色字體內容是服務返回的)
telnet 119.119.119.212 110 ----------------------------- 使用 telnet 命令連接服務器 110 端口
Trying 119.119.119.212... ------------------------------ 正在連接服務器 110 端口
Connected to 119.119.119.212. -------------------------- 連接服務器 110 端口成功
+OK Winmail Mail Server POP3 ready
user username ------------------------------------------ 輸入用戶名, username 為具體的用戶名
+OK ---------------------------------------------------- 執行命令成功
pass password ------------------------------------------ 輸入用戶密碼,password 為具體的密碼
+OK 2 messages ----------------------------------------- 密碼認證通過
(-ERR authorization failed ----------------------------- 密碼認證失敗)
stat --------------------------------------------------- 郵箱狀態
+OK 2 6415 --------------------------------------------- 2 為該信箱總郵件數,6415 為總字節數
list --------------------------------------------------- 列出每封郵件的字節數
+OK ---------------------------------------------------- 執行命令成功,開始顯示,左邊為郵件的序號,右邊為該郵件的大小
1 537 -------------------------------------------------- 第 1 封郵件,大小為 537 字節
2 5878 ------------------------------------------------- 第 2 封郵件,大小為 5878 字節
.
top 1 -------------------------------------------------- 接收第 1 封郵件
+OK ---------------------------------------------------- 接收成功, 返回第 1 封郵件頭
Return-Path:
Delivered-To: test2@look.com
Received: (winmail server invoked for smtp delivery); Mon, 25 Oct 2004 14:24:27 +0800
From: test1@look.com
To: test2@look.com
Date: Mon, 25 Oct 2004 14:24:27 +0800
Subject: test mail
.
retr 1 ------------------------------------------------- 接收第 1 封郵件
+OK ---------------------------------------------------- 接收成功, 返回第 1 封郵件全部內容
Return-Path:
Delivered-To: test2@look.com
Received: (winmail server invoked for smtp delivery); Mon, 25 Oct 2004 14:24:27 +0800
From: test1@look.com
To: test2@look.com
Date: Mon, 25 Oct 2004 14:24:27 +0800
Subject: test mail

Hi, test2
This is a test mail, you don't reply it.

.
dele 1 ------------------------------------------------- 刪除第 1 封郵件
+OK ---------------------------------------------------- 刪除成功
dele 2 ------------------------------------------------- 刪除第 2 封郵件
+OK ---------------------------------------------------- 刪除成功
quit --------------------------------------------------- 結束會話
+OK ---------------------------------------------------- 執行命令成功

Posted in 標籤: | 0 意見

Mr PM專欄--產品經理(Product Manager)實戰筆記

一個產品經理不錯的blog,推薦給大家。

http://blog.pixnet.net/pmmustknow/

Posted in 標籤: | 0 意見

ORDB 異常退信問題,請儘快將ordb移除RBL參考的List

ordb.org was shut down on December 18, 2006. Please remove from your mailserver

今天早上用戶反應ORDB問題,原來是該網域出現異常,
原本ORDB網域即已停止服務,今天突然查詢的IP都被列入其RBL,
請有架Mail Server的管理者,請儘快將ordb移除RBL參考的List,
否則寄往您主機的信件,將被您主機reject掉。

測試結果:

測試一:
#dig 1.2.3.4.relays.ordb.org

; <<>> DiG 9.3.3 <<>> 1.2.3.4.relays.ordb.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46963
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;1.2.3.4.relays.ordb.org. IN A

;; ANSWER SECTION:
1.2.3.4.relays.ordb.org. 604800 IN A 127.0.0.2 異常的結果

;; Query time: 309 msec
;; SERVER: 139.175.55.244#53(139.175.55.244)
;; WHEN: Wed Mar 26 16:03:30 2008
;; MSG SIZE rcvd: 57

測試二:
#dig a.b.c.d.relays.ordb.org

; <<>> DiG 9.3.3 <<>> a.b.c.d.relays.ordb.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25413
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;a.b.c.d.relays.ordb.org. IN A

;; ANSWER SECTION:
a.b.c.d.relays.ordb.org. 604800 IN A 127.0.0.2 異常的結果

;; Query time: 926 msec
;; SERVER: 139.175.55.244#53(139.175.55.244)
;; WHEN: Wed Mar 26 16:04:15 2008
;; MSG SIZE rcvd: 57


測試三:
dig txt ordb.org

; <<>> DiG 9.3.3 <<>> txt ordb.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22109
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ordb.org. IN TXT

;; ANSWER SECTION:
ordb.org. 604800 IN TXT "ordb.org was shut down on December 18, 2006. Please remove from your mailserver." <==其說明

;; Query time: 309 msec
;; SERVER: 139.175.55.244#53(139.175.55.244)
;; WHEN: Fri Mar 28 09:30:59 2008
;; MSG SIZE rcvd: 119

Posted in 標籤: | 0 意見

ORDB 已關站許久,請記得更新~

近日有人反應主機退信,被ORDB列入RBL,想說這網站不是已提止提供服務,為了証明此點,上網收集一下其網站先前的公告,並請對方主機管理者,請更新一下RBL List。

官方公告在此:
http://www.ordb.org/news/?id=38

由於 2006年12月31日後,它整個網站就會關閉,所以,我把公告的內容複製下來。

公告內容:
We regret to inform you that ORDB.org, at the ripe age of five and a
half, is shutting down. It's been a case of a long goodbye as very
little work has gone into maintaining ORDB for a while. Our volunteer
staff has been pre-occupied with other aspects of their lives. In
addition, the general consensus within the team is that open relay RBLs
are no longer the most effective way of preventing spam from entering
your network as spammers have changed tactics in recent years, as have
the anti-spam community.

We encourage system owners to remove ORDB checks from their mailers
immediately and start investigating alternative methods of spam
filtering. We recommend a combination involving greylisting and
content-based analysis (such as the dspam project, bmf or Spam Assassin).

DNS and the mailing lists will vanish today, December 18, 2006.

This website will vanish by December 31, 2006.

資料引用:還好有人留下紀錄

Posted in 標籤: | 0 意見

FreeBSD CARP ( Common Access Redundancy Protocol ) 設定與測試方法

測試前說明:
使用三台主機作測試,兩台Server,一台Client,
dk.oio.idv.tw 192.168.78.1
dk1.oio.idv.tw 192.168.78.2
dk2.oio.idv.tw 192.168.78.3
dk3.oio.idv.tw client

1、先將兩台Server,於kernel中,增加一個device carp,再重新編譯kernel。
device carp

2、於dk1、dk2,執行以下步驟:
a、device使用carp portocol

#sysctl net.inet.carp.allow=1
執行後:
net.inet.carp.allow: 0 -> 1

b、建立一個carp5的interface

#ifconfig carp5 create
執行後:
carp5: flags=8 mtu 1500

c、設定carp5 VHID IP Netmask,** VHID是重點:這會影嚮carp5 mac address

#ifconfig carp5 vhid 5 192.168.78.1 255.255.240.0

dk1 查視 carp5 interface
#ifconfig carp5
carp5: flags=49 mtu 1500
inet 192.168.78.1 netmask 0xffffff00
carp: MASTER vhid 5 advbase 1 advskew 0

/var/log/message
dk1 kernel: em0: promiscuous mode enabled

dk2 查視 carp5 interface
#ifconfig carp5
carp5: flags=49 mtu 1500
inet 192.168.78.1 netmask 0xffffff00
carp: BACKUP vhid 5 advbase 1 advskew 0

/var/log/message
dk2 kernel: em0: promiscuous mode enabled

dk3 client ping dk.oio.idv.tw 測試封包不中斷。

dk1
#ifconfig carp5 down
carp5: flags=8 mtu 1500
inet 192.168.78.1 netmask 0xffffff00
carp: INIT vhid 5 advbase 1 advskew 0

dk2
1、/var/log/message 會先收到
dk2 kernel: arp_rtrequest: bad gateway 192.168.78.241 (!AF_LINK)

2、會自動變成Master
carp5: flags=49 mtu 1500
inet 192.168.78.1 netmask 0xffffff00
carp: MASTER vhid 5 advbase 1 advskew 0

3、會自動接起 dk.oio.idv.tw,文件說1/256 sec

自動接下送往192.168.78.1封包
--- dk.oio.idv.tw ping statistics ---
509 packets transmitted, 509 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.100/0.222/0.424/0.051 ms

dk1 重啟後,並不會自動轉為Master
#ifconfig carp5 up

/var/log/message 會收到
dk1 kernel: arp_rtrequest: bad gateway 192.168.78.241 (!AF_LINK)

#ifconfig carp5
carp5: flags=49 mtu 1500
inet 192.168.78.241 netmask 0xffffff00
carp: BACKUP vhid 5 advbase 1 advskew 0


如希望dk1,恢復後可以自動轉為Master,則須在dk1、dk2執行以下指令
#sysctl net.inet.carp.preempt=1



引用資料:http://www.openbsd.org/faq/pf/carp.html#carpconfig

Posted in 標籤: | 0 意見

Chris backpacker's travel in Australia

無意間看到此人的blog,看到我一直想去試試的澳洲,
因為我不年輕了,所以不太可能在那進修,
所以也許三個月也能滿足我。

看了他的blog & photo,宛如自已也一起去了,
有如自已也親身體驗過。

希望我這樣的勇氣,完成這樣的壯遊。




Photo from:Chirs Blog

Posted in 標籤: | 0 意見

傅說中的關東煮 太鼓判

今天晚上逛完leeco後,
突然想去找傅說中關東煮,
一直在成功路與金湖路口繞來繞去,
天氣又很冷找了半天一直都找不到,
在金湖路上一直騎到準備打算回家時,
才找到傅說中 關東煮,
價可 味可 湯優 好停車,
而且這條路上有酒測,
所以開車的不能小喝一下溫清酒。
















Posted in 標籤: | 0 意見

Joanna Wang 王若琳的小型音樂會

今晚參加了王若琳 Joanna Wang 小型音樂會,
真不錯,很久沒有這樣的感覺,
現場的感覺很好。

可惜地板太冷了。坐的腳快麻了。






Posted in 標籤: | 0 意見

Microsoft bids $45 billion for Yahoo , 微軟併購雅虎

剛看新聞的消息,太震撼了,
不過應該會對經濟得到一個有利的消息。

CNN news:Microsoft bids $45 billion for Yahoo

微軟併購雅虎公司

微軟今天宣布,準備以每股三十一美元的價格收購Yahoo股票,這次併購金額預計高達446億美元,相當於一兆四千三百五十億台幣。

Posted in 標籤: | 0 意見

grep & 統計 & 排列 常用指令

cat /var/log/maillog #讀取郵件紀錄

#以 relay= 為分隔點, 列出"relay="以後
| awk '{FS="relay=";print $2}'

#以 ] 為分隔點, 列出"relay="以前
| awk '{FS="]";print $1}'

#由0-9 & a-z 作排序
| sort

#統計相同資料的數量
| uniq -c

#將統計的數量遞減排序
| sort -r

grep 搜尋含有字串的該行資料
| grep "Sep 4"
| grep "unknown"

grep 搜尋不含"User unknown"的該行資料
| grep -v "User unknown"

bzcat 寫法如下 :
#bzcat maillog.* | awk '{FS="relay=";print $2}' | awk '{FS="]";print $1}' | sort | uniq -c | sort -r

引用:4wei-diary

Posted in 標籤: | 0 意見

Sendmail 指令發監控信

直接發信指令
/bin/df -h | /usr/bin/mail -s "server capacity" yourname@yourdomain

下完指令,可以直接看maillog是否有發信紀錄即可。
tail -f /var/log/maillog

Posted in 標籤: | 0 意見

Sendmail 設定 queue time & MaxRecipients

1、設定郵件在 queue 的時間
當郵件寄不到對方時,郵件會停留在 queue & 重複嘗試重送,sendmail 預設值是 5 天才會放棄重送並把郵件從 queue 中刪除。

將修改這個時間,vi /etc/mail/sendmail.cf,裡面有一行:

“O Timeout.queuereturn=5d”

5d 代表 5 天,我只想發送失敗的郵件,停留在 queue 裡面 24小時,可以改成:

“O Timeout.queuereturn=24h”

然後重新啟動 sendmail 即可。

2、限制每封郵件收件者數量
Sendmail 預設沒有限制每封郵件的收件者數量,要限制收件者人數,vi /etc/mail/sendmail.cf,裡面有一行是:

#O MaxRecipientsPerMessage=100

將第一個 “#” 刪除,然後重新啟動 sendmail 即可。

Posted in 標籤: | 0 意見

tar 用法

參數說明:
c, --create 建立新的備份檔
f, --file 指定檔案
r, --append 新增檔案至備份檔結尾
--delete 將 .tar 中的某個檔案刪除
t, --list 列出備份檔內檔案清單
u, --update 僅置換檔案更新部分
v, --verbose 顯示指定執行過程
z, --gzip, --unzip 透過 gzip 處理備份檔
x, --extract 還原備份檔
-C 指定還原路徑

指令範例:
1.tar cfv back.tar /backup
2.tar czf back.tar.gz /backup
3.tar xf back.tar
4.tar xzf back.tar
5.tar tf back.tar
6.tar tfv back.tar
7.tar --delete -vf back.tar backup/srm.conf
8.tar xf back.tar -C /root

Posted in 標籤: | 0 意見

Disable Linux IPv6

大部份現有的系統安裝完,IPv6 (Internet Protocol Version 6) 預設是開啟的,但實際上不需要 IPv6 支援,關閉 IPv6 可用方法:

Debian / Ubuntu
1. 開啟 /etc/modprobe.d/aliases
2. 裡面有一行是 "alias net-pf-10 ipv6"
3. 將以上一行用以下兩行取代:
alias net-pf-10 off
alias ipv6 off

Red Hat
1. 開啟 /etc/modprobe.conf
2. 加入這一行:
alias net-pf-10 off

Posted in 標籤: | 0 意見

The 10 Worst Spam Service ISPs

Data from Spamhaus As at 10 January 2008

Posted in 標籤: | 0 意見

Hinet 被列入 Spamhaus blocklist

hinet mail server 168.95.4.0/24 被列入 spamhaus.org blocklist

發生時間:2008-01-06 02:06 ~ 2008-01-07 20:37

2008-01-06 02:06 H=ms10.hinet.net [168.95.4.100] http://www.spamhaus.org/SBL/sbl.lasso?query=SBL44995
2008-01-06 02:08 H=ms1.hinet.net [168.95.4.10] http://www.spamhaus.org/SBL/sbl.lasso?query=SBL44995
2008-01-06 02:11 H=msr1.hinet.net [168.95.4.101] http://www.spamhaus.org/SBL/sbl.lasso?query=SBL44995

2008-01-07 20:34 H=msr39.hinet.net [168.95.4.139] http://www.spamhaus.org/SBL/sbl.lasso?query=SBL44995
2008-01-07 20:36 H=msr18.hinet.net [168.95.4.118] http://www.spamhaus.org/SBL/sbl.lasso?query=SBL44995
2008-01-07 20:37 H=msr22.hinet.net [168.95.4.122] http://www.spamhaus.org/SBL/sbl.lasso?query=SBL44995


退信訊息:有誤導寄件者

The original message was received at Mon, 7 Jan 2008 12:00 +0800 (CST)
from x-x-x-x.HINET-IP.hinet.net [x.x.x.x]

----- The following addresses had permanent fatal errors -----


----- Transcript of session follows -----
... while talking to xxx.com.tw.:
>>> RCPT To:xxx@xxx.com.tw

<<< 550-Message rejected because (msr25.hinet.net) [168.95.4.125] is
<<< 550 blacklisted at zen.spamhaus.org see http://www.spamhaus.org/SBL/sbl.lasso?query=SBL44995
550 xxx@xxx.com.tw... User unknown

當時我用其他的帳號測試寄到我的帳號,都可以正常收到,
而且我自已的主機我管的,怎可能帳號不存在,所以這退信很可疑。

我想應該是在主機收到這類退信時,修改了其body,
避免被發現被Spamhaus列入blocklist。

Posted in 標籤: | 0 意見