Tutorials in ‘Internet’ Category

Enable URL autofill in Firefox

A little thing that bugs me about Firefox is that when you start typing an URL in the address bar there is no autofill:

However, Mozilla have again predicted that I and other people will whine about that and have actually added this feature, but have disabled it by default. In this short tutorial we will show you how to enable it.
First, open Firefox:

In the address bar enter about:config:

Hit Enter. Firefox will warn you to be careful, as you are about to open the configurations to your browser:

Click the I’ll be careful, I promise! button. The configuration page will open:

In the Filter textbox enter autofill:

Here you can see the browser.urlbar.autoFill setting. It has the value false. Simply double-click on the row it is to change it to true:

Close the window and try to type an address in the address bar:

VN:F [1.9.18_1163]
Rating: 4.0/10 (3 votes cast)

How to forbid downloading files with Internet Explorer

Assuming that if a user of a given machine has chosen Internet Explorer as his/her browser, one can conclude that the user is not quite aware of hat he/she is doing. So just to be safe, it may be a good way to prevent the user from downloading any files from Internet if he/she is using IE.
Naturally, to force such a strange behavior we will use a good old registry tweak. First, we will open the Registry. Open the Start menu and enter regedit in the start menu searchbox:

and hit Enter. The Registry Editor will open:

Using the left-hand pane, navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3:

Note: The next step is optional as the value 1803 may already exist.
On the right-hand pane click anywhere except the Name column and select New > DWORD (32-bit) Value:

Name the new value 1803:

Double-click on it and a window will open. Enter 0 in the Value data textbox:

Click OK and close the Registry Editor. To revert to your old settings simply delete the value 1803.
Note: This trick works for IE 6 through 9.

VN:F [1.9.18_1163]
Rating: 4.0/10 (2 votes cast)

Disable favicons in Firefox

Favicons are the little icons that appear on each tab in your browser. Although they can help you find which site you have opened in a given tab, when you have a lot of tabs opened, they can really, really annoy you if the site designers have decided that a blinking favicon is the way to go. That is why, Firefox allows users to disable favicons in a rather easy way.

Open Firefox and enter about:config in the address bar. Firefox will warn you that you can really mess things up if you are not careful.

Click the I’ll be careful, I promise! button and the configurations will open:

In the Filter textbox enter browser.chrome.favicons:

Double click on the browser.chrome.favicons preference to set its value to false:

Do absolutely the same for the browser.chrome.site_icons preference:

Restart Firefox and you are done.

VN:F [1.9.18_1163]
Rating: 7.0/10 (3 votes cast)

Set different download locations for different filetypes using Opera

There is one thing about most browsers that really annoys me. It’s related to the download location. First of all it can take you half an hour to find how to change the default download location and after you find it you realize that you can setup only one download location for all types of files. Now this may seem a bit nitpicky, but when you download a lot files you certainly expect a little more sophisticated behavior from your browser. Of course you could always use a download client, but considering how advanced are our browsers it is kind of ridiculous to use such a client nowadays.

Introducing Opera’s download settings – a browser that lets users set their default download location for each filetype. In this short tutorial we will show you how to do just that.

First of all open Opera, click on the Opera button select Settings > Preferences:

Note: Alternatively, you can use Ctrl + F12.

A new window will open:

Navigate to the Advanced tab:

Select Downloads in the left-hand pane:

Here you can see a list of recognized files (listed with their MIME types) and the default download folder. However you can easily set a folder of your choice. Select a file type and click the Edit button. A new window will open:

Here you can directly choose the appropriate behavior for that file, including whether to be saved, opened with Opera, opened with a plug-in, opened with an application of your choice or saved to a specific location. To set a specific location for this kind of file, simply select the Save to disk radio button, check the Do not ask for folder, but save directly to option and choose the appropriate directory:

Click OK and click OK in the Preferences window.

VN:F [1.9.18_1163]
Rating: 6.7/10 (3 votes cast)

Enable on-demand tab loading in Firefox 8

Modern day websites and browsers are not very friendly to slow computers with little memory. However this is “by default”. There are a lot of fine tunings that you can make to a browser, which will improve its performance and your overall experience. One common source of badly utilized memory is all those tabs that you keep open from previous sessions instead of bookmarking them as Read later. But, Firefox 8 provides a mechanism for tackling exactly those tabs. Instead of loading them on startup, you can set Firefox to load them on-demand, that is, when you first click on them. In this short tutorial we will show you how to enable this feature in Firefox 8.

Open Firefox, click the Firefox button and select Options:

A new window will open:

Select the General tab:

In the When Firefox starts dropdown menu select Show my windows and tabs from last time. Also, enable the Don’t load tabs until selected option:

Click OK. Next time you reopen Firefox your tabs will not be preloaded.

VN:F [1.9.18_1163]
Rating: 10.0/10 (1 vote cast)

How to setup Apache HTTP and HTTPS virtual hosts

Virtual hosting is a way of hosting several servers on a single machine. This technique is widely used in shared web hosting, because it greatly reduces hosting costs, since multiple customers use one server.

There are three types of virtual hosting:

  • Name-based – when the virtual hosts is determined by its domain. A problem with this approach is that it is completely dependent on the DNS.
  • IP-based – when each site is differentiated via his IP. A natural complication is that this requires a different IP for each site.
  • Port-based – when each site is described with the same domain, but different port. Naturally, the problem that users don’t generally use ports arises. Additionally, some firewalls block uncommon ports.

Using Apache, we will setup two name-based virtual hosts – an HTTP one and an HTTPS one. Both will work on the standard ports 80 for HTTP and 443 for HTTPS. Naturally we will see how to set port-based hosts.

Note: This tutorial assumes standard file places and settings for Apache on CentOS.

Note: The goal of this tutorial is not to provide extensive knowledge on configuring virtual hosts, but to provide a general-purpose working configuration. For more find-tuned configurations refer to the Apache documentation on virtual hosts.

We assume that <domain> is the domain for our virtual host. In the httpd/conf.d directory (usually /etc/httpd/conf.d) create a file called <domain>.conf

Note: It is not necessary to call your file <domain>.conf, but it’s a sort of a convention and makes editing hosts easier. The file for the HTTP virtual host should contain:

# <domain> HTTP Virtual Host
<VirtualHost *:80>
    # General
    ServerAdmin <administrator_e_mail>
    DocumentRoot /var/www/html/<domain>
    ServerName www.<domain>
    ServerAlias <domain>
 
    # Logging
    ErrorLog logs/<domain>-error_log
    CustomLog logs/<domain>-access_log common
</VirtualHost>

<administrator_e_mail> is the e-mail of the site administrator. After you set this file restart the HTTP Server daemon:

service httpd restart

To setup an HTTPS virtual host, again create the <domain>.conf file in the /httpd/conf.d. Again we assume <domain> is the domain-name:

# <domain> HTTPS Virtual Host
<VirtualHost *:443>
    # General
    ServerAdmin <administrator_e_mail>
    DocumentRoot /var/www/html/<domain>
    ServerName www.<domain>
    ServerAlias <domain>
 
    # Logging
    ErrorLog logs/<domain>-ssl_error_log
    TransferLog logs/<domain>-ssl_access_log
    CustomLog logs/<domain>-ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    LogLevel warn
 
    # SSL Engine
    SSLEngine on
 
    # SSL Protocol
    SSLProtocol all –SSLv2
 
    # SSL Cipher Suite
    SSLCipherSuite LL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
 
    # Server Certificate
    SSLCertificateFile <path_to_certificate>
 
    # Server Private Key
    SSLCertificateKeyFile <path_to_private_key>
 
    # SSL Engine Options
    <Files ~ "\.(cgi|shtml|phtml|php3?)$">
        SSLOptions +StdEnvVars
    </Files>
    <Directory "/var/www/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
 
    # SSL Protocol Adjusments
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown owngrade-1.0 force-response-1.0
</VirtualHost>

Of course, after setting this, restart the HTTP daemon:

service httpd restart

It is easily noticeable, that you can setup port-based virtual hosts quite easy, by using the same domain, but different ports in the .conf file.

Naturally this tutorial is not exhaustive, as such tutorial will be pretty much equal to documentation (which you can find here).

VN:F [1.9.18_1163]
Rating: 7.0/10 (2 votes cast)

Creating and signing certification requests using OpenSSL

In our previous tutorial about creating your own Certificate Authority, we introduced OpenSSL – an open source commercial-grade toolkit, which implements SSL and TLS (Secure Sockets Layer and Transport Layer Security) and provides a general purpose cryptography library. Naturally we continue with creation of certification requests (also called Certificate Signing Request).

Note: In this tutorial (as well as in the previous one) we assume CentOS is the OS of choice.

To create a certificate request we navigate again to /etc/pki/CA:

cd /etc/pki/CA

Now let’s create the certification request. We’ll request a certificate, which will last one year:

openssl req -config openssl.cnf -new -nodes -keyout private/<domain>.key -out <domain>.csr -days 365

Generating a 2048 bit RSA private key
..............................+++
.................................+++
writing new private key to 'private/<domain>.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:<country>
State or Province Name (full name) []:<state>
Locality Name (eg, city) [Default City]:<city>
Organization Name (eg, company) [Default Company Ltd]:<organization>
Organizational Unit Name (eg, section) []:<department>
Common Name (eg, your name or your server's hostname) []:<url>
Email Address []:<email>
 
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

This creates two files, <domain>.key, which is the private key and <domain>.csr, which is the Certificate Signing Request. Restrict the rights to the private key so it readable only by root and the user that will use it:

chown root:globus private/<domain>.key

chmod 0440 private/<domain>.key

So now that we have created the certification request it is time to sign it. Navigate to /etc/pki/CA:

cd /etc/pki/CA

Sign the certificate using this command:

openssl ca -config openssl.cnf -policy policy_anything -out certs/<domain>.crt -infiles <domain>.csr

Using configuration from openssl.cnf
Enter pass phrase for ./private/ca.key:<ca_password>
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Nov 15 18:52:08 2011 GMT
            Not After : Nov 14 18:52:08 2012 GMT
… CERTIFICATE INFORMATION …
Certificate is to be certified until Nov 14 18:52:08 2012 GMT (365 days)
Sign the certificate? [y/n]:y
 
 
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

After that, you need to remove the certificate request:

rm -f <domain>.csr

After the whole procedure two files are created. <domain>.crt – this is a domain specific certificate for the request. It is put in the certs directory. <certificate_number>.pem is the second file. It is put in the newcerts folder. This is a ready to use X.509 file which contains the information from <domain>.key and from <domain>.crt.

VN:F [1.9.18_1163]
Rating: 0.0/10 (0 votes cast)

Create your own Certificate Authority using OpenSSL on CentOS

OpenSSL is an implementation of the SSL and TLS protocols. It is open-source and is the de-facto standard toolkit for Secure Sockets Layer (SSL) and Transport Layer Security (TLS). It is written in C and also contains a general purpose cryptography library. Being written in C allows for various wrappers for other programming languages to exist.

Installing OpenSSL on CentOS is actually quite easy. All you have to do is enter the following command:

yum install openssl

Note: Depending on your installation configurations OpenSSL may already be installed on your system.

Note: This tutorial uses OpenSSL 1.0.0.

After we install OpenSSL, we need to setup our own Certificate Authority. To do so we first navigate to /etc/pki/CA:

cd /etc/pki/CA

Now we will make a directory where our certificates will be stored:

mkdir certs

Another necessary directory is for the revocation list:

mkdir crl

Note: crl stands for Certificate Revocation List.

Now we must create a directory for storing the unencrypted certificates:

mkdir newcerts

Next, create an empty file index.txt (you may use touch). The index.txt file is the database for certificates. Additionally, create two files containing the next serial number for a certificate and the next serial number for the revocation list:

echo ’01’ > serial

echo ’01’ > crlnumber

Almost ready. Copy the standard openssl config file to you current directory:

cp /etc/pki/tls/openssl.cnf openssl.cnf

And edit the config file (the one stored at /etc/pki/CA/openssl.cnf):

Change this line:

dir             = /etc/pki/CA           # Where everything is kept

to

dir             = .           # Where everything is kept

Change this line:

certificate     = $dir/cacert.pem       # The CA certificate

to

certificate     = $dir/certs/ca.crt       # The CA certificate

And this line:

private_key     = $dir/private/cakey.pem# The private key

to

private_key     = $dir/private/ca.key # The private key

And last, but certainly not least, make /etc/pki/CA/openssl.cnf readable only for you:

chmod 0600 openssl.cnf

After that, the process of creating a certificate authority is actually quite easy. Navigate to /etc/pki/CA:

cd /etc/pki/CA

Enter the following command:

openssl req -config openssl.cnf -new -x509 -extensions v3_ca -keyout private/ca.key -out certs/ca.crt -days 3650

if you want to create a CA valid for 10 years. You will be prompted:

Generating a 2048 bit RSA private key
........+++
.......+++
writing new private key to 'private/ca.key'
Enter PEM pass phrase:<password>
Verifying - Enter PEM pass phrase:<password>
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:<country>
State or Province Name (full name) []:<state>
Locality Name (eg, city) [Default City]:<city>
Organization Name (eg, company) [Default Company Ltd]:<organization>
Organizational Unit Name (eg, section) []:<department>
Common Name (eg, your name or your server's hostname) []:<common_name>
Email Address []:<email>

Where common_name is usually formed like ca.<your_domain>, and <email> is usually ca@<your_domain>

Finally, don’t forget to restrict the access to your private key:

chmod 0400 private/ca.key

For more on OpenSSL checkout how to create and sign certificates.

VN:F [1.9.18_1163]
Rating: 10.0/10 (3 votes cast)

How to change the number of suggestions in Firefox address bar

One thing I love about Firefox is the ability to tweak almost every aspect of your browsing experience. Another thing I love about Firefox is that once a tweak is discovered it remains valid in all the later versions. This little tweak I’m about to show you, I discovered in Firefox 3 and remains valid till this very day – Firefox 8.

So basically we will see how we can change the number of suggestions in the Firefox address bar:

And of course as a first step, type about:config in the address bar and press Enter:

Press I’ll be careful, I promise! and you will be redirected to a list of configurations:

In the Filter textbox enter browser.urlbar.maxRichResults

Double click on browser.urlbar.maxRichResults and you will be prompted to enter a new value (default is 12). Enter the new value:

And press OK. Close the about:config tab and you are done. You don’t even need to restart Firefox:

VN:F [1.9.18_1163]
Rating: 0.0/10 (0 votes cast)

Customize the Google country-specific search in Firefox

Perhaps you have noticed that by default google.com redirects you to a country-specific version of google based on your IP. This is extremely noticeable when you are travelling or using a proxy. We will see two solutions to the problem.

The first solution is to type http://www.google.com/ncr in your address bar. This sets a cookie in your browser, which on the other hand tells google not to redirect you. This solution however is not the best, since you completely disable the country-specific search and if you delete your browser cookies you will have to repeat the procedure.

Note: This solution is not Firefox-specific and can be implemented with every browser.

The second solution is a bit more elegant, as it allows you to use multiple country-specific versions of google search, it is not cookie based and it doesn’t change the default behavior of google.com.

The second solution utilizes the Firefox search bar:

By default all searches made from the search bar use google.com, however it can be extended to support multiple country-specific google flavors. Let’s show how we can modify it to use google.de as well.

Of course you may ask “What is the point of that? I can always type google.de in my browser”. True, but by extending the search bar, you can finally have a uniform way for doing searches, which makes searches a lot easier.

But let’s see how we can extend the Firefox search bar. Navigate to the searchplugins subdirectory of the Firefox directory (usually C:\Program Files\Mozilla Firefox\searchplugins). You can see several xml files there:

Copy the google.xml file to google.de.xml. Move google.de.xml to the Firefox profile folder\searchplugins (C:\Users\<your username>\AppData\Roaming\Mozilla\Firefox\Profiles\<your Firefox profile name>\searchplugins on Windows 7)

Now change google.de.xml in such way.

Old:

New:

You can see that we have changed the ShortName, the template argument of the second URL tag and the SearchForm.

Restart Firefox and now you can see Google.DE in your search options:

VN:F [1.9.18_1163]
Rating: 1.0/10 (1 vote cast)