เพิ่ม HDD ลูกใหม่ลงใน Linux

1.shutdown
2.เสียบ hd
3. เราเช็คก่อนว่า HDD ใหม่ของเรามันลูกใหนด้วย /sbin/fdisk -l
4.พิม fdisk /dev/xxx ตามแต่ harddisk
5.กด n (new) > p (primary) > 1 > enter ไปเรื่อยๆ มันก้อจะ แบ่ง hd 1 partition โดยเริ่มตั้งแต่ cy แรก ถึงสุดท้าย
6.กด w เสร็จละ
7.สั่ง mkfs -t ext3 /dev/xxx1 รอจนมันเสร็จ
8. สร้าง folder เปล่า mkdir /disk2
8.แก้ /etc/fstab ว่า
/dev/xxx1      /disk2            ext3    defaults        0      2

Creating a SSL certificate On Linux

cd /usr/local/etc/apache22
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
chmod 0400 /usr/local/etc/apache22/server.key
chmod 0400 /usr/local/etc/apache22/server.crt

cd /usr/local/etc/apache22
cp server.key server.key.orig
openssl rsa -in server.key.orig -out server.key

First day Freshy @ hatyai university

คงสงสัยกันพักใหญ่อะไรที่ม.หาดใหญ่  อิอิ กั๊กไว้ก่อนดีกว่า วันนี้ถึงขั้นต้องโดดงานทั้งที่เป๋นวันหยุด แต่ boss. ให้มาทำงานชด แต่มันไม่ว่างหนิให้ทำไงเนอะ ยังไงการศึกษาก็เป็นเรื่องดีหนิ  อิอิ

วิธีป้องกัน SQL injection ของ PHP ครับ

SQL Injection
คือ การที่ในเวปมีการรับข้อมูลจากผู้ใช้ แล้วนำไปใช้ในการสั่งให้ฐานข้อมูลทำงาน แล้ว ผู้ใช้พยายามที่จะหลอกโปรแกรมให้ทำงานนอกเหนือจากที่เราต้องการ หรือ หลอกให้โปรแกรมทำงานโดยผ่านการตรวจสอบเงื่อนไขบางอย่าง

Read the rest of this entry »

เปลี่ยน repository จากต่างประเทศมาที่ประเทศไทย สำหรับ centos 5 นะครับ

เปลี่ยน repository จากต่างประเทศมาที่ประเทศไทยของ ม.เกษตร ครับจะได้ yum กันได้รวดเร็ว สำหรับ centos 5 นะครับ

# cd /etc/yum.repos.d/
# mv CentOS-Base.repo CentOS-Base.repo.bak
# wget http://mirror1.ku.ac.th/yum-centos/5/CentOS-Base.repo
# yum -y update

แค่นี้เราก็จะได้ใช้งาน repository ของไทยแล้ว