Monday, July 25, 2011

How to install CSF Firewall on Linux server?

Ưu điểm tích hợp với cpanel và directadmin ,webmin :


Installation
============

Installation is quite straightforward:
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgzcd csf 
sh install.sh

Next, test whether you have the required iptables modules:perl /etc/csf/csftest.pl


Don't worry if you cannot run all the features, so long as the script doesn't
report any FATAL errors

You should not run any other iptables firewall configuration script. For
example, if you previously used APF+BFD you can remove the combination (which
you will need to do if you have them installed otherwise they will conflict
horribly):

sh /etc/csf/remove_apf_bfd.sh

That's it. You can then configure csf and lfd by edit the files
directly in /etc/csf/*, or on cPanel servers use the WHM UI

csf installation for cPanel is preconfigured to work on a cPanel server with all
the standard cPanel ports open.

csf installation for DirectAdmin is preconfigured to work on a DirectAdmin
server with all the standard DirectAdmin ports open.

csf auto-configures your SSH port on installation where it's running on a non-
standard port.

csf auto-whitelists your connected IP address where possible on installation.

You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
servers have this disabled and you should check /etc/init.d/syslog and make
sure that any klogd lines are not commented out. If you change the file,
remember to restart syslog.

See the readme.txt file for more information.

Webmin Module Installation/Upgrade
==================================

To install or upgrade the csf webmin module:Install csf as above

Install the csf webmin module in: 
Webmin > Webmin Configuration > Webmin Modules >
From local file > /etc/csf/csfwebmin.tgz > Install Module


Uninstallation
==============
Removing csf and lfd is even more simple:

On cPanel servers:
cd /etc/csfsh uninstall.sh

On DirectAdmin servers:

cd /etc/csfsh uninstall.directadmin.sh

On generic linux servers:

cd /etc/csfsh uninstall.generic.sh

================

Nếu phát sinh lỗi
Checking for perl modulesfailed
You need to install the LWP perl module (libwww-perl) and then install csf 


Fix :
yum install perl-libwww-perl
Saturday, July 23, 2011

How to change instance name of SQL server



Bước 1: Kiểm tra tên Instance hiện tại:
sp_helpserver
select @@servername
Bước 2:
Xóa tên instance cũ:
sp_dropserver 'old_name'
go
Thêm tên instance mới;
sp_addserver 'new_name','local'go
Bước 3:  Khởi động lại MSSQL:

net stop mssqlserver
net start mssqlserver

    Bước 4: Kiểm tra lại
    sp_helpserver
    select @@servername

    Longman Preparation Series for the New TOEIC® Test: Advanced Course, 4th Edition


    Longman Preparation Series for the New TOEIC® Test: Advanced Course, Fourth Edition, gives students the skills, strategy, practice, and confidence they need to increase their scores on the new TOEIC® test. Ideal for a TOEIC® test preparation course or for self-study, the Advanced Course is intended for students who achieve TOEIC® test scores from 450 to 850.
    The Complete Audio Program is also available.
    The Advanced Course features:
    * New material that mirrors the format of the new TOEIC® test
    * Step-by step strategies and skills to improve performance on each section of the test
    * More than 1,000 practice items that reflect the format and content of the new test
    * An audio CD that includes the Listening Comprehension Review section from the book
    * An audioscript that includes all the material recorded for the complete audio program
    * Two TOEIC® -length review tests, one for Listening Comprehension and one for Reading
    * Two complete Practice Tests, with accompanying TOEIC® test-style answer sheets, for diagnosis or assessment and to prepare students for TOEIC® test conditions

    Download:


    1. Longman Preparation Series for the NEW TOEIC® test - Introductory Course - 4th edition

    Author : Lin Lougheed | ISBN-10 : -ISBN-13 :9780131993198 | 2007.02 | 5 CDs
    5 CDs(wma):

    1.http://www.mediafire.com/?2gyew4iyfmm
    2.http://www.mediafire.com/?ve0njhgmnn2
    3.http://www.mediafire.com/?2juytgtwr0b
    4.http://www.mediafire.com/?tmmymyqnnou
    5.http://www.mediafire.com/?kctdjoidizw

    2. Longman Preparation Series for the NEW TOEIC® test - Intemediate Course - 4th edition
    Author : Lin Lougheed | ISBN-10 : -ISBN-13 :9780131993143 | 2007.02 | 7 CDs

    7 CDs(wma):

    1. http://www.mediafire.com/?jthxxsdlno0
    2. http://www.mediafire.com/?bg2jdo4x5wd
    3. http://www.mediafire.com/?mizlbchdtmw
    4. http://www.mediafire.com/?gdoomd2mwgz
    5. http://www.mediafire.com/?otb2zxddu9z
    6. http://www.mediafire.com/?w9llpz4yvlz
    7. http://www.mediafire.com/?ftmmpwinfhg
    3. Longman Preparation Series for the NEW TOEIC® test – Advanced Course - 4th edition
    Author : Lin Lougheed | ISBN-10 : -ISBN-13 :9780131993105 | 2007.02 | 6 CDs


    CD menu:
    http://www.mediafire.com/?t3m0miymmvm
    6 CDs(mp3+ CD menu | Pdf): (2 part)
    http://www.mediafire.com/?qdjhmyazwnq 
    http://www.mediafire.com/?mg4tknmwyzy
    4. Longman Preparation Series for the NEW TOEIC® test – More Practice Tests Course - 4th edition
    Author : Lin Lougheed | ISBN-10 : 0131993062ISBN-13 :9780131993068 | 2007.02 | 4 CDs

    Book:
    http://www.mediafire.com/?tnzmk1mlmtj
    4 CDs:
    http://www.mediafire.com/?adydtqovwdj

    Thursday, July 21, 2011

    [Music] Santorini - Yanni


    Giờ mới biết tên bài này...Ôi Santorini ...!


    Wednesday, July 20, 2011

    Các Kiểu Backup Trong SQL Server


    Khái niệm backup (sao lưu) và restore (khôi phục) chắc hẳn đã quen thuộc đối với đa số chúng ta: bạn thường xuyên backup, ví dụ copy toàn bộ thư mục sang một thiết bị lưu trữ khác, để phòng khi gặp sự cố gây mất mát dữ liệu thì có thể copy ngược trở lại. Với database thì việc backup diễn ra có khác, khi hệ thống đang vận hành thì bạn không thể đơn giản copy các data file và log file vì chúng bị khóa hoàn toàn. Bạn phải dựa vào cơ chế backup của hệ QTCSDL. SQL Server cung cấp ba loại backup như sau:

    · Full backup: backup toàn bộ dữ liệu tại thời điểm đó. Đây có lẽ là loại được dùng thường xuyên nhất.
    · Differential backup: backup các trang dữ liệu mới được cập nhật kể từ lần full backup trước đó.
    · Transaction log backup: backup các log record hiện có trong log file, nghĩa là nó sao lưu các hành động (các thao tác xảy ra đối với database) chứ không sao lưu dữ liệu. Đồng thời nó cũng cắt bỏ (truncate) log file, loại bỏ các log record vừa được backup ra khỏi log file. Vì thế khi thấy log file tăng quá lớn, có nhiều khả năng là bạn chưa từng backup transaction log bao giờ.

    Một nguyên tắc chung để giảm bớt lượng dữ liệu mất mát khi có sự cố là tăng tần suất backup. Tuy nhiên với một database có dung lượng lớn và được cập nhật liên tục, thì việc thực hiện full backup với tần suất cao là không khả thi, vì nó dùng rất nhiều CPU và I/O. Nhờ có differential backup và transaction log backup, bạn có thể tạo lập các phương án sao lưu thích hợp, đảm bảo dữ liệu được backup thường xuyên hơn mà không chiếm nhiều tài nguyên của hệ thống. Ví dụ, bạn có thể thực hiện:

    · Full backup: một lần mỗi ngày vào 2h sáng.
    · Differential backup: vào các thời điểm 6h, 10h, 14h, 18h, 22h (5 lần/ngày).
    · Transaction log backup: 15 phút một lần vào các thời điểm 5', 20', 35', và 50' của mỗi giờ (4 lần/giờ). Chọn thời điểm như vậy để đảm bảo nó xảy ra sau differential backup.

    Lưu ý: Differential backup luôn sao lưu các trang đã thay đổi kể từ lần full backup trước (trong ví dụ trên là các trang đã thay đổi kể từ 2h), chứ không phải từ lần differential backup trước đó. Vì thế bản backup lúc 10h sẽ bao gồm các trang lưu trong bản lúc 6h, bản 14h gồm các trang đã có trong bản 10h... Transaction log backup thì ngược lại, chỉ sao lưu các log record kể từ lần transaction log backup trước đó.

    Giả sử database bị hỏng vào thời điểm 10h55', bạn cần khôi phục lại database theo trình tự sau:
    Bước 1. Khôi phục từ bản full backup gần với thời điểm có sự cố nhất (bản full backup lúc 2h).Bước 2. Khôi phục từ bản differential backup gần với thời điểm có sự cố nhất (bản lúc 10h).Bước 3. Khôi phục tất cả các transaction log backup kể từ sau lần diferential backup gần đây nhất, lần lượt theo trình tự thời gian. Đó là các bản tại các thời điểm 10h5', 1oh20', 10h35', và 10h50'.

    Bước 1 và 2 đưa database trở lại trạng thái giống như lúc 10h. Ở bước 3, với mỗi lần khôi phục transaction log thì các thao tác chứa trong đó được đem ra thực hiện lại trên database (gọi là log forwarding) và do đó đưa nó về trạng thái gần hơn thời điểm xảy ra sự cố. Như vậy sau khi hoàn tất khôi phục bốn bản transaction log backup thì database sẽ ở vào trạng thái giống như lúc 10h50'. Tuy nhiên các thay đổi diễn ra trong 5 phút sau đó (từ 10h50' đến 10h55') đã vĩnh viễn bị mất.

    Trong trường hợp may mắn hơn, khi sự cố xảy ra mà log file vẫn còn nguyên vẹn, bạn sẽ có cơ hội đưa database trở lại trạng thái ngay trước khi có sự cố, và do đó không có mất mát dữ liệu. Việc đầu tiên bạn cần làm là thực hiện ngay transaction log backup (nên nhớ, không được vội vàng khôi phục từ bản full backup). Sau đó các bước tiếp theo sẽ tương tự như trên:
    Bước 0. Sao lưu transaction log.Bước 1. Khôi phục từ full backup file của sáng sớm hôm đó.Bước 2. Khôi phục từ differential backup file lúc 10h.Bước 3. Khôi phục các transaction log backup file kể từ sau 10h, lần lượt theo trình tự thời gian: các bản backup vào lúc 10h5', 1oh20', 10h35', 10h50', và cuối cùng bản lúc 10h55' (vừa thực hiện ở bước 0).

    (Sưu tầm NhatNghe.com)
    Monday, July 11, 2011

    How to disable core dumps on Linux Servers

    Core dump is a memory or a storage dump which records the memory state of a computer program at specific instance when a program terminates abnormally. The abnormal termination of the program can be result of various reasons, however most OS are set to generate a core dump of memory state of the executable at time of failure.
    They can be used for debugging by admins and mostly by software developers for the related applications, however in a shared hosting environments they are rarely used and only thing they are doing is taking additional disk space, which is problematic both for accounts users and servers admins.
    It is recommended to disable them on such environments as they can always be enabled again if required for any specific debugging purpose.
    They can be disabled using the limits.conf file , which is the configuration file for the pam_limit module. Below command can be used to disable the core dumps.
    echo '* soft core 0' >> /etc/security/limits.conf
    or alternatively you can open the configuration file in some editor , I like vi :
    vi /etc/security/limits.conf
    And then add below line in the configuration file :
    * soft core 0
    This will make sure that the core dumps are disabled on the server and are no more generated for any crashed applications.
    You can use below command to find all the core files and delete them after examining :
    find /home/*/public_html -name core.[0-9]*
    There is a rare chance of some files with similar naming convention and being legitimate files, so it is recommended not to remove all core files automatically, rather you can view and check the results of above find command and then remove the core files manually.
    The search location above is for a typical cPanel hosting servers, you can modify it according to your hosting or server environment.
    Monday, July 4, 2011

    Nook color...02/07/2011

    Ước ao có "em" từ lâu, nhưng vì những lý do khác nhau nên việc "kết duyên" sẽ trì hoãn vô thời hạn. Nhưng cũng may "ở hiền thì gặp lành", cuối cùng cũng được nhìn...sờ vào em. Cảm ơn bạn Hiền mập đã giúp mình thực hiện được 1 phần ước mơ bấy lâu. Sau đây mạn phép được post mấy tấm hình về "em nó" cho bà con.