Archive for August, 2007

Aug
31
Filed Under (Microsoft) by Ernest Luk on 31-08-2007

Do you want to have your own customized logon screen with your logo for Microsoft Windows?

Here is how to do it. When you log on Windows XP/2000, it uses the default Graphical Identification and Authentication (GINA) file msgina.dll. You can change some of the items in this file, including the top portion of the logon screen (i.e., the logo). You can use several utilities to modify the file; I chose Resource Hacker (ResHack.exe), available at http://www.users.on.net/johnson/resourcehacker.

Before you start, double-click the My Computer icon on your desktop. From the File menu, select Tools, Folder Options. Click the View tab. Then, select the Show hidden files and folders option and clear the Hide protected operating system files (Recommended) option. Next, backup the msgina.dll file. Finally, install Win2K’s Recovery Console for fast access to the recovery options in case you have a problem. (To install the Recovery Console, run \install_source\winnt32 /cmdcons.)

To begin the modification process, copy msgina.dll from  System32\msgina.dll to \Winnt\System32\msgina2.dll. Create and save the bitmap you want to load. (Win2K Pro’s original bitmap attributes are 413 x 79 pixels, so you need to match this size.)

Use ResHack.exe to open msgina2.dll and navigate to bitmap 101, language 1033. (Note that only Win2K Pro systems use this bitmap. For Win2K Server, Win2K Advanced Server, and Windows NT Server , go to bitmaps 101-114, language 1033. Also, each OS uses different bitmaps during different parts of the logon process.)

From the File menu, select Action, Replace bitmap. Make sure that the bitmap you replace corresponds with the entry under Select bitmap to replace, on the right-hand side of the window. Save the msgina2.dll file and apply the change.

A registry setting identifies the name of the GINA; when this registry setting is missing, the OS uses msgina.dll. Use a registry editor e.g., regedit, to add the registry subkey

HKEY_LOCAL_MACHINE\SOFTWARE\
    Microsoft\WindowsNT\CurrentVersion\Winlogon\Ginadll

and set the value to msgina2.dll. (Note that some third-party programs such as Lotus Notes and Symantec’s pcAnywhere also change the GINA file. Make sure to check which version of the file you need.)

To check your new entry, run regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Ginadll. You must reboot the machine for the change to take effect, although you’ll notice the change on the logoff screen. To revert to the Win2K logo, simply delete the registry subkey you created.



Aug
30
Filed Under (Web Hosting) by Ernest Luk on 30-08-2007

Registrar Specific Instructions for Obtaining Transfer Authorization Code (Auth Code)

If you want to transfer your .com. .net, .biz, .us, .org or .info domain, you will need to contact your current registrar and request the domain’s Authorization Code (also referred to as an auth code, Authinfo code or an EPP code). An authorization code is usually a 6- to 16-character code assigned by the registrar. Authorization codes are basically a password for the domain serving as an extra security measure. The auth codes ensure that only a domain owner can make domain name transfers. The Registry requires the Auth Code so for .BIZ, .US, .ORG, and .INFO domains you will not be able to continue a transfer until you are able to get the Authorization Code from your current registrar. You should obtain your domain’s Authorization Code before initiating a domain transfer request.

Simply follow instructions listed below for that particular registrar to obtain your domain name’s authorization code.

If your registrar doesn’t have a an article on Authorization Codes or Auth Codes, email your existing registrar’s customer support from the domain’s administrative contact address and request your Authorization Code or Auth Code for a particular domain name. If you are told a .ORG, .BIZ, .INFO, .US or .NAME domain name does not have an authorization code, then the registrar is mistaken. Be persistent! Registrars are contractually required to provide auth codes upon registrant request.

Current registries assigning auth codes are: Verisign (the .COM and .NET Registry), Public Interest Registry (the .ORG Registry), Afilias (the .INFO Registry), NeuLevel (the .BIZ Registry), and NeuStar (the .US Registry). Auth codes provide an extra level of security for your domain names.

Registrars
4Domains.com
For this registrar, Auth Code is simply your domain management password.

Address Creation
Email technical support at support@addresscreation.com from domain’s administrative contact email address requesting domain’s Authorization Code.

AIT Domains
Send a transfer request via an online support ticket initiated at http://aitdomains.com/tickets.htm. Request that they send domain’s Authorization Code.

AW Registry
Email registration support at support@awregistry.net from domain’s Administrative email address requesting a domain’s Authorization Code.

BulkRegister.com
Email domainsupport@bulkregister.com from domain’s ‘Admin’ contact. If reseller is listed as ‘Admin’ contact, call or email reseller and ask for your domain’s Authorization Code (Auth Code).

Directi.com

Login to Control Panel at http://manage.directi.com/customer
Go to Domains » Search » Domain Registration Search, and search for domain name that you wish to transfer away.
In the Orders List View that appears, click on the Domain Name.
On the next page you would find the "Domain Transfer Secret" which is what Directi calls the Authorization Code.

DirectNIC.com
Login into account at https://secure.directnic.com/myaccount/. Submit a Trouble Ticket requesting domain’s Authinfo code. Authorization code is usually first three letters of a domain and the domain id (available by searching for your domain at Registry operator’s whois site).

Domain Monger
Create a support ticket at http://manage.domainmonger.com/contactus.html requesting your domain’s Authorization Code (Auth Code).

Dotster®

Log into your account at http://www.dotster.com.
From the Quick List, click on the Domain Name you wish to transfer
Scroll down to bottom of Domain Detail Page, click "Request Transfer Authorization Code" link to obtain the Auth code. It will be sent to domain’s administrative contact email address within minutes.

EnCirca
EnCirca requires registrants to set the auth code themselves. To set an auth code, simply login to your account at https://www.encirca.biz/myaccount/ and modify the domain by selecting the ‘modify domain’. Enter your desired auth code into "Authorization Info" box, select ‘continue’ and then ‘commit’ to save your changes.

eNom®

Login to eNom account at http://www.enom.com/Login.asp
Choose menu option DOMAINS, my domains
Click on the link for specific domain name that you wish to work with which brings up the domain control panel.
On domain control panel, scroll down to UTILITIES, click » Contact/WhoIs Information option.
At the bottom of the contact info page you will see the domain name authorization key.
If you do not have a direct eNom account, contact your reseller to obtain a domain’s Authorization Code. If reseller’s name is unknown, go to the eNom "help" page at http://www.enom.com/help/ and enter your domain name in the "Reseller Information Retrieval Tool."

Joker.com

Log in at http://www.joker.com.
Browse to the service zone for a domain.
Request "AUTH-ID"

Melbourne IT
Email das@melbourneit.com.au with Domain Name, Registry Key, and request Auth code. Authorization Code will be sent to ‘Admin’ email contact.

Names4Ever.com
Transfer Auth Code is your Names4Ever.com account password.

NamesDirect
Log into account at http://www.namesdirect.com/manage/.
In the Quick List, click on the domain name you wish to transfer.
Scroll down and click "Request Transfer Authorization Code" link near page bottom to obtain domain’s Auth code. It will be emailed directly to domain’s administrative email address.

NameScout
Send an email message to service@namescout.com from the domain owner’s email address as it appears in their records (consult Whois). In the request, list your domain names and ask that your authorization codes be sent.

Name Secure
Please contact NameSecure Customer Service with a list of your domain names requesting they provide your domain authorization codes.

NameZero
Log into account at http://www.namezero.com/login.php.
Click on the Domain Name you wish to transfer.
On Domain Detail page, scroll down to bottom and click "Request Transfer Authorization Code" to obtain domain’s Auth code. It will be e-mailed to the domain’s administrative email address on file.

Network Solutions®
Call Network Solutions 24 hour support line at (888) 642-9675. Request the Authorization Code for a particular domain. They will send authorization code to the domain’s ‘Admin’ contact email address.

Register.com
Login to your account at http://mydomain.register.com/. Within Account Management, click on a Domain Name to view its details. It’s Auth Code is listed on the domain details page.

RegisterFly.com - Losing ICANN Accreditation
Registrants at RegisterFly.com should be aware that ICANN has issued a formal notice of termination of RegisterFly.com’s Registration Accreditation Agreement (RAA). ICANN has issued a letter to RegisterFly indicating that it will cease operating as an ICANN-Accredited Registrar on March 31, 2007. » More on RegisterFly.com Pending Termination | » Consult ICANN’s RegisterFly.com FAQ | » Latest News on RegisterFly (courtesy Google News)

Complete the following steps to be able to gain auth code and unlock a domain at RegisterFly.com.

Log into your RegisterFly.com account at https://registerfly.com/scripts/login.php
Click on total domains
Click on the domain for which you require auth code
It will say locked at the domains properties click on it to unlock the domain.
Click on domain contact information (plus sign)
Press configure
On the next page will be to see the auth code for the domain at the bottom of the page.
Please also remove the protect fly for the transfer of domain.
If your control panel shows no auth codes or shows “RRP” or doesn’t allow you to log in or doesn’t show all of your domain names, you will need to contact RegisterFly. Several customers have reported successfully getting auth codes by submitting a support ticket with the appropriate subject (requesting an auth code or unlocking a domain ). Registerfly has also indicated that this is the best way to get auth codes. The average turn-around time is 1-3 days. If you are unable to submit a support ticket, write to compliance@registerfly.com . In your email, include the following:

All domain names affected;
Your registerfly account name;
Email address associated with your registerfly account; and
A brief explanation of the specific problem (in other words, say “I can’t get auth codes from the control panel,” or “I can’t unlock my domain name in the control panel,” or “I can’t log into my control panel” etc.). 

Stargate
Login to your account at https://www.stargateinc.com/us/account/login.asp. Click on the link "Get AuthInfo Code."

Tucows Open SRS
Auth code located in account within the Domain Details at http://manage.opensrs.net. Obtain Username and password from reseller.

Verio
Request your domain’s Authorization Code by sending an email to domreg@verio-hosting.com from ‘Admin’ contact. They will send the Auth Code.

Yahoo! Domains
Sign in to your Yahoo! Business Control Panel (you’ll be prompted to enter your Yahoo! ID and password if you haven’t already done so).
Click the "Domain Control Panel" link under your domain name.
On your Domain Control Panel, click "View Your Authorization Code."
Note: If you’re a Yahoo! Website Services customer, you won’t see this task. To retrieve your authorization code, you must contact Yahoo.

On the following page, you’ll see your domain’s unique authorization code. We recommend printing this code for your records, as you’ll need to provide it to your new registration upon transfer. 

Once you have your Auth Code
Once you have obtained your auth code and initiated the transfer request, you will be required to enter your Auth code for .BIZ, .INFO, .US and .ORG domains during the transfer process. You will be able view the status of your transfer on our Registrar Transfer Status page within your account.



Aug
10
Filed Under (OSCommerce) by Ernest Luk on 10-08-2007

There’re some basic tips to optimize the performance of your OSCommerce powered store front.

IMAGES
It’s important that you have dedicated thumbnail size picture for an item instead of doing it "on the fly" as it decreases server load tremendously. Alternatively, you can use automatic thumbnail generator with cache features. The effects may not be noticeable on a store with 1 or 2 visitors per hour but if you do any kind of serious volume you will defitely want to cache the images. if you’ve spent the server resources to create the thumbnail image why not store it and use it later instead of creating it again?

CONTRIBUTIONS
Install ONLY the ones that you need to operate and ONLY the ones that will either save time or add value to the shopping experience. What contributions will fit these requirements will depend on the type of store you have and products for sale. Each contribution you install will add overhead to process the logic whether it be pure PHP code or MySQL queries (or both). As a rule of thumb, KEEP THE NUMBER OF CONTRIBUTIONS INSTALLED TO A MINIMUM. Too many times a store owner will go contribution happy and install every toy possible. This adds tremendous bloat to the code base and performance suffers. The intent was to make a better shopping experience but the net effect is to DECREASE the experience due to slow loading pages.

REMOVE FEATURES NOT USED
There are several features of stock osCommerce that stores may or may not use that would help performance if removed. For example: banners, "requests since" / counter footer display, who’s online, etc.

If you don’t use the features remove (comment out) the code.

Another benefit of eliminating those features is that it prevents a store from using the MySQL query caching features. On each insert the cache is flushed. Of course, this also means storing the sessions on the filesystem!

STS - Simple Template System
It is one of the worse offenders for queries and is also one of the more popular template systems available for osCommerce. If you have a significant number of categories on your store this contribution will kill your page performance. It performs a full table scan on each page request. If you have more than a few hundred categories it will increase your page load time by 200-300% based on server specifications.

In short, if you want speed don’t use a template system. Learn to modify the monolithic application that is osCommerce.

SESSIONS
If you store the sessions in the database consider adding a (primary) multi-column index on sesskey and expiry columns. This will take up more physical space but will be much faster and will be a const query type.

CACHING - Stock Code and Page Cache
The ability to cache data is very important to performance, especially if you have a large number of categories, products, and/or orders. It’s recommend creating a directory ABOVE the publicly accessible document root and giving it proper permissions for the server read/write. Creating it ABOVE the document root ensures that would-be hackers cannot access it with their web browser. Set your cache directory settings to this filepath to keep it from being stored in the "/tmp" folder which will cause issues.

Once you have the cache folder created and settings configured TURN ON THE CACHE FEATURES. This is especially effective with the category box!

The Page Cache contribution  was created for those stores that have so many contributions installed it would be nearly impossible to optimize the code. The correct answer is to not bloat the store with contributions that are not needed, but if you find yourself in that position then Page Cache may be for you. Use the Page Cache contribution as a last resort, not as a first line choice.

COMPRESS YOUR PAGE OUTPUT
Most are aware of page compression via GZIP. The optimal setting is compression level 1 for speed as higher levels will not result in signifant reduction of page size. However, a quick trick is to phyically compress the data being GZIP’d by removing extra whitespace and line breaks.

Here is the function can be used:

Code:
function compress_buffer ($buffer) {
 # Return the compressed buffer
 return str_replace("\n", ‘ ‘, preg_replace(’/\>\s+\</’, ‘> <’, $buffer));
}

Of course, this is offered as a starting point for you and you’ll have to figure out how to use it in combination with GZIP.

The physical page compression with GZIP compression will reduce the output HTML code by some 60-75% and will dramatically increase page performance especially on dial connections.

CODE / QUERY OPTIMIZATION
The fact is that every store is different. They all start with the same code base but each store installs different contributions which results in great variation as to which code needs to be optimized.

A good starting point would be to install a per page query output contribution. This will allow you to see which queries are being executed on a per page basis and easily identify those that are redundant or taking excessive time to execute. Once you pinoint what needs to be done it’s easier to actually do it. Never perform ANY optimization blindly. ALWAYS modify code for a purpose. Sounds like common sense? You would be surpised.

Once again, this won’t approach specific contribution optimizations but will only discuss those that are common to every osC store. One such contribution is an abstraction of the MS3 tax class for MS2. This replaces the stock MS2 tax code with the new tax class for MS3 which is much more efficient and uses less queries per page. The tax query is EXECUTED ON EACH PRICE DISPLAY EVEN IF THE SETTING TO DISPLAY TAX IS DISABLED. It’s important to know that fact since most think if they turn off the option in the admin control panel it will not query for the tax. This is false and even if the setting is turned off it will STILL RUN THE TAX QUERY. Why is this important? Because the tax query is one of the most server intensive queries for all of osCommerce! For a 2 minute install it will increase the page performance / server load tremendously.

The also_purchased module (product info pages) is a powerful upsale tool however, it is the absolutely most server intensive query for the osCommerce application. This is especially true for those stores that have a significant number of products and orders. This would bring a dual 2.8 Ghz CPU, 1GB RAM server to its knees, by just running that 1 query. As you accumulate more orders you will get a feel for which products would be ideal cross sell items and thus it would be advisable to install a X-Sell contribution. It may be a bit more work to maintain but the increase in product page performance is well worth the effort.

On each page request the contents of the configuration table are loaded as define statements. The implication of this is that on each page request the server must perform a table scan to generate the data, which depending on how many contributions you have installed will add overhead to each page load. An excellent contribution that addresses this issue is Faster Page Loads, Less DB Queries. This contribution caches the data and eliminates the database query, thereby saving the table scan for when the cache is not present. This contribution is HIGHLY recommended.

This post is not meant to be a difinitive guide to optimizing an osCommerce store but will hopefully give you a few pointers as to which areas should be addressed as a priority to your optimizination efforts.

Source: http://forums.oscommerce.com/index.php?showtopic=144736



Aug
08
Filed Under (Linux) by Ernest Luk on 08-08-2007

If you want to customize the error message to a vistor for a page was not found on your server, you can do it by adding following page to the .htaccess file.

ErrorDocument 404 /index.php

this line will redirect visitors to the /index.php on your server.



Aug
08
Filed Under (Linux) by Ernest Luk on 08-08-2007

To prevent people from linking to the images on your server that abusing your bandwidth, you can use the mod_rewrite module to filter the unauthorized requests.

1. Activate Protection

Add the following lines to your .htaccess file to stop people from hotlinking to your .gif and .jpg files.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?your_domain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
 

Replace your_domain.com with your domain name.

This starts by turning on the rewrite engine. Next, it checks the referer (where the request comes from).

If it did not come from your domain name and it is a request for a .gif or .jpg file, it will output an error message. Otherwise it will display the image as usual.

You can apply this with other file extension.



Aug
08
Filed Under (Linux) by Ernest Luk on 08-08-2007

When a web browser is pointed to a directory on your web site which does not have an index.html file in it, the files in that directory can be listed on a web page.

1. Enable/Disable Directory Listing

To have the web server produce a list of files for such directories, use this line,

Options +Indexes  

To have an error (403) returned instead, use this line.

Options -Indexes 
 

2. Listing Style

You can list file in  basic list style or fancy list style. A ‘fancy’ list including icons, file size, modification date and more. Following line is used for ‘fancy’ list style in the .htaccess file,

IndexOptions +FancyIndexing  

Use following line if you prefer a basic file list.

IndexOptions -FancyIndexing  

3. Ignore Files

If you don’t want the web server to list files with exention such as *.txt,*.jpg. Add this line to your .htaccess,

IndexIgnore *.txt *.jpg  

4. Modify Index File

To change the default index file, use this line

DirectoryIndex home.html  
 



Aug
08
Filed Under (Uncategorized) by Ernest Luk on 08-08-2007

This is my first blog. I use this blog to file technical tipbids that helped me to resolve problems and acquire knowledge. I would like to share it with you, please feel free to leave me your comment.