Tìm kiếm Blog này

Thứ Ba, 7 tháng 12, 2010

Configuring Remote Administration and Feature Delegation in IIS 7

Introduction

IIS 7 (IIS 7.0 on Windows Server® 2008 or IIS 7.5 on Windows Server 2008 R2) provides administrators and developers with a new configuration system that is accessible, extensible and distributable. The new XML-based format allows for easy configuration of the modules and features available in IIS 7. It also enables granular control of the locations at which settings for individual features can be configured (for example, at the server level in the applicationHost.config file, or at a site or an application level in a Web.config file).
The new IIS 7 administration user interface (UI), IIS Manager, fully supports this new configuration system and adds additional features that provide a powerful and granular system for configuring the Web server. Two of these additional features are remote administration of servers, sites and applications, and support for user-based authentication and authorization.
This article explains how to enable remote connections, configure users and permissions, and delegate features to a site or application level. There are many scenarios where an IIS 7 server administrator might want to delegate administrative control of a certain feature or features to someone, or where the administrator might want to prevent others from viewing existing configuration. Take the following scenario, for example.
Edward is a server administrator on a computer that hosts several sites. The computer is part of a domain, and some of the site owners belong to the same domain. However, some of the site owners are outside of the domain, and Edward must create IIS Manager user accounts for them by creating a user name and password for each owner. After he has created the necessary IIS Manager user accounts, Edward sets up IIS Manager permissions for each site to specify which of the users are allowed to connect to a particular site. To do this, Edward opens the IIS Manager Permissions feature in each site and adds Windows users and IIS Manager users. This action does two things. First, it configures IIS 7 to allow a user to connect to the site when the user provides valid credentials. Second, it permits users who successfully connect to configure any delegated features in that site.
Edward also wants to delegate configuration of some features that he trusts to be configured by a site owner in his or her own site. This eliminates the need for a site owner to request that Edward configure features that vary by site, such as default documents. He decides to delegate configuration for the following features in all sites on his server: Default Documents, Directory Browsing, and Error Pages. In addition, Edward decides to delegate configuration of an additional feature, HTTP Redirect, to the site Contoso, because he knows that the site often needs to be redirected and trusts the site owners to configure those settings. He sets all other features to be Read Only so that site owners can see the settings but not configure them in their sites.
Julian and Catherine are site owners for the site Contoso on Edward's computer. Julian has a Windows user account, and Catherine has an IIS Manager user account for which Edward has provided her credentials. They can both open IIS Manager on their own computers, and connect to Contoso because Edward has permitted their accounts to configure the Contoso site. They each see all of the features that have been delegated to the site level. They can configure Default Documents, Directory Browsing, Error Pages, and HTTP Redirect because Edward delegated configuration of those settings to their site.

Prerequisites

The following items are required to be installed to complete the procedures in this article:
  • IIS 7.0 on Windows Server® 2008 or IIS 7.5 on Windows Server 2008 R2
  • IIS Manager

Configuring Remote Connections in IIS Manager

In IIS 7, IIS Manager makes it easy to perform remote administration. In addition to managing IIS 7 on the local computer, IIS Manager can manage remote servers, sites, and applications. The server administrator uses remote administration features to add IIS Manager user accounts and to allow those users to connect to any sites or applications for which they have permission.
Configuring remote administration involves enabling remote connections in IIS Manager and configuring the type of credentials required to connect to the server. Optionally, you can change default connection and logging settings, and add connection restrictions based on IP addresses or domain names.
Install the Management Service
The default IIS 7 installation options do not include the Management Service (also referred to as the Web Management Service (WMSVC)), which is required for remote administration. If you have not installed the Management Service, follow the steps in this procedure to install it.
To install the Management Service:
  1. Click Start, type Server Manager in the Search box, and press ENTER to open Server Manager.
  2. In the tree, under Roles, select Web Server (IIS).
  3. Click Add role services, and then select Management Service as shown in the image below.
  4. Click Next and follow the instructions to complete the installation.


Enable Remote Connections and Configure Identity Credentials

Enable remote connections so that Windows users and IIS Manager users (configured later in this article) can connect to this computer by using IIS Manager on their computers. By default, the Management Service allows connections only from users that have Windows credentials, but you can configure it to also allow connections from users with IIS Manager credentials. For the purposes of this article, configure the Management Service to allow both credential types as shown in the image below.
Note: The next section in this article explains IIS Manager credentials.    
To enable remote connections and allow connections from Windows users and IIS Manager users:
  1. In IIS Manager, in the Connections pane, click the server node in the tree.
  2. Double-click Management Service to open the Management Service feature page.

     4 .Select the Enable remote connections check-box.
     5. Under Identity Credentials, select Windows credentials or IIS Manager credentials.
     6. In the Actions pane, click Apply to save the changes, and then click Start to start the Management Service.

Additional Information
You do not have to enable remote connections to start the Management Service. If remote connections are disabled and the Management Service is started, you can connect to the Management Service from the local computer but not from a remote computer. If you cannot connect from a remote computer, make sure that remote connections are enabled.
You should check your firewall settings to ensure that connections are allowed to the Management Service. When the Management Service is installed, the setup process adds a firewall rule that allows traffic to the Management Service on port 8172 (the default port) which is on by default. If you ever change the port that the Management Service uses, you must add a new firewall rule to allow traffic to the Management Service on that port.

Configure Connection and Logging Settings for the Management Service

In addition to the Management Service settings that were configured in the above section, you can configure connection settings and specify where to log requests. The following table describes each field and its default setting. If you change any settings, make sure to click Apply in the Actions pane and then restart the Management Service.
PropertyDescriptionDefault Setting
IP AddressSpecifies the IP address to which the service is bound.All Unassigned
PortSpecifies the port number that the service uses for requests.8172
SSL CertificateSpecifies the SSL certificate used by the service. All requests to the service use HTTPS over the port specified in the Port field. This list contains the SSL certificates that are available to the server.
If you want to add additional SSL certificates, use the Server Certificates feature at the server level.
Self-signed certificate that is installed during setup
Log requests toSpecifies the path to the log files for the Management Service.%SystemDrive%\Inetpub\logs\WMSVC

Configure IP and Domain Restrictions for the Management Service

By default, the Management Service accepts all requests made to its configured IP address and port, and users are allowed to connect when they are added to IIS Manager (as explained in the next section). However, you can configure the service to deny access for unspecified requests and instead add specific allow rules so that only requests made from a specific IP address or domain are accepted. For more information about allowing or denying requests from IP addresses or domains, see the procedures under Configuring Remote Management on Microsoft TechNet.

Configuring Users and Permissions for IIS Manager

When you configured the Management Service in the above section, you selected the Windows credentials or IIS Manager credentials option. This option enables users with either Windows user accounts or IIS Manager user accounts to connect to a site or application on the remote computer by using IIS Manager. Both types of users must provide valid credentials (a user name and password pair) when they connect remotely. A Windows user must provide valid Windows credentials for a user account on the remote computer or for a user account in the domain if the computer is a member of a domain. An IIS Manager user must provide valid IIS Manager credentials, which are configured in IIS Manager by a server administrator on the remote computer. In both cases, a user is able to use IIS Manager to connect to sites or applications for which the server administrator has given the user permission.

Add an IIS Manager User

The following procedures explain how to open the IIS Manager Users feature and add a user. When the IIS Manager Users feature page opens, the list displays each IIS Manager user name and whether the account is enabled or disabled. Only enabled accounts are allowed to connect to sites or applications for which they have been granted permission.
To add an IIS Manager user:
  1. In IIS Manager, in the Connections pane, click the server node in the tree.
  2. On the server home page, double-click IIS Manager Users.

    3. On the IIS Manager Users page, in the Actions pane, click Add User.
    4. In the User name box, type a user name.
    5. In the Password box, type a password and then retype the password in the Confirm password box.
    6. Click OK.


Configure IIS Manager Permissions for a Site or an Application

In order for a user to remotely connect to a site or application on the server, they must be granted permission to a site or application by the server administrator. After they are granted permission, they can use IIS Manager to connect to the site or application using either their Windows credentials (if they are a Windows user) or their IIS Manager user credentials (if they are an IIS Manager user).
To permit an IIS Manager user to connect to a site or an application:
1. In IIS Manager, in the Connections pane, select the site or application for which you want to configure permissions.
2. On the home page for the site or application, double-click IIS Manager Permissions.


3. On the IIS Manager Permissions page, in the Actions pane, click Allow User.
4. On the Allow User dialog box, select IIS Manager and click Select.

5. On the Users dialog box, select one or more IIS Manager users from the list and then click OK.

 6. Click OK to dismiss the Allow User dialog box.
To permit a Windows user to connect to a site or an application:
1. On the IIS Manager Permissions page, in the Actions pane, click Allow User.
2. On the Allow User dialog box, select Windows and then click Select.
3. On the Select User or Group dialog box, type a user name or search for a user account, and then click OK.

4. Click OK to dismiss the Allow User dialog box.

Configure Access Control Lists (ACLs) for Content Directories

In order for IIS Manager to work correctly when a user connects to a site or an application, the ACLs must be configured properly for the physical directory of the site or application. For Windows users, you must configure directory and file ACLs for each Windows user or group that needs to access the directories and files. For IIS Manager users, you must configure directory and file ACLs for the WMSVC user (NT Service\WMSVC by default).
For the physical directory of a site or an application, configure read, write, and execute permissions for the WMSVC user (if you are permitting IIS Manager users to connect) and for any Windows users who need to connect to that site or application.
If the physical directory of the site or application is on a different machine (i.e. on a UNC share) then you will need to configure WMSVC to run as a user which has read, write, and execute permissions for the content on that UNC share (the default user, NT Service\WMSVC, cannot access items on a different machine).

Connect to a Site or an Application in IIS Manager

After you have configured the Management Service and configured users and permissions, a user can connect to his or her site or application.
To connect to a site or an application
1. In IIS Manager, click File and then click Connect to a Site (or Connect to an Application).
2. On the Connect to Site or Connect to Application wizard, type the server name and the site name to which you want to connect. If you are connecting to an application, type the application name also. Then click Next.

3. On the Provide Credentials page of the Connect to Site or Connect to Application wizard, select whether you want to use current credentials or to specify the credentials to connect to the site. When you specify credentials, the default is Windows credentials unless you select the Use IIS Manager credentials check-box. After you specify the credentials, click Next to connect to the server.

4. If the connection succeeds, IIS Manager will display a final page on the Connect to Site or Connect to Application wizard to name the connection. As shown in the image below, the TestAdmin user has created a site connection to the Contoso.com site.
 
Additional Information
In the next section, we look at Feature Delegation. However, before we do that, and to better explain Feature Delegation and what it does, we look at one feature of the site we have just connected to. The site should be highlighted and the site home page should be displayed. On the home page, double-click Error Pages.
As shown in the image below, on the right-hand side of the page there is an alert saying "This feature has been locked and is read only." This alert is displayed when a feature has been locked; the next section explains Feature Delegation and locking in more detail.


Delegating Features in IIS Manager

The Feature Delegation feature page lets a server administrator configure the delegation state of features that are configurable in Web.config files at the site and application levels in IIS Manager. He or she might want to delegate configuration of certain features, such as Default Documents and Directory Browsing, to an individual site owner so that the owner can configure those delegated features in his or her site.
Or a server administrator might delegate a feature as read only so that a site owner can view the configuration of a feature but cannot change the settings. The server administrator can even prevent features from appearing in IIS Manager at the site and application levels.
There are several different delegation states, each of which determines whether a feature is delegated to lower levels in the configuration system and whether the feature displays in IIS Manager when users are connected at lower levels. The following table describes each delegation state.
Delegation TypeDescription
Not DelegatedThe configuration is locked and any configuration of the feature in a Web.config file will cause a runtime error.
The feature is not visible or configurable in IIS Manager when a user is connected at levels below where this state is set. For example, if a feature is configured to be Not Delegated at a site level, users connected to applications in that site will not see the feature and cannot configure it in IIS Manager.
Read OnlyThe configuration is locked and any configuration of the feature in a Web.config file will cause a runtime error.
The feature is visible in IIS Manager when a user is connected at lower levels, but the configuration is locked so that changes cannot be made.
Read/WriteThe feature can be configured in Web.config.
The feature appears in IIS Manager and can be configured when a user is connected at lower levels (site or application level).
Configuration Read OnlyThe meaning is the same as Read Only; however, there are settings or data for the feature that are stored and managed outside of IIS, such as in a database.
Configuration Read/WriteThe meaning is the same as Read/Write; however, there are settings or data for the feature that are stored and managed outside of IIS, such as in a database.
Note: Server administrators can modify the configuration for all features, so if they are connected to the server, they will see all features at all levels even if a feature has been configured to not display at lower levels.

Configure Default Delegation States for Features in IIS Manager

When you first open the Feature Delegation feature page, you can configure the default delegation state of features in IIS Manager. These delegation states are the default settings used by IIS Manager for all sites and applications on the server.
To configure default delegation states for features in IIS Manager
1. In IIS Manager, in the Connections pane, click the server node in the tree.
2. On the server home page, double-click Feature Delegation.

3. Select Delegation from the Group by list to organize the list of features by their current delegation states.

4. Select Error Pages in the Feature Delegation list, and then review the available delegation states in the Actions pane. The Error Pages feature is selected and the available options under Set Feature Delegation are Read/Write, Remove Delegation and Reset to Inherited.

5. Select Error Pages. In the Actions pane, click Read/Write to unlock the configuration section that is related to the Error Pages feature. This makes the feature configurable in Web.config files and in IIS Manager at the site and application levels.

Additional Information

The following excerpt from the IIS configuration files shows that the values can be overridden at every location (also referred to as "path"):

<location path="" overrideMode="Allow">
    <system.webServer>
        <httpErrors>
            ...
            ...
        </httpErrors>
    </system.webServer>
</location>
  

 
To further demonstrate what this action does, look at Error Pages feature at a site level. In the Connections pane, connect to a site and then double-click Error Pages on the site home page. As shown in the image below, the Error Pages feature can now be configured by the user connected to the site level.

Configure Custom Delegation States for Features in a Site or an Application

The steps above configured the default delegation state for the Error Pages feature in all sites on the server. There may also be a time when you do not want the delegation state that you configure to be applicable to all sites. In this case, you can configure a custom delegation state for a specific site. You can also copy custom delegation states of all features from one site to another site.
To configure custom delegation states for features in a specific site
1. In IIS Manager, double-click Feature Delegation.
2. On the Feature Delegation page, in the Actions pane, click Custom Web Site Delegation.
3. From the Sites list, select the site for which you want to configure custom delegation settings.

4. Select a feature, and then click a delegation state in the Actions pane.
To copy custom delegation states from one site to another site
  1. On the Custom Web Site Delegation page, in the Sites list, select the site from which you want to copy delegation to another site.
  2. Click Copy Delegation.
  3. On the Copy Delegation dialog box, select the site or sites to which you want to copy the delegation states and then click OK.

Reset Feature Delegation States

There may be a time in which it is necessary to undo the changes that have been made to the delegation states of features. Perhaps the changes were made to a particular site or application by accident, or some 'experimentation' with the feature has gone wrong. In this case, reset the delegation states of all features back to their default states. Or, reset only one feature back to its default state.

To reset feature delegation states
  1. Open the Feature Delegation feature page.
  2. To reset all feature delegation states, in the Actions pane click Reset All Delegation.
To reset the delegation state of a specific feature, select the feature in the list, and in the Actions pane click Reset to Inherited.

Chủ Nhật, 21 tháng 11, 2010

ASP.NET session timeout

Change the following time-outs in Internet Services Manager .Choose a value greater than the default of 20.
    1. Select Default Web Site > Properties > Home Directory > Application Settings > Configuration > Options. 2. Enable the session state time-out and set the Session timeout for 60 minutes.

    3. Select Application Pools > DefaultAppPool > Properties. 4. From the Performance tab under Idle timeout, set Shutdown worker processes after being idle for a value higher than 20.

The default session time-out setting on IIS is 20 minutes but it can be increased to a maximum of 24 hours or 1440 minutes. See Microsoft article Q233477 for details about increasing the timeout in IIS.
Symptom
When returning to the logon page for Web Interface, users often encounter an Error: Your session with the web-server expired. You have been logged out.
Cause
Web Interface 2.0 picks up the session timeout setting from IIS.
Resolution
1. Start Internet Services Manager 5.0.
2. For explicit authentication, right-click the /Citrix/MetaFrameXP/default virtual directory and view the Properties.
    For desktop credentials, pass-through users edit the /Citrix/MetaFrameXP/integrated virtual directory.
For Smart Card users, edit the /Citrix/MetaFrameXP/certificate virtual directory.
3. In the Application Settings section, click Configuration.
4. Select the App Options tab.
5. Ensure Enable session state is selected.
The default session time-out setting on IIS is 20 minutes but it can be increased to a maximum of 24 hours or 1440 minutes. See Microsoft article Q233477 for details about increasing the timeout in IIS.
NFuse Classic 1.71 and earlier
When Internet Explorer is configured never to check for newer versions of Web pages, NFuse Classic will not launch an application after a session is allowed to expire. To reproduce this problem:
    1. Configure your browser settings for 'Temporary Internet files and set Check for newer versions of stored pages to Never. 2. Log on to Citrix NFuse Classic and view your published applications. 3. Leave the system idle for 20 minutes or longer so that the Web server session expires. 4. Click an application icon. The system returns you to the Logon page and a message appears stating that your session expired. 5. Log on again and click the same application as before. You are again returned to the Logon page even though your session should not have expired this time.
Solutions
      • Clear the Temporary Internet Items folder • Upgrade to Web Interface 2.0 or later • Set Check for Newer versions of stored pages to Automatically
The default session time-out setting on IIS is 20 minutes but it can be increased to a maximum of 24 hours or 1440 minutes. See Microsoft article Q233477 for details about increasing the timeout in IIS.
NFuse 1.6
This error is caused by the expiration of a Web server session, not a MetaFrame ICA session. Web servers maintain session state for a fixed time period to preserve Web server resources and as a security precaution. The default setting for IIS is 20 minutes. Do not remove this timeout. However, the timeout can be modified in the following ways (assuming your Web server is Microsoft IIS):
    1. Open Internet Services Manager. 2. From the Web site Properties, click the Home Directory tab, then click the Configuration... button in the Application Settings section. 3. On the configuration panel, click the App Options tab and set the session timeout there. 4. In NFuse 1.6, add this line to the end of redirect.asp: <% Session.Timeout = 20%> where 20 is the number of minutes after which an idle session will time out.
Increasing this value improves usability, preventing users from having to enter their credentials too frequently.
Decreasing this value improves security; if a user leaves his desk unattended with the NFuse application list showing, other users can launch applications using the account. The session time out acts as an idle time out and prevents this type of abuse.

Thứ Tư, 17 tháng 11, 2010

Windows : Clear saved Windows networking passwords

Clear saved windows networking passwords
From time to time, I need to clear or reset a saved password to a network share. When I connect to a remote computer and click the Remember Password checkbox, it gets stored somewhere… this command will help you manage those passwords:

rundll32.exe keymgr.dll, KRShowKeyMgr

This will popup a little application, with all those shares where you saved the password, and let you clear them one by one.

Thứ Ba, 12 tháng 10, 2010

Sữa đậu nành

Là nước giải khát có thành phần dinh dưỡng cao nhưng sữa đậu nành cần được sử dụng và chế biến đúng.
 
Trong sữa đậu nành có các vitamin A, B1, B2, D, PP, K, F và các men có ích cho tiêu hóa. Ngoài ra; sữa đậu nành còn có chất isoflavon bù lại tình trạng thiếu oestrogene suy giảm theo tuổi tác của phụ nữ, có tác dụng tích cực tạo xương, chống tình trạng loãng xương, phòng trị ung thư vú ở phụ nữ và chứng thừa cholesterol ở đàn ông. Song khi dùng sữa đậu nành cũng cần lưu ý:
 
- Sữa đậu nành có thể dùng cho trẻ em từ l tuổi đến 5 tuổi thay thế một phần sữa động vật, nhưng không nên thay thế hoàn toàn.

- Không cho trứng gà vào đun sôi với sữa đậu nành để uống, vì chất trypsine của sữa đậu nành kết hợp với protein có tính miễn dịch của trứng gà sẽ sinh ra chất ức chế ảnh hưởng đến sự hấp thụ của cơ thể.

- Trước hoặc sau khi uống sữa đậu nành 1 giờ không nên ăn cam, quýt, vì chất acid và vitamin trong cam, quýt tác dụng lên các protein trong sữa đậu nành sẽ kết thành khối ở ruột non, làm ảnh hưởng đến tiêu hóa, có thể gây ra sình bụng, đau bụng hoặc tiêu chảy.

- Tránh uống sữa đậu nành trong khi đang đói. Tốt nhất là uống sữa đậu nành sau bữa ăn sáng 1 - 2 giờ.

- Sữa đậu nành phải đun sôi kỹ ở 1000C trong vài phút để làm tan hết chất xúc tác rồi mới dùng để uống. Nếu không đun kỹ, còn chất xúc tác nó có thể gây cồn cào, buồn nôn, đau bụng, tiêu chảy.

- Không dùng đường tán (đường đỏ) để pha sữa đậu nành vì đường tán có acid hữu cơ, nó sẽ kết hợp với protein trong sữa sinh ra chất lắng đọng, có hại cho sức khỏe.

- Không đựng sữa trong phích nước nóng vì chất xúc tác của sữa tác dụng lên các chất cáu bẩn trong phích sẽ sinh ra nhiều vi khuẩn, khi uống sữa dễ bị đau bụng, tiêu chảy.

- Sữa đậu nành để lâu bị hư nên cần pha natri benzoat với liều lượng 600 mg trong mỗi kg sữa khi bảo quản.

Thứ Hai, 6 tháng 9, 2010

Dông và kỹ thuật nuôi dông

1. Giống và đặc điểm giống:
Dông là tiếng địa phương gọi con kỳ nhông có nơi như vùng Nghệ - Tĩnh gọi là nhông. Dông có nhiều giống, dông vùng đất cát gọi là dông cát benly. Tên Latin: Leiolepis belliana. Họ: dông Agamidae. Bộ: Có vảy Squamata. Nhóm: Bò sát: Kỳ nhông hay còn gọi là dông sống trên đất cát ven biển, phù hợp với các vùng đất ven biển miền Trung nước ta. Vóc dáng: Dông gần giống con tắc kè, da hồng đỏ, trên lưng có lớp gai chạy dọc theo xương sống và dọc theo hông có các vệt lớn màu đen, cam. 2. Tập tính sinh hoạt và môi trường sống: Dông là một loại bò sát sống thích nghi vùng đất cát tự nhiên ven biển của các tỉnh dọc Duyên hải miền Trung. Nói rõ ra ở các tỉnh Ninh Thuận, Bình Thuận,các tỉnh nằm dọc Duyên hải miền Trung và một số thuộc miền Đông Nam Bộ như Bà Rịa Vũng Tàu,... nơi có nhiều cánh đồng cát trắng mênh mông mới có dông tập trung sinh sống. Loài bò sát này thường ra khỏi hang để sưởi ấm vào buổi sáng để điều hoà nhiệt độ cơ thể (chúng thuộc loài máu lạnh), tìm thức ăn và gây ấn tượng đối với các con cái xung quanh cả ngày, rồi rút vô hang vào xế chiều, đóng cửa hang lại bằng cát. a. Trong môi trường tự nhiên: Trong môi trường tự nhiên, dông cát thường sống ở các đồi cát ven biển hoặc các gò đồi, nương rẫy ở khu vực đồng bằng. Chúng thường tập trung ở các bãi hoang, các cây bụi, các khu vực trồng phi lao, trồng keo, các ruộng hoa màu, các nghĩa địa và bãi đất hoang. b. Điều kiện trong hang: Dông tự đào hang. Hang của chúng ngoằn nghoèo và có cái sâu tới 1m. Cũng có hang chúng mở thêm ngách phụ để thoát hiểm. Có hang dài tới 2m. Vì hang ở sâu trong lòng đất nên nhiệt độ trong hang thường chênh lệch nhiều so với bên ngoài. Đây cũng là nơi điều hòa nhiệt độ (mùa hè thì mát, mùa đông thì ấm). Nhiệt độ trong hang rõ ràng ổn định hơn nhiệt độ bên ngoài.Theo Ngô Đắc Chứng, dông sọc thường có hang nông hơn dông hoa. Chúng chỉ đào sâu 40-50 cm. Một yêu cầu bắt buộc mà dông cát cần đó là độ ẩm. Trong điều kiện khô hạn của những vùng gần như sa mạc đó. Dông phải đào hang sâu xuống dưới lòng cát để tận hưởng độ ẩm trong lòng đất. Độ ẩm rất quan trọng đối với dông. Dông thường lui tới các gốc cây, các bụi cây để đào hang. Nhờ lá cây che chắn mà độ ẩm ở đó khá hơn những chỗ trơ trụi. Tuy nhiên dông không sống được ở những nơi sũng nước hoặc nước thoát chậm. Vì vậy khi bố trí nơi nuôi dông phải hết sức lưu ý tới điều này. Đặc biệt đáy của nơi nuôi dông không nên lát kín vài sẽ cản trở việc rút nước khi mưa. 3. Quy luật hoạt động của dông cát. a) Hoạt động theo mùa: * Mùa hoạt động: Dông thường hoạt động vào mùa nắng ấm, từ tháng 4 đến tháng 10. lúc đó điều kiện nhiệt độ không khí thường 27-380C, nhiệt độ mặt đất 27-390C và độ ảm 30-80%. Dông ngừng hoạt động hoàn toàn vào những ngày mưa. Thậm chí khi có giông hay trời âm u là chúng tìm đường trú ẩn. Không bao giờ thấy dông hoạt động vào lúc trời mưa hay mưa vừa tạnh. Dông không chịu được nhiệt độ lạnh. Khi nhiệt độ ngoài trời xuống 24-250C và độ ẩm lên trên 90% là chúng đã tìm đường đi trú * Trú đông: Mùa trú đông của dông cát thường là tháng 11 đến tháng 3 năm sau. Vào thời kỳ này, nhiệt độ ngoài trời xuống dưới 250C và độ ẩm có lúc cao tới 85-900C. Dông lấp của hang và nằm lì trong hang. Tới mùa xuân khi nắng ấm về nhiệt độ lên cao dần, dông mới chui ra khỏi hang để kiếm ăn. b) Hoạt động ngày, đêm: Dông hoạt động vào ban ngày, buổi sáng chúng ra khỏi hang lúc 8-9 giờ, tới 13 giờ, 13 giờ 30 trưa thì chúng lại vào hang. Dông rất cảnh giác, nó không bao giờ nhảy ngay lên mặt đất. Nó thường thò đầu ra khỏi hang nghe ngóng rất kỹ, có khi tới 5, 10 phút sau đó mới chui ra. Lúc này nó phơi nắng, đó là đặc điểm của loài bò sát. Chúng phải tăng cường tích nhiệt dưới ánh sáng mặt trời. Một lúc sau nó mới đi kiếm ăn. Thời gian hoạt động của dông không nhiều, trung bình một ngày chúng chỉ chui ra khỏi hang 4-5 giờ đồng hồ để đi kiếm ăn. Thời gian còn lại chúng ằm yên trong hang để tiết kiệm năng lượng. 4. Làm chuồng, hố nuôi. Kỹ thuật xây chuồng trại cho dông rất đơn giản, nhiều người còn ví chuồng nuôi dông như là một động cát tự nhiên thu nhỏ Trong tự nhiên dông cát tự đào hang và sống đơn độc, kín đáo ở những nơi yên tĩnh. Chúng ta có thể tận dụng và tổ chức ngay chỗ nuôi tại các khu vực đó hoặc các sinh cảnh tương tự. điều quan trọng là phải cố định chúng trong một không gian nhất định. Vì vậy khu vực tổ chức nuôi dông phải được xây tường kín xung quanh. Dông là loài đào hang rất khỏe, vì vậy độ sâu của móng tường là vấn đề quan trọng. để tránh dông thoát ra ngoài chúng ta làm móng tường sâu 1,2m- 1,5m. Nếu móng xây được thì tốt nhưng tốn kém. Có thể sử dụng các tầm tôn phibrô xi măng và cắm sâu xuống cát 1m. Vit chặt các tấm đó lại với nhau để nối vòng quanh khu nuôi. Như vậy dông không đào hang để ra ngoài được. Bờ tường cũng phải cao để tránh dông trèo ra, do đó bờ tường cũng xây cao 1,2 m trở lên. Một số nơi bà con chỉ xây cao 40 – 50 cm, phần còn lại là một tấm tôn cao 1m chạy vòng quanh. Vì tôn nhẵn nên dông không thể trèo hay bò ra ngoài được. Ta cũng có thể bố trí nuôi dông trên bãi cát hoang, các khu đất trồng cây bụi. cũng có thể kết hợp nuôi dông trong các vườn cây. Tất nhiên khu nuôi phải được xây tường bao quanh. Dông rất thích có bóng mát. Trong khu nuôi nên có nhiều cây. Chúng ta nên bố trí trồng cây trong khu vực nuôi dông. Qua thực tế cây trứng cá là cây nên trồng nhất. cây trứng các mọc rất nhanh, chịu được nóng, được hạn, tán rộng, cây cao vừa phải và quả của chúng lại là món khoái khẩu của dông. Ta không nên trồng quá dày. Tán cây chỉ nên che 1/2 – 1/3 diên tích khu nuôi. Diện tích còn lại để cho dông sưởi nắng. Cũng có khu vực rất khó trồng cây do đất nghèo kiệt hoặc quá khô hạn, cây trồng không lên được hoặc lên rất chậm. trong tường hợp này ta nên căng một số bạt để che nắng. cũng có thể làm giàn để phủ lá hoặc lót cot lên trên. Cũng có thể xếp các cành cây khô thành đống để dông đào hang xuống chỗ đó. Đám cành lá này cũng là chỗ để dông con chạy trốn khi bị dông lớn đuổi. Như vậy dông vẫn có khu vực bóng mát nhân tạo. Nếu nuôi trong khu nào có trồng khoai lang hoặc rau muống thì càng tốt, chúnh vừa làm thức ăn vừa làm bóng mát môi trường cho dông. Trong khu nuôi cần bố trí nhiều chỗ cho dông ăn. Dông tham ăn và thường tranh giành lẫn nhau. Dông lớn thường bắt nạt dông bé. Nếu ta bố trí nhiều chỗ đổ thức ăn thì dông bé cũng có thể ăn được. chỗ để thức ăn có thể là một miếng gỗ, một tấm nilon, một mãng phibro xi măng vỡ hoặc mấy viên gạch gắn lại cho vuông và bằng phẳng,… Tùy từng điều kiện mà chúng ta có cách bố trí cho dông ăn cho hợp lý. Dông không đòi hỏi nhiều nước vì ngay trong thức ăn đã có đủ nước rồi. Tuy nhiên ta vẫn nên bố trí dụng cụ đựng nước để cho dông uống. Ta cũng có thể dùng các loại chai nhựa có khoan một lỗ thủng ở cổ chai, cho nước vào đầy chai và lộn ngược lại để trong một chén miệng hẹp để hạn chế việc bốc hơi nước. Vào mùa nắng, nên xịt nước vào chuồng vào mỗi buổi sáng để tạo độ ẩm và nhằm tạo thói quen cho dông lên ăn khi trời mưa. Thông thường, dông chỉ lên kiếm ăn vào khoảng 8-10 giờ sáng trong ngày. 5. Thức ăn: Nguồn thức ăn chủ yếu là thức ăn thực vật: các loại rau, quả như rau muống, rau lang, cà chua, dưa hồng, lá, hoa, nụ, quả. .. Đặc biệt, chồi non xương rồng và cỏ dại được xem là món "khoái khẩu" nhất của dông:, . . . dông còn ăn côn trùng (bướm, sâu non, giun đất...), trứng của loài bọ cánh cứng. Ngoài ra, còn cho dông ăn cám gạo, cám hỗn hợp và các loại đậu… cho ăn đầy đủ các loại thức ăn để cung cấp dinh dưỡng cho dông. Rõ ràng nguồn thức ăn để nuôi dông dễ kiếm hơn rất nhiều so với các loài vật nuôi khác. Tuy nhiên để nuôi đạt năng suất cao ta cần tăng cường các loại thức ăn giàu chất dinh dưỡng cho chúng. Nhiều gia đình thường thái cây chuối trộn với cám gạo cho dông ăn. ở những vùng có sẵn bí đỏ người ta băn bí đỏ ra cho chúng ăn. Nếu có lạc lép, hoặc đậu thứ phẩm, ta ngâm nước cho trương nở và giả nhỏ ra. Dông ăn loại này rất mau lớn. Tất cả nguồn thức ăn động vật đều hấp dẫn đối với dông. Cần băm nhỏ thức ăn ra để tiện cho dông ăn. Dông cũng thích ăn giun đất (trùn đất). Chúng ta nên tổ chức nuôi trùn quế để cung cấp thức ăn cho dông. Ngoài ra cơm nguội và các thức ăn thừa của con người đều có thể cho dông ăn. Đặc biệt dông rất thích ăn các loại thức ăn có màu sắc, vị ngọt như cà chua, đu đủ, dưa hấu, xoài. Cà rốt, bí đỏ,... và các loại hoa như hoa phượng, hoa dâm bụt, hoa giấy,... Thức ăn dông rất phong phú. Tuy nhiên để cung cấp với số lượng lớn và đều đặn hàng ngày, chúng ta nên có kế hoạch gieo trồng, nuôi cấy và tích lũy thức ăn khi tổ chức nuôi dông. Trước màu đông dong thường thu thức ăn về để ở dưới hang. Nó sẽ ăn dần trong mùa đông. Khi ăn hết thức ăn nó sẽ gặm cả đuôi của nó. Nhiều con cụt hết đuôi. Đến muà ấm nó ngoi lên và đi kiếm thức ăn. Cái đuôi cụt mọc dài dần ra như cũ. 6. Chăm sóc: Nuôi dông không tốn nhiều công chăm sóc. Điều cần thiết chính là khâu bảo vệ. phải ngăn chặ mọi ngã mà dông có thể tẩu thoát. Phải xây kín hoặc giăng lưới cẩn thận để tránh chúng lẻn đi. Khoảng cách giữa cây trong khu nuôi và bờ tường đạt ít nhất là 3m. Dông có thể leo lên cây và nhãy qua tường để ra ngoài. Quá trình chọn lọc tự nhiên trên vùng khí hậu khốc liệt đã tạo ra con dông có tính thích ứng cao. Chúng rất ít bị bệnh tật đe dọa. Tuy nhiên do nuôi nhiều và tập trung nên chúng ta cần phải luôn chú ý đến những biểu hiện bệnh lý của con dông. Hiện nay hiện tượng dông lớn cắn dông bé là vấn đề hằng ngày. Ta phải tìm mọi cách để phòng tránh. Dông là loài sống ở các vùng đất khô hạn nhưng khả năng chịu nắng của dông cũng có hạn. Nếu ta để dông mắc lưới (khi thu hoạch) mà không kịp gỡ chân cho chúng thì chỉ cần 2 giờ sau chúng có thể chết. Đây là điều hết sức lưu ý đặc biệt là các khu nuôi rộng. Việc trồng cây và tạo độ ẩm thích hợp cho khu vực tổ chức nuôi là việc cần quan tâm thường xuyên. Cố gắng đừng để tình trạng khu nuôi rơi vào tình trạng quá khô hạn, quá nắng nóng. Ngay từ khâu lựa chọn chỗ nuôi ta cần phải tính toán vấn đề này. Kẻ thù của dông không phải là ít. Ngoài chim diều hâu còn có chó, mèo, chuột. Để chống mèo chuột người ta thường giăng lưới nilon (loại lưới dùng để bắt cá) dọc theo bờ tường và căng về phía trong khoảng 2m. mèo và chuột rất sợ rơi vào loại lưới này vì chúng không đi được. Phải thường xuyên theo dõi xử lý các trường hợp xãy ra. Giử cho môi trường nuôi dông được yên tĩnh và bình an là cả một vấn đề quyết định, vì vậy không thể lơ là. 7. Sinh trưởng và hiện tượng lột xác của dông cát: - Sinh trưởng : Dông sinh trưởng nhanh, mau lớn và rất ít bị dịch bệnh nên không cần chăm sóc nhiều (chỉ đề phòng mèo, chuột cống và rắn). Hiện nay một số người nuôi dông có phát hiện dông thường bị bệnh sổ mủi vào mùa lạnh nhưng tự khỏi. Tỷ lệ sống của dông khá cao, đạt từ 90-95%.. - Lột xác: Lột xác là một hoạt động sinh lý bình thường và cần thiết cho quá trình phát triển của cơ thể dông. Thậm chí lột xác còn là một chỉ tiêu quan trọng biểu thị trạng thái sức khỏe của dông. Dông muốn lớn phải lột xác. Chúng lột xác nhiều lần trong năm. Đặc biệt vào mùa hoạt động dông lột xác liên tục. Lúc đó chúng ăn khỏe và lớn nhanh. Trong điều kiện tự nhiên, các nhà khoa học đã xác định được tần suất lột xác ở dông cát trung bình là: Con cái: 7.83 lần/mùa hoạt động Con đực:8.15 lần/mùa hoạt động Quá trình lột xác diễn ra trong 3 giai đoạn. Mỗi giai đoạn có những biểu hiện khác nhau. a) Thời kỳ chuẩn bị lột xác (3-6 ngày): lúc này da chúng ở 2 bên sườn, ở các chấm ô van trên lưng và ở cổ có màu vàng cam. Mặt trên của các chi cũng sẽ chuyển sang màu vàng đậm. Phần da màu trắng xám dưới bụng, dưới chi và đuôi sẽ chuyển màu xám tối. Dông uể oải, ít ăn, ít hoạt động (mỗi ngày nó chỉ ra ngoài 1-2 giờ). Nó nằm lì trong hang. Cũng lúc này dông có mùi hôi đặc biệt. Mùi đó giống mùi động vật bắt đầu thối rửa. b). Thời kỳ lột xác chính thức: (7- 10 ngày). Lúc này dông sẽ bỏ lớp vỏ da cũ để thay bằng một lớp mới. Dông sẽ chui ra khỏi hang tìm nơi thuận lợi để lột xác. Nó tìm thấy gốc cây, mõm đá, bờ tường, nền đất cứng,... chà mạnh đầu, cổ. Lưng và vùng bụng vào đó để da bong ra từng mãng tại chỗ nó cà. Sau đó phần da ở nách, ở các ngón chân cũng dần dần bong ra. Thứ tự sẽ lột là: - Lột xác phần đầu - Lột xác phần thân - Lột xác nốt phần thân và phần đuôi. c). Thời kỳ sau khi lột xác: (20-31 ngày) Thời gian này được tính từ lúc hoàn thành lần lột xác trước đến lần lột xác tiếp theo. Sau khi lột da xong, da của nó bóng đen, các hoa văn ở cổ, đầu , lưng và hai bên sườn đều có màu vàng cam. Điều này quan sát thấy rõ ở con đực. Phần da dưới bụng của chúng sẽ chuyển sang màu sáng trắng. Dông đi kiếm ăn ngay, nó ăn khỏe và hoạt động rất sôi nổi. Tóm lại ta có thể thấy toàn bộ chu kỳ lột xác của dông cát kéo dài từ 30-45 ngày. Nó thường lột xác vào khoảng tháng 4 đến tháng 11. lúc đó nhiệt độ thường là 28-330C và độ ẩm không khí từ 80-85%. Dông sẽ lột xác 7-8 lần/năm. Vào thời điểm ngủ đông dông cát không lột xác. 8. Sinh sản: Theo các nhà khoa học hầu hết các loài dông cái đều đẻ trứng, trứng nở ra dông con. Riêng loài dông được phát hiện ở khu vực Thừa Thiên Huế (loài Leiolepisguentherpetersi) có thể là loài sinh trinh (parthonogenecis) (tất cả đều là cá thể cái và tự phân li trứng khi đẻ). Dông sau khi nuôi 8 – 10 tháng thì đến tuổi động dục có thể sinh sản. Dông thường cặp đôi vào mùa hè (từ tháng 4 đến tháng 6) và đẻ trứng vào tháng 6 đến tháng 8. Thời gian mang thai 10 ngày. Dông đẻ nhiều lứa một năm, mỗi lần đẻ từ 6-8 trứng. Trứng dông có hình thuôn dài (dài từ 2,2cm -2,4cm, rộng 1,1cm -1,3 cm, nặng khoảng 3 g), 45 ngày sau trứng nở ra dông con, Dông con mới nở thân hình màu trắng dợt, sống quanh quẩn dưới hang trong một vài ngày đầu. Khi bộ chân đã cứng cáp, chúng theo dông mẹ chui ra khỏi hang và tập nhấm nháp thức ăn. Độ 1 tháng tuổi dông đã bằng ngón tay cái, đến hai tháng tuổi dông đã bằng ngón chân cái và có thể xuất chuồng bán giống. Dông lớn nhanh vào các tháng từ tháng 6 đến tháng 8. Đây là thời kỳ thuận lợi nhất cho hoạt động của dông cát. Tới khi trưởng thành tốc độ lớn của nó chậm hơn còn non.. Đến năm kế tiếp, đàn dông con trưởng thành và lại tiếp tục sinh sản 9. Thu hoạch Sau khi nuôi 8-10 tháng là thời điểm thu hoạch dông. Ta cũng có thể bắt dông bằng lưới. Dùng lưới có mắt nhỏ và rải đều xuống mặt đất, sau đó ta rải thức ăn xung quanh, dông kéo ra ăn. Lúc đã thấy chúng ra hết ta gây tiếng động mạnh. Dông cuống quýt bỏ chạy. Vì vội vã, chúng sẽ mắc chân vào lưới. Ta gỡ và thu những con dông lớn. Các con nhỏ cũng gỡ ngay và thả chúng lại trong hang. Tránh để sót con bị mắc lưới. Vì nếunhư vậy chỉ 2-3 giờ sau chúng chết vì say nắng, nóng. Cần hết sức lưu ý điều này. Tốt nhất ta nên dùng nhiều bẫy để bắt dông. Đó là cách bắt dông tốt nhất và an toàn nhất. Việc vận chuyển dông đi xa cần phải đựng trong các lồng thoáng, không nên để chúng trong các túi vải kín, dông sẽ chết.
 
Nguồn: sokhcn.binhthuan.gov.vn

Thứ Hai, 23 tháng 8, 2010

To disable auto login network share folders

XP has the same sharing/permissions options as vista but they are disabled by default.

Open up a folder and browse to ToolsFolder Options and click the View tab, scroll down until
you find Use Simple File Sharing -> it’s at the bottom, and remove the tick. Hit apply and right click a folder.
Your options should now be visible.
  • 1- Right click on the shared folder and select properties.
  • 2-From sharing tab select permissions.
  • 3-Remove everyone
  • 4-Add your user name and select permission type "read only" or "full control".


Now only your username have permissions to access this folder.

Hope that’s what you were after

Chủ Nhật, 22 tháng 8, 2010

NHibernate Fetching Strategies

NHibernate has various fetching strategies that you can tinker with to improve the performance when fetching object graphs from the database. I wouldn't go nuts with a lot of pre-mature optimization, but at the same time it is important to know what NHibernate is doing behind the scenes when you are selecting domain entities from the database.
 
Based on NHibernate 1.2 documentation there are 4 fetching strategies:
  • Join fetching - NHibernate retrieves the associated instance or collection in the same SELECT, using an OUTER JOIN.
  • Select fetching - a second SELECT is used to retrieve the associated entity or collection. Unless you explicitly disable lazy fetching by specifying lazy="false", this second select will only be executed when you actually access the association.
  • Subselect fetching - a second SELECT is used to retrieve the associated collections for all entities retrieved in a previous query or fetch. Unless you explicitly disable lazy fetching by specifying lazy="false", this second select will only be executed when you actually access the association.
  • Batch fetching - an optimization strategy for select fetching - NHibernate retrieves a batch of entity instances or collections in a single SELECT, by specifying a list of primary keys or foreign keys.

Fluent NHibernate Configuration

Let's put together a quick example of using NHibernate and using Fluent NHibernate for configuration. This is a trivail example of fetching a category and the products associated with it. Using Fluent NHibernate we can configure the mapping of the Category and Product Business Objects to the database tables as such:

public class CategoryMap : ClassMap<Category>
{
    public CategoryMap()
    {
        WithTable("Category");

        Id(x => x.Id);
        Map(x => x.Name).WithLengthOf(50).CanNotBeNull();
        HasMany<Product>(x => x.Products)
            .IsInverse()
            .WithKeyColumn("CategoryId")
            .AsBag();
    }
}

public class ProductMap : ClassMap<Product>
{
    public ProductMap()
    {
        WithTable("Product");

        Id(x => x.Id);
        Map(x => x.Name).WithLengthOf(50).CanNotBeNull();
        References(x => x.Category, "CategoryId");
    }
}

We are not lazy loading the collection of Products when we load the Category by choice and may want to look at using an appropriate FetchMode to improve the performance of loading the various products when we load a Category.

Improving NHibenate Performance using an Outer Join FetchMode

By default, when NHibernate fetches a Category it will select the collection of Products in the Category in a separate Select Method. This is two round-trips to the database. We can change the FetchMode to FetchMode.Join to have the Products and Categories pulled down with a single round-trip to the database. The bad thing here is that each product row returned from the database will include the Id and Name Columns from the Category Table. This is redundant. However, since this is only two small fields, the good thing is that we have avoided two round-trips to the database which in this case is a better performing situation. This may not be better performing in all situations, but the beauty is that NHibernate allows us to decide for ourselves and configure the FetchMode accordingly:

using (ISession session = configuration.BuildSessionFactory().OpenSession())
{
    ICriteria criteria = session.CreateCriteria(typeof(Category));
    criteria.SetFetchMode("Products", FetchMode.Join);
    var categories = criteria.List<Category>();
}

Above we have overriden the Fetching Strategy to a FetchMode.Join which means the Category and its Products will be pulled down in a single database round-trip.

Conclusion

If you are looking to improve the performance of NHibernate, you may want to investigate the Fetching Strategies which affect the way NHibernate fetches your domain entities and the number of round-trips to the database.

Thứ Bảy, 21 tháng 8, 2010

Không cài được WMP 11

(WinXP sp2,sp3)

Đầu tiên các bác vào Start ,Run,gõ Regedit rùi tìm đến khóa


HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Cu rrent Version\WPAEvents

Ở ô bên phải nhân chuột phải vào OOBETimer rùi click vào Modify.Tiếp đến hãy thay đổi một khóa bất kì(ví dụ 71 thành 72 chẳng hạn).Sau đó hãy đóng nó lại và tiếp tục vào Start , Run , và đánh

%systemroot%\system32\oobe\msoobe.exe /a

Nó sẽ đưa các bác đến cửa sổ Active windows.Đừng lo hãy chọn

I want to telephone a customer service representative to activate Windows

Tiếp đến nhấn Next ,nhấn Change Product key

Các bác hãy nhập cho em cái key này nha(đây là key xịn của bác Bill đó)

DHXQ2-WRGCD-WGYJY-HHYDH-KKX9B

Đánh xong hãy nhấn Update.Nó sẽ lại đưa chúng ta về cửa sổ Active,đừng quan tâm,hãy đóng nó lại bằng cách nhấn vào Remind me later

Xong đâu đó rùi thì còn chờ gì nữa,khởi động lại Windows đi thôi.Khởi động lại xong hãy vào Run , đánh tiếp

%systemroot%\system32\oobe\msoobe.exe /a

Cửa sổ Active sẽ lại hiện ra nhưng ko phải là bắt chúng ta Active mà là báo cho ta biết Windows is activated

Thứ Bảy, 14 tháng 8, 2010

Huyền bí nhân duyên nhưng đừng mê tín

Chúng ta có thể xem xét định mệnh bằng con mắt cẩn trọng, có thể dò tìm nhân duyên bằng trái tim thao thức, nhưng không có nghĩa là mê tín. Mê tín là cách nhìn mù quáng mà ngay cả các tôn giáo cũng từ chối mê tín. Mê tín là gì? Nó ngược nghĩa với xác tín.

Người xác tín là người phải dựa trên những cơ sở để mà tin. Còn người mê tín tất là tin mê muội, nhắm mắt mà tin bừa, hay người ta có thể nói là: Ngủ mơ giữa ban ngày.

Có những đôi mê tín đến độ: đang yêu nhau say đắm, đang yên đang lành lại nghe thầy bói bảo anh tuổi mèo, em tuổi chuột, thế là anh vồ chết em. Thế rồi chia tay tan nát, nước mắt ròng ròng, than thân trách phận, hận ông Trời, lại còn kéo nhau lên thành cầu rủ nhau nhảy xuống thà chết đuối chứ không chịu để cho mèo vồ chuột. Đó là nói vắn tắt cho dễ hiểu.

Chứ còn trong hiện thực, thì xảy ra muôn hình vạn trạng, có khi đang yêu nhau, cha mẹ hỏi "cháu tuổi gì", rồi đi "bấm tuổi" kim khắc mộc, thế rồi về báo cho con cháu lo đường mà chuồn, kẻo có ngày cái cưa thò xuống chân giường đôi uyên ương cưa một nhát, thế là sập tan tành... thế mà đôi bạn trẻ cũng tin, rồi lo chia đàn xẻ nghé... thế có phải là mê tín không?

Người ta đếm có không ít ngày tổng thống cũng xem tử vi, tiếng Tây gọi là horoscope trước khi ra quyết sách, hoặc ngay cả hai nhà bác học vĩ đại. Niu-tơn và Anh-xtanh cũng tin vào tôn giáo, nhưng đó là những đức tin chứ không phải là mê tín. Vậy thì khi người ta muốn tìm hiểu duyên phận của mình cũng vậy hãy sáng suốt để tin cái gì đáng tin, chứ đừng mê muội đến mức có vài câu "mèo vồ chuột" hay "thuỷ khắc hỏa" là nhảy cầu hay chia đàn xẻ nghé.

Trong đạo Phật, người ta gọi mọi việc ở đời đều cần phải có duyên. Như đức Phật dạy, nếu ta mở cửa nhìn thấy cái cây ở ngoài sân, tức là: phải có cái cây, phải có mắt ta, nhưng cửa phải mở thì ta mới thấy, nhưng cửa mở mà bên ngoài tối đen cũng không thấy nên cần phải có ánh sáng, rồi còn phải có cơ hội, có nhân duyên để đến ngồi trong căn phòng đó, để nhìn ra cái cây đó. Hội đủ thứ đó lại trong một không gian trong một thời gian, ta có thể gọi là: Duyên.

Người Trung Quốc nói: "Nhất ẩm, nhất trác giai do tiền định", nghĩa là một bữa cơm, một lần cãi cọ đã được định trước do tiền định. Theo những lý thuyết khoa học lớn nhất, phổ biến nhất, các nhà bác học cho rằng: Mọi việc ở đời xảy ra đều có tương tác lẫn nhau và được lập trình từ trong hệ thống, còn cái ngẫu nhiên xảy ra chỉ có tỉ lệ một phần tỉ.

Vậy thì một đôi đang yêu nhau say đắm, tức là họ đã từng gặp nhau, từng quyến luyến, từng hẹn hò, rồi yêu nhau, cả một chuỗi sự kiện như vậy chẳng phải là duyên phận đó sao? Không có cái duyên với nhau, làm sao anh chàng có thể có cơ hội để đôi môi mình hút vào môi cô nàng?

Và toàn bộ nhân duyên đó chẳng lớn hơn cái duyên bấm ngón tay tí - sửu - dần - mão của ông thầy bói sao? Người Trung Quốc là bậc thầy bề khoa duyên số đã từng nói: "Có duyên một kiếp ngồi chung thuyền, có duyên trăm kiếp chung chăn gối". Vậy khi đôi trai gái đã hẹn hò yêu đương đang chẳng có duyên từ nhiều kiếp hay sao, tại sao lại dễ dàng nghe vài từ "mèo vồ chuột" để mất duyên của mình đi?

Bây giờ đi sâu vào nghề bói toán, chúng ta sẽ bàn, ai trong nghề thì đều hiểu sâu xa rằng: "Dao sắc không gọt được chuôi" nghề thầy bói nào chẳng thấy:Tử vi xem bói cho người/Số thầy thì để cho ruồi nó bâu

Nào, thầy bói là người biết xem tí - sửu - dần - mão chứ gì? Sao thầy không xem cho mình được phát tài, lấy vợ đẹp, đẻ con khôn? Mà số thầy nghèo đến mức tay bị tay áo đi xin từng nắm xôi? Ở Trung Quốc ai xem tử vi giỏi như Khổng Minh, vậy mà ông đã chọn lấy cho mình một cô vợ xấu "vượng phu - ích tử" thế mà các con của ông có tránh được thảm họa đâu.

Còn về số phận thì chúng ta hãy xem các nhà bác học: "Hổ ăn thịt hươu. Nhưng ở cánh rừng nào đàn hươu giảm sút thì số lượng hổ cũng giảm theo, vì chúng không có thức ăn để ăn. Nghĩa là tuy hổ ăn thịt hươu nhưng nó cũng săn bắt cách nào đó để tạo sự cân bằng, đàn hươu còn thì hổ mới còn. Trong cuộc sống thì sao? Mèo vồ chuột, nhưng tại sao cả triệu năm rồi chuột vẫn còn trên trái đất? Đâu có phải cứ có mèo thì chuột phải chết. Mèo nhìn chuột thì thèm nhưng làm sao vồ được! Và thế không có chuột thì gia chủ chắc gì đã nuôi mèo?

Còn Kim khắc Mộc ư? Đó là thầy bói i tờ vì phi kim bất thành mộc. Không có kim khí để cưa, đẵn và đục thì gỗ không thể thành tủ, thành bàn được. Cũng vậy, thủy khắc hỏa, nhưng không có lửa đun nước, nước không thể luộc chín đồ ăn... Vợ chồng cũng vậy, những đôi tương khắc - tương sinh thì mới thành đạt nhiều. Chẳng hạn, anh chồng kia mải vui đi hát "karaoke hoài", vợ dằn vặt cho phải bỏ hát mới lo học hành, đến ngày công thành danh toại là có công của vợ; trái lại nếu cô vợ không "khắc" chồng muốn làm gì thì làm, thì sau nhiều năm anh chồng cũng chỉ là thứ ca sĩ trong quán karaoke rộng chừng mười mét vuông mà thôi.

Vậy còn những người yêu nhau mà không hợp số phải tan đàn xẻ nghé thì sao? Chính Hoàng đế Na-pô-lê-ông đã từng học biết rằng: Người ta phải sống tận cùng số phận của mình. Người Trung Quốc bảo đó là: Duyên nợ. Tức là nếu bạn không chịu trả nợ cho mối tình đó, bạn sẽ chẳng bao giờ được lật trang cho một tình yêu mới, vì trang cũ còn chưa lật qua, bao giờ mới đến trang mới.

Khi nghe tiếng đạn nổ, một người lính chúi đầu sợ hãi, Na-pô-lê-ông đi qua và bảo: "Này anh bạn nếu có viên đạn nào đó giành cho bạn, thì bạn có chúi đầu xuống nó vẫn tìm đến bạn". Vậy thì bạn hãy tung tăng mà yêu đừng quá lo nghĩ gì về duyên phận, vì nếu có một duyên phận ngang trái giành cho bạn thì dù có tránh nó vẫn vồ lấy bạn, như người Việt bảo: "Cái duyên cái số nó vồ lấy nhau". Nếu nó là duyên đẹp thì bạn sẽ được tận hưởng cuộc sống, còn là duyên nợ thì đó chính là cách bạn trả nợ để đầu tư cho một mối tình khác đẹp hơn. Trên thế giới ngày nay đang có ngót hàng tỉ người "trả nợ" để đóng góp cổ phần cho hạnh phúc mới của mình hay sao?

Vậy khi tình yêu đang đẹp bạn đừng có mê tín dại dột mà nhảy cầu. Hãy nhớ, nếu bạn biết cách tin vào số mệnh thì dù làm thế này hay thế kia cũng chẳng tránh được số mệnh đâu. Vậy thì có dốt nát không khi ta định nhảy cầu để tìm cho mình một số phận khác?