Jul 30
สำหรับคนที่ต้องลบไฟล์คราวละมากๆ และ มีปัญหาในการลบไฟล์ วันนี้จดเพื่อใช้งานง่ายๆ นะครับ
- เพื่อความปลอดภัยในการลบไฟล์ ที่อาจจะเจอช่องว่างในชื่อไฟล์ หรือพวกอักขระแปลกๆ ให้ใช้
find /directory -name *abc* -print0 |xargs -0 rm
-print0 ใส่เพื่อมองไฟล์ 1 ไฟล์ที่มีช่องว่างเป็น file เดียว เหมือนกับการใส่ Double Quote
-0 ก็ใช้คู่กับ xargs เืพื่อใช้อ่านข้อมูลจาก find -print0
- อีกกรณี กรณีที่ ผลลัพธ์ จาก find ไม่มีข้อมูลส่งมาให้ใช้
find /directory -name *abc* -print0 |xargs -0 -r rm
ก็ใส่ -r เพิ่มไปใน xargs เพื่อยกเลิกการทำงานกรณีไม่มี result จาก command แรก
Tagged with: linux
Oct 18
สำหรับคนที่ใช้ iptables นะครับ กรณีที่ยังไม่ได้ใช้ความสามารถ ของ recent module ใน iptables การป้องกันในอีกวิธีหนึ่งคือ นับจำนวน connection ในช่วงเวลาหนึ่งและ block ซึ่งก็เป็นวิธีที่ใช้การได้ดีในระดับหนึ่ง
ลองเอาไปใช้ดูนะครับวิธีการมีมากมาย ขึ้นอยู่กับความเหมาะสม และ การนำไปใช้นะครับ แต่ไม่ได้หมายความว่าจะดีที่สุด เราก้ต้องศึกษาหาข้อมูลกันต่อไป
iptables -A INPUT -m tcp -p tcp –dport 22 -m state –state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m tcp -p tcp -s My.local.Lan.0/24 –dport 22 -j ACCEPT
iptables -A INPUT -m tcp -p tcp -s Trusted.Internet.Machine –dport 22 -j ACCEPT
iptables -A INPUT -m tcp -p tcp –dport 22 -m state –state NEW -m limit –limit 1/min –limit-burst 2 -j ACCEPT
iptables -A INPUT -m tcp -p tcp –dport 22 -j LOG –log-prefix SSHBRUTE
iptables -A INPUT -m tcp -p tcp –dport 22 -j DROP
ความหมายคร่าวๆ
The effect is that the firewall will only admit two (for example) incoming new SSH connections per minute (it will reset the “burst” counter every minute).
อ้างอิงจาก http://lwn.net/Articles/192057/
Tagged with: firewall • iptables • linux
Sep 16
ในที่สุดก็ผ่านแล้ว LPIC-1 ส่งเมล์มาเมื่อเช้า ลุ้นแทบแย่ ว่าจะผ่านป่าว
Congratulations on completing your LPI Level 1 certification.
You have now joined the worldwide community of LPI graduates, and
you have the necessary pre-requisite to take the Level 2 exams.
LPI processes its certificates as soon as we are aware that exam-takers
have successfully completed all the necessary requirements. Most
candidates will receive their certification kits within 4-6 weeks from
the receipt of this email. If you do not receive your kit within six
weeks, please notify info@lpi.or.jp or info@lpi.org.
Thank-you for taking the LPI certification exams.
Please support LPI by participating in their mailing lists;
Certified ใบนี้ มีอายุตั้ง 10 ปี เย้ๆ เตรียมสอบ LPIC-2 ต่ออีกดีกว่า
ขอบคุณเพื่อนที่ไปเรียนด้วยกัน ขอบคุณพี่ๆ ที่ให้การสนับสนุน
ขอบคุณ Mr.Khairil, Ms.Myra สำหรับการ training
และต้องขอบคุณ ทีมงาน nectec ทุกท่านสำหรับอาหาร และการ training ครั้งนี้ครับ
Tagged with: certified • linux