Thursday, May 7th, 2009
1. vi /etc/inet/ntp.conf
#Created by bankster: 2009-05-07
#follow the last modified by Mr.Kitti :2008-06-17
#
# To start/stop/restart process :
# # svcadm disable ntp
# # svcadm enable ntp
# # svcadm restart ntp
driftfile /etc/inet/ntp.drift
logfile /var/log/xntpd.log
server clock.thaicert.org
server time1.nimt.or.th
server time2.nimt.or.th
server time3.nimt.or.th
# end of /etc/inet/ntp.conf
2.
# touch /etc/inet/ntp.drift
# touch /var/log/xntpd.log
3. svcadm enable ntp
Monday, April 27th, 2009
คำว่า secure by default คิดว่าหลายๆ คนในวงการ sysadmin ได้ยิน ได้เห็น แล้วคงต้องนึกถึง OS ที่ ถูกตั้งค่ามาให้มีความปลอดภัยแบบ out of the box โดยแทบจะไม่ต้อง tune กันเลยทีเดียว อย่างเช่น ระบบปฏิบัติการที่เป็นที่รู้จักกันดีอย่าง OpenBSD นอกจากนั้น ระบบปฏิบัติการใหม่ๆ อย่าง ubuntu และ windows vista ก็เข้าข่าย secure by default กับเค้าบ้างเหมือนกัน โดย ubuntu และ vista มุ่งเน้นไปที่ administrative priviledges ใน ubuntu จะไม่มี root account มากับการติดตั้งครั้งแรก โดยจะให้สิทธิ์ super user กับ user account แรกของระบบ [...]
Sunday, April 19th, 2009
solution 1. edit /etc/passwd
or
solution 2. usermod -s /bin/bash user
Tuesday, April 14th, 2009
Under Solaris, home directories are conventionally kept on one of two places, /home or /export/home. The /home directory is under control of the automounter and only the automounter can create directories there. The /export/home directory is where users home directories can be created by the system administrator.
To create an account for user [...]
Tuesday, April 7th, 2009
อยู่ดีดี wget ที่เคยใช้ download อะไรต่างๆนาๆ บน Linux/Unix Server ที่ไม่มี GUI
เกิดใช้ไม่ได้ขึ้นมาซะงั้น อาการก็เป็นแบบนี้อ่ะ
# wget http://awstats.sourceforge.net/awstats.ftp.urldetail.html
–04:17:37– http://awstats.sourceforge.net/awstats.ftp.urldetail.html
Resolving awstats.sourceforge.net… 216.34.181.96
Connecting to awstats.sourceforge.net|216.34.181.96|:80… connected.
HTTP request sent, awaiting response…
เหมือนจะ http request ผ่าน แต่ http response กลับไม่มาถึงซะงั้น
ก็เลย ลอง man wget ดูว่าัมันมี option อะไีรให้้ใช้บ้าง เพราะว่า ลอง download file เดียวกันจาก windows server
ที่อยู่บน subnet เดียวกันกับ เจ้า linux server ตัวนี้ มันดัน download ได้ เลยคิดว่าต้องเป็นที่ wget แน่ๆ
อ่าน [...]
Friday, April 3rd, 2009
วันนี้ก็ไป train proposal language และัก็ presentation ที่ MS มาแหละ
เจ้า MS ที่ไปนี่อยู่ที่ ชั้น 38 ตึก CRC All Season Place เพลินจิต
ก็ตื่นตั้งแต่ตีสาม อย่าเข้าใจผิดว่าอยากจะไปอะไรขนาดนั้น
จริงๆ มันชอบตื่นเวลานี้อ่ะ ตื่นมาแล้วก็เลยออกไปหาอะไรกิน 7-eleven แล้วก็นั่ง set server ไปเรื่อยๆ
จน หกโมงก็อาบน้ำ แต่งตัว ใส่ชุด Imagine Cup 2009 วันแรก วันนี้เลย 555
เจ็ดโมง 15 ก็ไปขึ้นรถตู้อนุสาวรีย์ กับพี่ลิง Bushido
ถึง อนุสาวรีย์ก็ไปขึ้น BTS ไปลงสถานีเพลินจิต
เหอๆๆ งงกะทางเข้าตึกมาก สุดท้ายก็เจอ
พอดีเห็นทีมจาก Mahidol เลยทำเนียน เดินตามเค้าไป ก๊าากก
lift ขาขึ้นนี่ไม่เท่าไหร่ แต่ขาลงนี่ เสียวมาก ==”
ไปถึงชั้น 38 พี่เค้าก็บอกว่า [...]
Thursday, April 2nd, 2009
1. timeout timewait parameter
Determines the time that must elapse before TCP/IP can release a closed connection and reuse its resources.
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
2. TCP_KEEPALIVE_INTERVAL
* Description: Determines the wait time between isAlive interval probes.
* How to view or set: Issue the following command to set the value:
echo 15 > /proc/sys/net/ipv4/tcp_keepalive_intvl
3. open file limit
ulimit -a
ulimit -n 8000
4.# [...]
Thursday, April 2nd, 2009
date mmddhhmmyyyy
date 040203052009
เพิ่มเติม sync เวลาอัตโนมัติด้วย ntpdate
yum install ntp
chkconfig –levels 235 ntpd on
ntpdate 0.pool.ntp.org
service ntpd start
Wednesday, April 1st, 2009
1. กู้คืน www.it.kmitl.net/forums
2. กู้คืน http://student.it.kmitl.net/bankster
3. เรียน summer วันแรก
4. วันเกิดผมเอง
5. centos 5.3 ออกวันนี้
post ไว้หน่อยกัน blog ร้าง
Sunday, March 8th, 2009
find_all : return multiple records
_by_* : replace * with your column
(false) : where complete like ‘false’
def incomplete
@tasks = Task.find_all_by_complete(false)
end
find : return single record
_by_* : replace * with your column
(false,:order => ‘created_at’ DESC) : where complete like ‘false’ and order by created_at descending
def last_incomplete
@task = Task.find_by_complete(false, :order => ‘created_at DESC’)
end