- Apr 27 Sat 2013 23:35
-
[食記] 宜蘭羅東阿棟伯鍋貼水餃
- Apr 04 Thu 2013 21:46
-
[食記] 台東必吃阿鋐炸雞
- Mar 31 Sun 2013 22:04
-
[食記] 台東池上月台鐵路便當
- Mar 31 Sun 2013 13:01
-
FreeBSD安全性更新
[root@ms122] ~# freebsd-update fetch
Looking up update.tw.FreeBSD.org mirrors... none found.
Fetching metadata signature for 8.1-RELEASE from update.tw.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 25 patches.....10....20.. done.
Applying patches... done.
Fetching 8 files... done.
The following files will be added as part of updating to 8.1-RELEASE-p12:
/usr/src/lib/libc/gen/libc_dlopen.c
The following files will be updated as part of updating to 8.1-RELEASE-p12:
/boot/kernel/kernel
/boot/kernel/kernel.symbols
Looking up update.tw.FreeBSD.org mirrors... none found.
Fetching metadata signature for 8.1-RELEASE from update.tw.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 25 patches.....10....20.. done.
Applying patches... done.
Fetching 8 files... done.
The following files will be added as part of updating to 8.1-RELEASE-p12:
/usr/src/lib/libc/gen/libc_dlopen.c
The following files will be updated as part of updating to 8.1-RELEASE-p12:
/boot/kernel/kernel
/boot/kernel/kernel.symbols
- Mar 26 Tue 2013 10:58
-
測試 pop3s 連線
測試pop3功能的時候很習慣的輸入
telnet mail.xxx.oo 110
user XXX
pass *****
同樣的方法沒有辦法直接對pop3s 測試
但可以用下面的指令試試
openssl s_client -connect mail.xxx.oo:995
telnet mail.xxx.oo 110
user XXX
pass *****
同樣的方法沒有辦法直接對pop3s 測試
但可以用下面的指令試試
openssl s_client -connect mail.xxx.oo:995
- Mar 25 Mon 2013 15:03
-
使用SPF過濾釣魚郵件
這邊的SPF說的不是防曬係數
SPF (Sender Policy Framework ),是針對偽造寄件網域的解決方案
網域管理者可以在DNS上面設定該網域發信合法的ip有哪些
SPF格式
http://www.openspf.org/SPF_Record_Syntax
協助產生SPF紀錄
http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/default.aspx
[寄信端設定]
DNS設定該網域可以寄信的ip有哪些,
假設該網域僅允許兩個ip可以寄信 10.1.1.100及10.2.1.100
則新增一筆TXT紀錄
@ IN TXT "v=spf1 ip4:10.1.1.100 ip4:10.2.1.100 ?all"
我們找個DNS有設定spf的網域來看看會比較清楚
可以用dig指令查詢,除了以下ip,如果是帶cisco.com網域寄信的話,皆是偽造寄信網域的郵件
[root@mail] ~# dig -t txt cisco.com
; <<>> DiG 9.6.2-P2 <<>> -t txt cisco.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24710
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;cisco.com. IN TXT
;; ANSWER SECTION:
cisco.com. 86400 IN TXT "v=spf1 ip4:171.68.0.0/14 ip4:64.100.0.0/14 ip4:64.104.0.0/16 ip4:72.163.7.160/27 ip4:72.163.197.0/24 ip4:128.107.0.0/16 ip4:144.254.0.0/16 ip4:66.187.208.0/20 ip4:173.37.86.0/24 ip4:173.36.130.0/24 ip4:204.15.81.0/26 ip4:216.206.186.129/25" " ip4:208.90.57.0/26 mx:res.cisco.com ~all"
;; Query time: 229 msec
;; SERVER: 168.95.1.1#53(168.95.1.1)
;; WHEN: Sun Feb 10 14:38:36 2013
;; MSG SIZE rcvd: 321
實際在FreeBSD上測試看看
[收信端設定]
安裝postfix-policyd-spf-perl
# cd /usr/ports/mail/postfix-policyd-spf-perl
# make install
# vi /usr/local/etc/postfix/master.cf
spf_policy unix - n n - - spawn
user=nobody argv=/usr/bin/perl /usr/local/sbin/postfix-policyd-spf-perl
# vi /usr/local/etc/postfix/main.cf
smtpd_recipient_restrictions =
...
...
,check_policy_service unix:private/spf_policy
.....
.....
# /usr/local/etc/rc.d/postfix restart
[看一下收到信的maillog]
從合法ip寄信進來的header
Received-SPF: pass (for-example.com: 10.2.1.100 is authorized to use 'ethan@for-example.com' in 'mfrom' identity (mechanism 'ip4:10.2.1.100' matched)) receiver=mail.sunnybank.com.tw; identity=mailfrom; envelope-from="ethan@for-example.com"; helo=0; client-ip=10.2.1.100
從非法ip寄信進來的header
Received-SPF: neutral (for-example.com: Domain does not state whether sender is authorized to use 'ethan@for-example.com' in 'mfrom' identity (mechanism '?all' matched)) receiver=mail.sunnybank.com.tw; identity=mailfrom; envelope-from="ethan@for-example.com"; helo=0; client-ip=192.168.6.18
SPF (Sender Policy Framework ),是針對偽造寄件網域的解決方案
網域管理者可以在DNS上面設定該網域發信合法的ip有哪些
SPF格式
http://www.openspf.org/SPF_Record_Syntax
協助產生SPF紀錄
http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/default.aspx
[寄信端設定]
DNS設定該網域可以寄信的ip有哪些,
假設該網域僅允許兩個ip可以寄信 10.1.1.100及10.2.1.100
則新增一筆TXT紀錄
@ IN TXT "v=spf1 ip4:10.1.1.100 ip4:10.2.1.100 ?all"
我們找個DNS有設定spf的網域來看看會比較清楚
可以用dig指令查詢,除了以下ip,如果是帶cisco.com網域寄信的話,皆是偽造寄信網域的郵件
[root@mail] ~# dig -t txt cisco.com
; <<>> DiG 9.6.2-P2 <<>> -t txt cisco.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24710
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;cisco.com. IN TXT
;; ANSWER SECTION:
cisco.com. 86400 IN TXT "v=spf1 ip4:171.68.0.0/14 ip4:64.100.0.0/14 ip4:64.104.0.0/16 ip4:72.163.7.160/27 ip4:72.163.197.0/24 ip4:128.107.0.0/16 ip4:144.254.0.0/16 ip4:66.187.208.0/20 ip4:173.37.86.0/24 ip4:173.36.130.0/24 ip4:204.15.81.0/26 ip4:216.206.186.129/25" " ip4:208.90.57.0/26 mx:res.cisco.com ~all"
;; Query time: 229 msec
;; SERVER: 168.95.1.1#53(168.95.1.1)
;; WHEN: Sun Feb 10 14:38:36 2013
;; MSG SIZE rcvd: 321
實際在FreeBSD上測試看看
[收信端設定]
安裝postfix-policyd-spf-perl
# cd /usr/ports/mail/postfix-policyd-spf-perl
# make install
# vi /usr/local/etc/postfix/master.cf
spf_policy unix - n n - - spawn
user=nobody argv=/usr/bin/perl /usr/local/sbin/postfix-policyd-spf-perl
# vi /usr/local/etc/postfix/main.cf
smtpd_recipient_restrictions =
...
...
,check_policy_service unix:private/spf_policy
.....
.....
# /usr/local/etc/rc.d/postfix restart
[看一下收到信的maillog]
從合法ip寄信進來的header
Received-SPF: pass (for-example.com: 10.2.1.100 is authorized to use 'ethan@for-example.com' in 'mfrom' identity (mechanism 'ip4:10.2.1.100' matched)) receiver=mail.sunnybank.com.tw; identity=mailfrom; envelope-from="ethan@for-example.com"; helo=0; client-ip=10.2.1.100
從非法ip寄信進來的header
Received-SPF: neutral (for-example.com: Domain does not state whether sender is authorized to use 'ethan@for-example.com' in 'mfrom' identity (mechanism '?all' matched)) receiver=mail.sunnybank.com.tw; identity=mailfrom; envelope-from="ethan@for-example.com"; helo=0; client-ip=192.168.6.18
- Mar 08 Fri 2013 15:47
-
FreeBSD iscsi initiator設定
FreeBSD iscsi client 基本設定
1. 確認是否有載入iscsi_initiator
[root@mail] ~# kldstat
Id Refs Address Size Name
1 12 0xc0400000 bc2c48 kernel
2 1 0xc0fc3000 22c70 smbfs.ko
3 3 0xc0fe6000 4e98 libiconv.ko
4 3 0xc0feb000 2c20 libmchain.ko
5 1 0xc0fee000 1174c iscsi_initiator.ko
如果沒有的話可以手動載入
[root@mail] ~# kldload iscsi_initiator.ko
設定開機後自動載入iscsi_initiator.ko
[root@mail] ~# vi /boot/loader.conf
iscsi_initiator_load="YES"
2. 取得iscsi target資訊
[root@mail] ~# iscontrol -d -t 192.168.2.114
TargetName=iqn.2011-03.example.org.istgt:target01
TargetAddress=192.168.2.114:3260,1
3. 編輯 /etc/iscsi.conf
[root@mail] ~# vi /etc/iscsi.conf
iscsi_disk1 {
TargetName=iqn.2011-03.example.org.istgt:target01
TargetAddress=192.168.2.114:3260,1
}
4. 掛載iscsi硬碟
[root@mail] ~# /sbin/iscontrol -c /etc/iscsi.conf -n iscsi_disk1
5. dmesg 查看有沒有硬碟代號資訊
6. sysinstall 進行 Partition & Label 設定
1. 確認是否有載入iscsi_initiator
[root@mail] ~# kldstat
Id Refs Address Size Name
1 12 0xc0400000 bc2c48 kernel
2 1 0xc0fc3000 22c70 smbfs.ko
3 3 0xc0fe6000 4e98 libiconv.ko
4 3 0xc0feb000 2c20 libmchain.ko
5 1 0xc0fee000 1174c iscsi_initiator.ko
如果沒有的話可以手動載入
[root@mail] ~# kldload iscsi_initiator.ko
設定開機後自動載入iscsi_initiator.ko
[root@mail] ~# vi /boot/loader.conf
iscsi_initiator_load="YES"
2. 取得iscsi target資訊
[root@mail] ~# iscontrol -d -t 192.168.2.114
TargetName=iqn.2011-03.example.org.istgt:target01
TargetAddress=192.168.2.114:3260,1
3. 編輯 /etc/iscsi.conf
[root@mail] ~# vi /etc/iscsi.conf
iscsi_disk1 {
TargetName=iqn.2011-03.example.org.istgt:target01
TargetAddress=192.168.2.114:3260,1
}
4. 掛載iscsi硬碟
[root@mail] ~# /sbin/iscontrol -c /etc/iscsi.conf -n iscsi_disk1
5. dmesg 查看有沒有硬碟代號資訊
6. sysinstall 進行 Partition & Label 設定
- Mar 01 Fri 2013 17:31
-
認購愛T贈原燒五折優惠券

認購愛T贈原燒五折優惠券
一人衣愛助兒盟
彩繪夢想點亮愛
孩子的學習工具、吃飽、穿暖應該是基本的生活需求,但弱勢兒童不只擔心無法上學,連基本的溫飽都成問題,令人心疼不已。為籌募弱勢家庭兒童脫困基金,守護弱勢孩子的小小幸福,兒盟與原燒於2009年開始共同發起的「愛T恤」一人衣愛助兒盟公益活動,4年以來已經募得近四千萬元的捐款,扣除衣服成本已全數使用協助弱勢家庭兒童的生活、醫療及學習費用。2013年邁入第五屆,兒盟X原燒X博客來再度攜手為弱勢兒童發聲,並邀請張榕容擔任愛心大使,號召大家一起來幫助孩子吃飽、穿暖、上學去,健康快樂的長大!
「愛T恤」義賣所得扣除成本後,將全數作為兒盟弱勢家庭兒童脫困基金,包括三部份:
完整的學習機會:提供孩子學校學費、書籍及參考書費用補助。
全面的生活照顧:提供孩子三餐居住、衣物及一般生活用品費用補助。
妥善的健康照顧:提供孩子就醫、健保費用補助。
★ 活動方式:
認購愛T恤一件,即贈原燒五折優惠券乙張 (限週一至週五平日使用,4/4、4/5視為假日不得使用,請及早預訂)
所得將用於兒盟「弱勢家庭兒童脫困基金」
博客來僅提供發票,無法開立捐款收據。如須捐款收據,請於兒盟愛孩子小舖購買。(http://shop.children.org.tw/)
- Feb 21 Thu 2013 17:25
-
find搭配xargs定時移除N天前的檔案
假設要移除七天前的檔案
find /workdir/logs -type f -mtime +7d | xargs rm -rf {}
定時執行的話,加入crontab即可
-mtime n[smhdw]
If no units are specified, this primary evaluates to true if the
difference between the file last modification time and the time
find was started, rounded up to the next full 24-hour period, is
n 24-hour periods.
If units are specified, this primary evaluates to true if the
difference between the file last modification time and the time
find was started is exactly n units. Please refer to the -atime
primary description for information on supported time units.
find /workdir/logs -type f -mtime +7d | xargs rm -rf {}
定時執行的話,加入crontab即可
-mtime n[smhdw]
If no units are specified, this primary evaluates to true if the
difference between the file last modification time and the time
find was started, rounded up to the next full 24-hour period, is
n 24-hour periods.
If units are specified, this primary evaluates to true if the
difference between the file last modification time and the time
find was started is exactly n units. Please refer to the -atime
primary description for information on supported time units.
- Feb 20 Wed 2013 19:33
-
星巴克買一送一
補班好友分享日
2月23日 星巴克陪您一起享受補班好心情
2013/2/23早上11點~晚上8點止,點購兩杯相同口味/容量/冰熱皆一致的飲料,其中一杯由星巴克招待您。
注意事項:
1. 折扣、優惠與行銷活動恕不合併使用。
2. 每人每次至多限購兩杯(即買二送二),兩杯飲料限現場領取。
3. 罐裝果汁、礦泉水及外送外賣服務不適用。
4. 銷售數量依各門市現場為準。
5. 二航管制區門市不適用此活動。
2月23日 星巴克陪您一起享受補班好心情
2013/2/23早上11點~晚上8點止,點購兩杯相同口味/容量/冰熱皆一致的飲料,其中一杯由星巴克招待您。
注意事項:
1. 折扣、優惠與行銷活動恕不合併使用。
2. 每人每次至多限購兩杯(即買二送二),兩杯飲料限現場領取。
3. 罐裝果汁、礦泉水及外送外賣服務不適用。
4. 銷售數量依各門市現場為準。
5. 二航管制區門市不適用此活動。
- Feb 17 Sun 2013 23:28
-
101年11月、12月 統一發票中獎號碼單
中華民國101年11月、12月 統一發票中獎號碼
特別獎
87165494
八位數號碼與上列號碼相同者獎金一千萬元
特獎
02818106
八位數號碼與上列號碼相同者獎金二百萬元
頭獎
59105 591
35149 832
40131 517
八位數號碼與上列號碼相同者獎金二十萬元
貳獎
末七碼與頭獎相同者各得獎金四萬元
參獎
末六碼與頭獎相同者各得獎金一萬元
肆獎
末五碼與頭獎相同者各得獎金四千元
伍獎
末四碼與頭獎相同者各得獎金一千元
陸獎
末三碼與頭獎相同者各得獎金二百元
增開陸獎
653、106
兌獎日期
2012/2/6 ~ 2013/5/5
八位數號碼與上列號碼相同者獎金一千萬元
八位數號碼與上列號碼相同者獎金二百萬元
35149 832
40131 517
八位數號碼與上列號碼相同者獎金二十萬元
- Feb 14 Thu 2013 00:40
-
星巴克買一送一
開工大吉 好事成雙
2月18日 星巴克與您一起迎接開工吉日
2013/2/18開店~晚上8點止,點購兩杯相同口味/容量/冰熱皆一致的飲料,其中一杯由星巴克招待您。
注意事項:
1. 折扣、優惠與行銷活動恕不合併使用。
2. 每人每次至多限購兩杯(即買二送二),兩杯飲料限現場領取。
3. 罐裝果汁、礦泉水及外送外賣服務不適用。
4. 銷售數量依各門市現場為準。
5. 二航管制區門市不適用此活動。
資料來源
http://www.starbucks.com.tw/stores/allevent/stores_allevent_show.jspx?n=93
2月18日 星巴克與您一起迎接開工吉日
2013/2/18開店~晚上8點止,點購兩杯相同口味/容量/冰熱皆一致的飲料,其中一杯由星巴克招待您。
注意事項:
1. 折扣、優惠與行銷活動恕不合併使用。
2. 每人每次至多限購兩杯(即買二送二),兩杯飲料限現場領取。
3. 罐裝果汁、礦泉水及外送外賣服務不適用。
4. 銷售數量依各門市現場為準。
5. 二航管制區門市不適用此活動。
資料來源
http://www.starbucks.com.tw/stores/allevent/stores_allevent_show.jspx?n=93


