Posts Tagged ‘tutorial’

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 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

<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
    # Server Certificate
    SSLCertificateFile <path_to_certificate>
    # Server Private Key
    SSLCertificateKeyFile <path_to_private_key>
    # SSL Engine Options
    <Files ~ "\.(cgi|shtml|phtml|php3?)$">
        SSLOptions +StdEnvVars
    <Directory "/var/www/cgi-bin">
        SSLOptions +StdEnvVars
    # SSL Protocol Adjusments
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown owngrade-1.0 force-response-1.0

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)

Change the Explorer startup folder in Windows 7

Normally when you open Windows Explorer via the button on the taskbar:

Explorer opens the Libraries by default:

Now, we find this rather strange and useless since the Libraries is not one of the most used directories. So in this short tutorial we will show you how you can change that behavior and choose a more appropriate folder as the default.

To change this, right click on the Explorer button in the Taskbar:

Right click on Windows Explorer and choose Properties:

A new window will open:

As you can notice the target of this shortcut is set to %windir%\explorer.exe

A better alternative to use as your default directory is Computer. To change the default directory to it simply enter %SystemRoot%\explorer.exe /E,::{20D04FE0-3AEA-1069-A2D8-08002B30309D} in the Target text field and click OK.

Now when you click the Windows Explorer button it will open Computer:

Note: Alternatively you can open Explorer properties from Start button > All programs > Accessories > right click on Windows Explorer > Properties:

Another alternative for the default folder of Windows Explorer is My Documents. To set it as default simply set the target to %SystemRoot%\explorer.exe /n,::{450D8FBA-AD25-11D0-98A8-0800361B1103}

Basically you can use any folder as long as you know its Globally Unique Identifier (GUID), but expect more on GUIDs in a different tutorial.

Note: If you want to have some fun, why not change your colleagues’ default location to the Recycle Bin – simply use %SystemRoot%\explorer.exe /E,::{645FF040-5081-101B-9F08-00AA002F954E}

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

Add Color To Black And White Image Photoshop Tutorial

In This Photoshop Tutorial Add Color To Black And White Image easily .this is very interesting photoshop tutorial easy to add color to black and white image in Photoshop few steps tutorial.

[ View Full Tutorial ]

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

How To Making Text photo In Adobe Photoshop Tutorial

How To Making Text photo In Adobe Photoshop Tutorial,In this Adobe Photoshop tutorial we are going to learn how to replace an image in text effect

[ View Full Tutorial ]

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

Editing images with IrfanView

IrfanView is small and very powerful software program for viewing, editing, converting, printing, scaning images. Read the rest of this entry »

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

20 Points about Synchronization in Java

In this Java synchronization tutorial we will see what is meaning of Synchronization in Java, Why do we need Synchronization in java, what is java synchronized keyword, example of using java synchronized method and blocks and important points about synchronization in Java. Synchronization in Java is an important concept since Java is a multi-threaded language where multiple threads run in parallel to complete program execution. In multi-threaded environment synchronization of java object or synchronization of java class becomes extremely important. Synchronization in Java is possible by using java keyword "synchronized" and "volatile”. Concurrent access of shared objects in Java introduces to kind of errors: thread interference and memory consistency errors and to avoid these errors you need to properly synchronize your java object to allow mutual exclusive access of critical section to two threads.

This Java Synchronization tutorial is in continuation of my article 10 tips on java logging , 10 points about java heap and Top 20 core java interview questions if you haven’t read already you may find some useful information based on my experience in Java Collections. synchronized keyword is re-entrant in nature it means if a java synchronized method calls another synchronized method which requires same lock then current thread which is holding lock can enter into that method without acquiring lock.

6. Java Synchronization will throw NullPointerException if object used in java synchronized block is null e.g. synchronized (myInstance) will throws NullPointerException if myInstance is null Read the rest of this entry »

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

Photoshop Masking Tutorial

One of Photoshop’s best forces is its effective image masking techniques such as Magnetic Lasso, Quick Mask, Magic Wand, Pen Tool, Color Range Feature and Background Eraser Tool. Some people like to mask a complicated image usually by following a simple route. Photoshop gives a color range features, allowing shifting a background without doubt.

In this tutorial, we’ll look at one simple technique for shifting a background by color range feature from menu in Photoshop. Color range feature is a quickly process to select an object from its background. But it does contain its bound and it creates a selection according to color. At this situation for an object needs different color than its background.

Now, see the step by step color range features using process to change a background in the tutorial. At first the final result has been shown in this tutorial by presenting the “before” and “after” image.

Access the file you wish to work with and create a duplicate layer of the image from menu. The reason for doing this is so you can preserve the original and work on the duplicate layer/ Remember to conceal the background by switching off the visibility icon.

From the menu, select >Color Range< when its dialog box opens, select the left “Eye Dropper Tool”. At this point you can click on the background color in the image window. This would automatically turn the selected color to white.

You’d need to adjust the fuzziness slider till the image appears mostly as a black image on a clear white background. To input a color to the selection, choose the eyedropper option with the plus (+) sign. Click on the image and select OK.

At this point, you should notice that the White background color has automatically been placed around the image. Click on the Delete key but be sure that you are working on the “background copy” layer. This way, nothing gets altered in the original. Read the rest of this entry »

VN:F [1.9.18_1163]
Rating: 0.1/10 (11 votes cast)

How to Round a Numeric Column to a Specified Decimal Count in SQL Server 2008 R2

This tutorial will show how to round a column to a specified decimal count. This is possible with the ROUND function. The ROUND function is used to round a numeric field to the number of decimals specified. It returns a numeric value, rounded to the length or precision specified by the programmer.

Setting Up

In this tutorial we will create a table called Products with columns of Prod_Id, ProductName, Unit, and UnitPrice. Prod_Id uses a data type of int, ProductName and Unit will be of the nvarchar data type, and UnitPrice will be of the float data type. To create a table in SQL Server, we use the CREATE TABLE statement.

Create a Products table.
Prod_Id int not null,
ProductName nvarchar(30) not null,
Unit nvarchar(30) not null,
UnitPrice float not null

Now that we have a table created, we can add data into it. To do this, we use the INSERT INTO, SELECT, and UNION statements. The INSERT INTO statement specifies what table and columns to insert values into, the SELECT statement is the data being inserted into the table, and the UNION statement prevents duplicates from being inserted into the table… Read the rest of this entry »

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

Creating Persistent Aliases in PowerShell

In this tutorial, you will learn how to create persistent aliases.

I’m sure creating temporary aliases has been fun and all, but let’s get more usefulness out of them by making them permanently available! In this tutorial, you will learn how to create persistent aliases.

If you have not already done so, click open Windows PowerShell ISE.

The Concept…
There really is no point in making something temporary unless it was meant to be temporary. Making a permanent alias is helpful and far more efficient. The best part about it is that all of this can be done by defining aliases in your profile script. Since the profile is executed every time you open a new PSH window, it’s the perfect location to define your aliases of choice so they’re immediately available to you the moment you open up PSH.

There are two commands that PSH has that will assist in making the aliases persistent. They are called Export-Alias (exports the alias information to a file) and Import-Alias. You can define the aliases on one system, export the alias definition and then distribute it to all the other systems.

Yes, it is possible to find a good web host. Sometimes it takes a while to find one you are comfortable with. After trying several, we went with Server Intellect and have been very happy thus far. They are by far the most professional, customer service friendly and technically knowledgeable host we’ve found so far.

Step one.
To export and import your aliases, run the following command sequence:
Export-Alias c:thealiases.txtImport-Alias c:thealiases.txt

Now, as a side note, by default the Export-Alias command overwrites the contents of a file it automatically created. If you wish to not overwrite, you can implement the noclobber parameter so the command returns an error if the file already exists.

The command is implemented as follows:
Code Block

Ask a Question

PSH Command

Export-Alias c:thealiases.txt –noclobber Also, there is the option to append to an existing alias file. This feature is great if you have aliases defined in various locations and are trying to consolidate them into a single file. Read the rest of this entry »

VN:F [1.9.18_1163]
Rating: 0.9/10 (11 votes cast)