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 意見