11/27/2012

Special links

http://beradrian.wordpress.com/2010/01/15/special-links/

10/08/2012

fail2ban - unban


iptables -D fail2ban-ssh -s xxx.xxx.xxx.xxx -j DROP

9/03/2012

การคำนวณ

การคำนวณเปอร์เซนต์

จำนวน/ผลรวม = เปอร์เซ็นต์

การคำนวณหาจำนวน กรณีทราบผลรวมและเปอร์เซนต์

ตัวอย่าง
ถ้าคุณซื้อคอมพิวเตอร์ราคา $800 และอัตราภาษีขายคือ 8.9% คุณจะต้องจ่ายค่าภาษีเป็นจำนวนเงินเท่าไร ในตัวอย่างนี้ คุณต้องการค้นหาว่า 8.9% ของ 800 เท่ากับไร

วิธี
800 คูณด้วย 0.089 (8.9/100) เพื่อหาจำนวนภาษีขายที่จะต้องชำระ ($71.20)

(8.9/100) * 800 = 71.20


การคำนวณหาเปอร์เซ็นต์ กรณีทราบผลรวมและจำนวน


ตัวอย่าง
ถ้าคุณตอบถูก 42 คะแนน จากคะแนนเต็ม 50 คะแนน คำตอบที่ถูกต้องคิดเป็นกี่เปอร์เซ็นต์
เมื่อต้องการคำนวณผลลัพธ์นี้ ให้ตั้งค่าแผ่นงานตามที่แสดงต่อไปนี้ หรือคัดลอกตัวอย่างลงในแผ่นงานเปล่า

วิธี
42 หารด้วย 50 เพื่อหาเปอร์เซ็นต์ของคำตอบที่ถูกต้อง (0.84 หรือ 84%)


การคำนวณหาผลรวม กรณีทราบจำนวนและเปอร์เซ็นต์

ตัวอย่าง
เสื้อเชิ้ตตัวหนึ่งราคา $15 ซึ่งเป็นราคาขายที่หักส่วนลด 25% จากราคาเต็ม เสื้อเชิ้ตตัวนี้มีราคาเต็มเท่าไร ในตัวอย่างนี้ คุณต้องการค้นหาว่า 75% ของจำนวนเท่าไรจะเท่ากับ

วิธี
หาร 15 ด้วย 0.75 เพื่อหาราคาเดิม (20)

การคำนวณผลต่างระหว่างตัวเลขสองจำนวนเป็นเปอร์เซ็นต์

ตัวอย่าง
คุณมีกำไร $2,342 ในเดือนพฤศจิกายน และ $2,500 ในเดือนธันวาคม กำไรของสองเดือนนี้เปลี่ยนแปลงกี่เปอร์เซ็นต์ ให้ใช้ฟังก์ชัน ABS รวมทั้งตัวดำเนินการลบ (-) และหาร (/) ในการคำนวณนี้

วิธี
ส่วนต่างระหว่างจำนวนที่หนึ่งและจำนวนที่สองหารด้วยค่าสัมบูรณ์ของจำนวนที่หนึ่ง ทำให้ได้เปอร์เซ็นต์ความเปลี่ยนแปลง (0.06746 หรือ 6.75%)



ค่าสัมบูรณ์์
ค่าสัมบูรณ์ของจำนวนใด ๆ คือ ระยะทางที่จำนวนนั้น ๆ อยู่ห่างจากศูนย์ (0) บนเส้นจำนวนไม่ว่าจะอยู่ทางซ้าย หรือทางขวาของศูนย์ ซึ่งค่าสัมบูรณ์ของจำนวนใด ๆ จะมีค่าเป็นบวกเสมอ กล่าวคือ

 1 มีระยะห่างจาก 0 เท่ากับ 1 หน่วย นั้นคือ ค่าสัมบูรณ์ของ 1 เท่ากับ 1

-1 มีระยะห่างจาก 0 เท่ากับ 1 หน่วย นั้นคือ ค่าสัมบูรณ์ของ -1 เท่ากับ 1


เราจะใช้สัญลักษณ์ที่ใช้แทนค่าสัมบูรณ์ คือ | | เช่น 
| -4 | คือ ค่าสัมบูรณ์ของ -4 คือ 4
| 6 | คือ ค่าสัมบูรณ์ของ 6 คือ 6







7/27/2012

SuPHP

SuPHP Part 2 – Fix Ownership Issues




http://djlab.com/2009/06/cpanel-suphp-chmod-all-files-644-and-all-folders-755/

http://stackoverflow.com/questions/3740152/how-to-set-chmod-for-a-folder-and-all-of-its-subfolders-and-files-in-linux-ubunt

SuPHP – chmod All Files 644, All folders 755

When switching from DSO to SUPHP in cpanel (a must for anyone who takes security seriously on a public webserver), one must pay careful attention to the insecure permissions of user’s public_html folders.  The following commands will look in every user’s html folder and make the appropriate CHMOD to allow php to properly execute under SUPHP.  Don’t forget to also check for files owned by ‘nobody’ or ‘root’ — they will also fail with a 500 error.



find /home/*/public_html/ -type d -print0 | xargs -0 chmod 0755 # For directories
find /home/*/public_html/ -type f -not -name "*.pl" -not -name "*.cgi" -not -name "*.sh" -print0 | xargs -0 chmod 0644 # For files
find /home/*/public_html/ -type f -name "*.cgi" -print0 -o -name "*.pl" -print0 -o -name "*.sh" -print0 | xargs -0 chmod 0755 # For CGI/Scripts

How to ..








from : http://djlab.com/2009/06/cpanel-suphp-chmod-all-files-644-and-all-folders-755/











7/19/2012

Mobile Network Code

Mobile Network Code (MNC) is used in combination with a Mobile Country Code (MCC) (also known as a "MCC / MNC tuple") to uniquely identify a mobile phone operator/carrier using the GSM/LTECDMAiDENTETRA and UMTS public land mobile networks and some satellite mobile networks. The ITU-T Recommendation E.212 defines mobile country codes.

more : http://en.wikipedia.org/wiki/Mobile_Network_Code

Mobile Network Code

Mobile Network Code (MNC) is used in combination with a Mobile Country Code (MCC) (also known as a "MCC / MNC tuple") to uniquely identify a mobile phone operator/carrier using the GSM/LTECDMAiDENTETRA and UMTS public land mobile networks and some satellite mobile networks. The ITU-T Recommendation E.212 defines mobile country codes.

more : http://en.wikipedia.org/wiki/Mobile_Network_Code

5/29/2012

Apache mod rewrite

RewriteRule ^old\.html$ new.html

Command Flag
[R] Redirect you can add an =301 or =302 to change the type.
[F] Forces the url to be forbidden. 403 header
[G] Forces the url to be gone 401 header
[L] Last rule. (You should use this on all your rules that don’t link together)
[N] Next round. Rerun the rules again from the start
[C] Chains a rewrite rule together with the next rule.
[T] use T=MIME-type to force the file to be a mime type
[NS] Use if no sub request is requested
[NC] Makes the rule case INsensitive
[QSA] Query String Append use to add to an existing query string
[NE] Turns of normal escapes that are default in the rewriterule
[PT] Pass through to the handler (together with mod alias)
Skip the next rule S=3 skips the next 3 rules
[E] E=var sets an enviromental variable that can be called by other rules

5/04/2012

HTML5 ROCKS:A NON-RESPONSIVE APPROACH TO BUILDING CROSS-DEVICE WEBAPPS

http://www.html5rocks.com/en/mobile/cross-device/

4/02/2012

Centurion : CMS Open source

Centurion is an open source application which is both a fully-functional CMS and a base/framework for building project-specific content management/admin systems.

2/18/2012

Finding zombie processes

#ps -el | grep 'Z'

S : sleeping
R : running
D : waiting (over het algemeeen voor IO)
T : gestopt (suspended) of getrasseerd
Z : zombie (defunct)


Or

# ps aux | grep " Z. "




Or


#alias Zombie='ps ex|awk "\$3==\"Z\"{print \$1, \$5}"'


find more from : http://www.debian-administration.org/articles/261