แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - golfreeze

Pages: 1 ... 134 135 [136] 137 138 ... 146
2026
##update kernel from freebsd 7.0 to freebsd 7.1

ns1# freebsd-update update -r 7.1-RELEASE

ns1# freebsd-update upgrade -r 7.1-RELEASE

after finish please reboot

ns1#init 6
run install to finish
ns1# freebsd-update install

2027
สำหรับการ config ตัว Pen ที่ใช้งานเป็น Load balance ให้พวก protocol ต่างๆ เช่น http , smtp , pop ,
imap เราต้องเปิด option "ipfilter" ใน kernel ไว้ด้วยน่ะครับ

1.cd /usr/src/sys/i386/conf
2.cp GENERIC PENBSD

options IPFILTER
options IPFILTER_LOG

หลังจากเสร็จแล้ว

1.config PENBSD
2.cd /usr/src
3.make kernel KERNCONF=PENBSD
4.make installkernel KERNCONF=PENBSD

2028
####Compile Kernel ของ FreeBSD

#ipfw show
ipfw: getsockopt(IP_FW_GET): Protocol not available

fix by แก้โดย


วันนี้มาลอง Compile Kernel ของ FreeBSD 7.0 กัน ตามนี้เลย

1.cd /usr/src/sys/i386/conf
2.cp GENERIC LAO


## edit LAO ##
เพิ่ม

options IPFIREWALL
options IPDIVERT
options IPFIREWALL_DEFAULT_TO_ACCEPT
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPFIREWALL_FORWARD
options IPSTEALTH
options ACCEPT_FILTER_HTTP
options ACCEPT_FILTER_DATA

หลังจากเสร็จแล้ว

1.config LAO
2.cd /usr/src
3.make kernel KERNCONF=LAO
4.make installkernel KERNCONF=LAO

หลังจากนั้น แก้ /etc/rc.conf เพิ่ม

firewall_enable="YES"

firewall_type="/etc/ipfw.rules"
;
filewall_logging="YES"


แล้วอย่าลืมสร้าง ipfw.rules ล่ะครับ
หลังจากนั้นก็ Reboot เป็นอันเสร็จเรียบร้อย

2029
Mail issue , problem , configuration / postfix vda patch ลงไปเพื่อ ??
« on: มกราคม 23, 2011, 10:26:30 PM »
ตัว vda ลงไปเพื่อ แก้รักษาโรค อะไรอ่านได้ครับ อิอิ

เป็นไทย : เวลาต้องการให้ user มี quota mailbox ของแต่ละ user ต้องลง vda patch เข้าไปช่วยกันครับผม
สำหรับการ patch ต้องเชค version ของ postfix ด้วยนะครับ
หลังจาก check version postfix เสร็จ ต้องทำการ check version ของ database ด้วยว่าใช้ตัวไหน เช่นใช้ openldap

ต้องลง vda ดังนี้
postfix-ldap_2.5.5-1.1-vda0_amd64.deb
postfix_2.5.5-1.1-vda0_amd64.deb


* Mailbox / Maildir size limit, known also as "soft quota", to avoid user take
all you disk space
* Customizable "limit" message when the soft quota limit is reached. NOTE: message
is sent to senders, but NOT to the owner of the mailbox.
* Limit only 'INBOX', because some people use IMAP and don't want the same limit in
IMAP folder that are differents from INBOX.
* Support for 'Courier' style Maildir, usefull for people that use courier as pop3/imap
server and to get fast soft quota summary. Note that it is also compatible with qmail maildir per
default.
* Supports for Courier 'maildirsize' file in Maildir folder that is used to read quotas
quickly. Note that this option is not actived per default and can be dangerous on some NFS client
implementation (like for example Solaris that cache some filesystem operations).
* Customisable suffix for Maildir support, when share same external dict between postfix and
pop3/imap server sometime "Maildir/" suffix is needed to avoid extra database handling
(eg LDAP, MySQL...).

download version ที่ใช้ได้ที่

http://vda.sourceforge.net/VDA/

apt-get build-dep postfix

cd /usr/src
apt-get source postfix

(Make sure you use the correct Postfix version in the following commands. I have Postfix 2.5.5
installed. You can find out your Postfix version by running

postconf -d | grep mail_version

The output should look like this:

server1:/usr/src# postconf -d | grep mail_version
mail_version = 2.5.5
milter_macro_v = $mail_name $mail_version
server1:/usr/src#

)

wget http://vda.sourceforge.net/VDA/postfix-2.5.5-vda-ng.patch.gz
gunzip postfix-2.5.5-vda-ng.patch.gz
cd postfix-2.5.5
patch -p1 < ../postfix-2.5.5-vda-ng.patch
dpkg-buildpackage

dpkg -i postfix_2.5.5-1.1_i386.deb postfix-mysql_2.5.5-1.1_i386.deb

ต้องดูให้ตรง กับ รุ่น os ที่ใช้ด้วยน่ะครับ ว่าเป็น 32 bit or 64 bit

2030
Mail issue , problem , configuration / Re: telnet localhost 110 and read email
« on: มกราคม 23, 2011, 10:26:08 PM »
#!/bin/bash

####++ReadME++####
# 1.Input username and password to userlist.txt #
# xxx@xxx.com password #
# 2.Run this script and see output in check_command.txt#
#


export PATH=/usr/sbin:/sbin:/usr/bin:/bin:/usr/local/bin
HOME=/home/golf/check_telnet
echo > ${HOME}/check_command.txt
#xxx=`( echo user ${usernamex}; sleep 1; echo pass ${passwordx}; sleep 1; echo quit)`

if [ -s ${HOME}/userlist.txt ]
then
xx=`less ${HOME}/userlist.txt | wc -l`
echo "All accounts = ${xx}"
while read usernamex passwordx
do
( echo user $usernamex; sleep 1; echo pass $passwordx; sleep 1; echo quit ) | telnet
localhost 110 >> ${HOME}/check_command.txt
echo "check $usernamex" >> ${HOME}/check_command.txt
echo "" >> ${HOME}/check_command.txt
echo "" >> ${HOME}/check_command.txt
done < ${HOME}/userlist.txt
echo /dev/null > ${HOME}/userlist.txt
else
exit
fi
#( echo $USER; sleep 1; echo $PASS; sleep 1; echo exit ) | telnet abc.com


zz=`less ${HOME}/check_command.txt | grep "+OK logged in." | wc -l`
yy=$xx-$zz
expr $yy

echo "==================================================="
echo "Wrong password = $yy accounts"
echo "==================================================="
echo "Run this command below"
echo "less ${HOME}/check_command.txt"

2031
pop00:/home/golf/___script___# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Hello there.
user golfs@example.com
+OK Password required.
pass PASSGU
+OK logged in.
LIST
+OK POP3 clients that break here, they violate STD53.
1 1326
2 467
.
RETR 1
+OK 1326 octets follow.
Return-Path: < postmaster@example.com>;
Delivered-To: golfs@example.com
Received: from ldap00.xx.com (ldap00.th.xx.com [10.17.200.22])
by pop00.xx.com (Postfix) with ESMTP id D4B374C8069
for < golfs@example.com>;; Tue, 10 Nov 2009 17:57:00 +0700 (ICT)
Received: from ldap00.xx.com (localhost [127.0.0.1])
by ldap00.xx.com (Postfix) with ESMTP id F14376DF824
for < golfs@example.com>;; Tue, 10 Nov 2009 17:57:00 +0700 (ICT)
Received: (from www@localhost)
by ldap00.xx.com (8.14.3/8.14.3/Submit) id nAAAv0NL085397;
Tue, 10 Nov 2009 17:57:00 +0700 (ICT)
(envelope-from postmaster@example.com)
Date: Tue, 10 Nov 2009 17:57:00 +0700 (ICT)
X-Authentication-Warning: ldap00.xx.com: www set sender to postmaster@example.com using -f
To: golfs@example.com
Subject: Welcome to xx mail service
Message-ID: < 1257850620883_36a8e9eb903b074f4fa6ca13c8395ab9@116.68.150.233>;
X-Mailer: Phamm
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: < postmaster@xx.com>;


Welcome to ddd service!
-----------------------------------------------

Dear users,

Thank you for using ddd service.

Please kindly consider change your password periodically for your security.



.
quit
+OK Bye-bye.

2032
####### Linux ##########
ต้องการที่จะเปลี่ยน ip ผ่าน command ครับ
#####check interface
#mii-tools

#route del default gw 10.x.x.x
#route add default gw 192.x.x.x

หรือต้องการให้ network บางตัว route ออกไปคนละ gateway ก็

#route add -net 10.3.0.0/16 gw 10.3.0.1


##############################

##### FREEBSD #######

ถ้าเป็น default gateway แอดด้วย command นี้
#route add default -gateway 10.x.x.x

แต่ถ้ามี subnet ของวงนั้นๆ ด้วย แอดด้วย command
route delete -net 0.0.0.0
route add -net 0.0.0.0 -gateway 192.x.x.x

#######################

2033
###setting dns load balance by round robin

Balancing Mail

The normal method of handling mail fail-over is using the 'preference' value which is
described in this note. However, using the MX record you can balance mail in two ways.

1. Define multiple MX records with the same priority e.g.

; zone file fragment
IN MX 10 mail.example.com.
IN MX 10 mail1.example.com.
IN MX 10 mail2.example.com.
....
mail IN A 192.168.0.4
mail1 IN A 192.168.0.5
mail2 IN A 192.168.0.6

The name server will deliver the MX records in the order defined by the rrset-order and the
receiving SMTP software will select one based on its algorithm. In some cases the SMTP alogithm may
work against the definition of the rrset-order statement. Current versions of sendmail (8.13.x),
Exim (4.44) and Postfix (2.1 or 2.2) all have definitive references to indicate they randomly select
equal preference servers (Postfix allows control of the behaviour with the smtp_randomize_addresses
parameter) and consequentially may use an address which the rrset-order has carefully tried to
change! qmail, courier-mta and Microsoft (Exchange and IIS SMTP) documentation does not appear to
have definitive references to indicate how they handle this case.
2. The alternate approach is to define multiple A records with the same name and multiple IP
addresses.

; zone file fragment
IN MX 10 mail.example.com.
....
mail IN A 192.168.0.4
IN A 192.168.0.5
IN A 192.168.0.6

In this case the load-balancing effect is under the control of BIND and the rrset-order
record. In order to avoid problems if the receiving mail system does reverse look-up as a spam check
then the PTR records for 192.168.0.4, 192.168.0.5, 192.168.0.6 above must all define to
mail.example.com.

In all the above cases each mail server must be capable of handling and synchronising the load for
all the mail boxes served by the domain, using some appropriate back-end to do this or by defining
all but one server to be a relay or forwarder.

Balancing Other Services

Assuming you want to load share your ftp or web services then you simply define multiple A records
with the same name and different IPs as in the example below.

; zone file fragment

ftp IN A 192.168.0.4
ftp IN A 192.168.0.5
ftp IN A 192.168.0.6
www IN A 192.168.0.7
www IN A 192.168.0.8

; or use this format which gives exactly the same result
ftp IN A 192.168.0.4
IN A 192.168.0.5
IN A 192.168.0.6
www IN A 192.168.0.7
IN A 192.168.0.8

The DNS will deliver all the IP addresses defined, the first IP address in the list will be in a
default round robin (controlled by the rrset-order 'named.conf' statement). The FTP and WEB
servers must all be exact replicas of each other in this scenario.

2034
ปกติการ Implement ระบบพวก mail ครับ function หนึ่งที่ไม่ควรข้ามไปคือการ เทส ban หรือ block เมลที่
spam และ virus วันนี้เลยมาแนะนำข้อความเพื่อเอาไปใช้ เทสครับ

##Virus email for testing
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

ใส่ข้อความใน message แล้วลองเทสดูได้เลยครับ

##spam email for testing block spam function
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

ลองนำไปใช้งานดูนะครับ

2035
ถ้าต้องการให้ account ใน example.com ส่งเข้าได้เฉพาะ domain

example.com
hotmail.com

ก็เพิ่มในไฟล์ local_domains เป็น
example.com OK
hotmail.com OK

postmap /etc/postfix/local_domains
/etc/init.d/postfix restart

2036
มีอีกกรณีครับ สมมติว่า ไม่การให้ user บาง คน รับเมลจาก ภายนอกได้

ก็สามารถ config ที่ไฟล์ main.cf ของ postfix ได้ตามนี้นะครับ

###Not allow to receive email from External domain
smtpd_recipient_restrictions =
check_recipient_access hash:/usr/local/etc/postfix/protected_destinations
smtpd_restriction_classes = insiders_only
insiders_only =
check_sender_access hash:/usr/local/etc/postfix/insiders, reject
##############################################

เพิ่มconfig file "insiders" ด้วย domain ที่จะทำการจำกัดสิทธิ์ดังนี้
example.com OK
เพิ่มconfig file "protected_destinations" ด้วย email account
ที่จะทำการจำกัดสิทธิ์ดังนี้
pass@example.com insiders_only

#postmap /usr/local/etc/postfix/insiders

#postmap /usr/local/etc/postfix/protected_destinations

#/usr/local/etc/rc.d/postfix restart

โดยที่ ถ้ามี account ss@hotmail.com คือปลายทางส่งเข้ามาถึง user "pass@example.com ที่อยู่ใน
list ปลายทางจะได้รับ error message ว่า
################################################
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

pass@example.com
SMTP error from remote mail server after RCPT TO:<pass@example.com>;:
host mx1.example.com [11.111.11.1]: 554 5.7.1 <pass@example.com>;:
Recipient address rejected: Access denied
#########################################

2037
### อ่านเพิ่มเติมได้ที่

http://www.postfix.org/RESTRICTION_CLASS_README.html#external

2038
    โจทย์ ใช้ MTA : Postfix
    OS : Freebsd
    ครับ

    จะ set ให้ บาง user= golf@example.com สามารถส่งเมลออกไป domain ข้างนอกไม่ได้ (Ex.
    golfreeze@hotmail.com , sss@yahoo.com )
    แต่ว่ามีให้ user= golfreeze@example.com ส่งได้ จะต้อง set อย่างไงบ้าง

    ก่อนอื่นต้องทำความเข้าใจก่อนว่า ไฟล์ไหนของ postfix ทำงานอย่างไร ทำงานอะไร

    ในกรณีนี้ เราต้องแก้ไขที่ไฟล์ main.cf ครับ

    เพิ่มในส่วนของ

    ###Allow some user sending email off-site #####
    smtpd_sender_restrictions=check_sender_access hash:/usr/local/etc/postfix/sender_restrictions
    smtpd_restriction_classes = local_only
    local_only =
    check_recipient_access hash:/usr/local/etc/postfix/local_domains, reject
    ##### End of Config ########

    แล้วทำการแอด mail account ที่จะใช้กับ policy check_sender_access นีัครับ

    #vi /usr/local/etc/postfix/sender_restrictions
    golf@example.com local_only

    #postmap /usr/local/etc/postfix/sender_restrictions

    #vi /usr/local/etc/postfix/local_domains
    เพิ่ม domain ที่จะให้บังคับใช้งาน policy นี้
    example.com OK
    #postmap /usr/local/etc/postfix/local_domains

    แล้วทำการ restart postfix 1 รอบ แล้วลองส่งดูครับ

    smtp00# telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 smtp.packetlove.com ESMTP Postfix
    helo e
    250 smtp.packetlove.com
    ehlo e
    250-smtp.packetlove.com
    250-PIPELINING
    250-SIZE 102400000
    250-ETRN
    250-AUTH LOGIN
    250-AUTH=LOGIN
    250-ENHANCEDSTATUSCODES
    250-8BITMIME
    250 DSN
    mail from: golf@example.com
    250 2.1.0 Ok
    rcpt to: golfreeze@hotmail.com
    554 5.7.1 < golf@example.com>;: Sender address rejected: Access denied
    quit
    221 2.0.0 Bye
    Connection closed by foreign host.

    ### ใช้งานได้แล้ว ###

m_golfreeze.gif golfreeze [2009-12-08 15:54:50] mail not show 116.68.146.74

1

Comment : 1

    ### อ่านเพิ่มเติมได้ที่

    http://www.postfix.org/RESTRICTION_CLASS_README.html#external

2040
GStreamer plugins to decode "MP3" files cannot be found

error ที่ขึ้นในโปรแกรม RhythmBox Music Player ใน Centos

เวลา import file พวก mp3 เข้าไปแล้วเล่นไม่ได้ครับ เป็นเพราะขาด package ตัวนี้ครับ

#yum -y install gstreamer-plugins-ugly

แล้วเปิด ปิด โปรแกรม 1 ครั้ง แล้วลอง import file เข้าไปดูครับ
ก็จะได้เล่นได้แล้วคราวนี้

Pages: 1 ... 134 135 [136] 137 138 ... 146