Jan 23

ช่วงนี้เจอ spammer พยายามส่งเมล์ผ่าน POST ของระบบบ่อยมาก จำเป็นต้องหาวิธีแก้ด่วย ซึ่งแรกๆ ก็ block ด้วย class ของ IP เช่น

deny from xx.0.0.0/8
deny from xx.xx.0.0/16

แต่ก็ยังไม่พอ พบว่าก็ยังมีเข้ามาได้อีก
ก็เลยใช้วิธีที่ block การใช้งาน เฉพาะ User-Agent นั้นๆ โดยเฉพาะ เพราะส่วนใหญ่จะมาคล้ายๆ กัน

SetEnvIfNoCase User-Agent "^xxxxxxxxx" banned
SetEnvIfNoCase User-Agent "xxxxxxxxx" banned

deny from env=banned

แต่ก่อนที่จะใช้ ข้างต้น ต้องสามารถใช้งาน setenvif ก่อนด้วยนะครับ

อ้างถึง

  • http://www.askapache.com/htaccess/fight-blog-spam-with-apache.html
  • http://www.webmasterworld.com/apache/3234357.htm
  • http://www.joomla-downloads.de/forum/profile/showposts/jackdaniels-1514/

written by Mr-San \\ tags: , , , ,

Jan 05

ไม่ได้เขียนบลอกมาซะนานๆๆๆ ก็พอดีมีคนถามเรื่องการทำ http ผ่าน ssh tunnel หรือเรียกง่ายๆ ตามภาษาผมว่า เล่น http แบบมุดท่อ (ชื่อดูดีนะ) แถมปลอดภัยจากการดักข้อมูลด้วย (sniffer) เพราะเป็นท่อแบบเข้ารหัส

บน M$ Windows

ต้องเตรียมเครื่องมือก่อนการใช้งานเล็กน้อย

  • Putty V.0.59 ขึ้นไปก็ดี
  • Firefox : Browser ที่อยากใช้งาน (ในที่นี้แนะนำ firefox มันสุดยอดครับท่าน)


บน Mac OS

อันนี้ง่ายมากเนื่องจาก มี Terminal ซึ่งทำงานได้ดีอยู่แล้ว รัน shell ต่างๆ ได้ก็ง่ายเลยครับ
ขั้นตอนการใช้งาน

  • เปิด Terminal ขึ้นมา แล้วพิมพ์คำสั่ง
    ssh -D port -f -C -q -N user@host
  • เปิด Firefox -> Preferences -> Advanced -> Network
  • กด Settings แล้ว เลือกเป็น Manual Proxy Configurations
  • เท่านี้ก็เสร็จสิ้น ลองใช้งานดูครับ อาจจะดู IP ที่ออกได้จาก http://myip.dk ซึ่งจะได้ IP ของเครื่องที่เรา ssh เข้าไปครับ

written by Mr-San

Sep 22

เจอปัญหาอีกแล้วครับ จากการติดตั้ง Ubuntu 7.04 Feisty Fawn เกิดจากระหว่าง Setup แล้วจะไปหยุด ตอน update-manager-core ที่ 85% นานมากๆๆ ทนไม่ไหว เลยไปหาๆ พบวิธีแก้ดังนี้

#login to tty2 (Ctrl-Alt-F2)
#kill pid id of apt-get update
ps awx|grep -i apt
kill (PID of apt)

หลังจากนั้น กลับมาที่ tty1 ตามปกติ (Ctrl-Alt-F1) ก็จะติดตั้งได้ต่อไป

written by Mr-San \\ tags: , , , ,

Feb 26

When you use hosts file, then need to clear cache dns on your computer.
on Windows
ipconfig /flushdns

on MacOS
lookupd -flushcache

written by Mr-San \\ tags: , , ,

Feb 21

in Mac, I don’t have wget but have curl, when I try to download some file it show content in file not output to file.

This command use for download file with curl
curl -C - -O http://www.mr-san.com/file.ext

It will save and resuming download.

written by Mr-San \\ tags: ,