Tutorials in ‘Operating Systems’ Category

How to force Windows 7 to use the entire available RAM

It is a little known fact that Windows 7 doesn’t use the entire available RAM by default. For example if you have 8GB of RAM and a 64-bit Windows 7, it will use around 7.1GB of it (in the case of 4GB of RAM and 32-bit Windows 7, it will use around 3.5GB). The reason for this behavior is not completely known, but it is quite possible to alter it – to force Windows 7 to use all available RAM.
How do we do this? First, open the Start menu and enter msconfig in the start search box:

and hit Enter. The System Configuration window will open:

Navigate to the Boot tab:

Click the Advanced options button. A new window will open:

In the BOOT Advanced Options window check the Maximum memory option:

Click OK to close the boot options dialog and another OK to close the System Configuration window.
Restart your computer for the changes to take effect:

VN:F [1.9.18_1163]
Rating: 7.7/10 (6 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)

Checking the sites your computer is connecting to in Windows

Have you noticed a sudden drop of your Internet speed? A possible explaination is that some nasty program is doing things behind your back. Whether it is spyware, malware or adware you might have a serious case of unauthorized traffic on your hands.

But don’t worry, it’s quite easy to get a list of your connections in Windows. Such a list may turn quite helpful and may help you find some unknown applications are using your bandwidth for their dirty bidding.

Naturally this list will be generated through the Command Prompt. First, open the Command Prompt under Administrator Mode. To do that, open the Start menu, type cmd in the search box:

Right-click on cmd.exe and select Run as administrator:

The command prompt will open:

Enter the following command:

netstat -fab 5 > connections.txt

Now, before we press Enter, let’s take a moment to look what exactly are we doing here. First of all netstat is a command that generates a lot of useful information about your network status. Additionally there are several options we can add to our netstat command, some of which are:

 -f – for displaying the full DNS name for hosts on the other side of each connection. This makes the generated data a lot easier to comprehend.

-a – to put it simply this stands for “all”. As in “all connections and listening ports”.

 -b – to output the name of the application making the connection.

Alternatively to -f you can use -n to display only IP addresses.

Naturally, “5″ stands for how often do we want this information to be gathered. Finally, “> connections.txt” means that we want to output this information to connections.txt (so called piping).

So now that we now what we are doing, we can freely hit Enter.

Wait for a couple of minutes and press Ctrl + C to stop netstat. Now you can open connections.txt (which in our case is located in C:\Windows\System32  because we ran netstat from there) and see the activity of every application for the moment you started netstat, until you turned it off.

Note: This information may not be complete as we set netstat to update once in five seconds.

Note: This trick works on Windows 7 and Windows Vista. If you are still using Windows XP you need at least SP2.

 

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

Make Windows remember your folder settings

How often has this happened to you? You have just set everything about a folder (View, Sort by, Group by, folder type, etc.) and a few days later when you open the folder all your settings are gone. Not to mention that it only takes one unmount and remount for a hard drive to reset its settings. Well, this is kind of annoying, isn’t it? Thankfully, this can be solved pretty easy with a little registry tweak.

First open the Registry Editor – open the Start menu, enter regedit in the Start menu search box, wait for search to locate regedit.exe and press Enter:

The registry editor will open:

Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell using the left-hand pane:

Note for Windows Vista x64 and Windows 7 x64 users: You should navigate to HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\ instead.

Create a new DWORD key:

And name it BagMRU Size:

Double-click on it and a new window will open:

Choose Decimal base and enter something like 10000:

Click OK, close the registry editor and you are done.

VN:F [1.9.18_1163]
Rating: 9.2/10 (5 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
</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)

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: 4.5/10 (2 votes cast)

Diskeeper – how to defragment my hard disk

Diskeeper defragmentator tool designed to keep your hard disk drives always running at their maximum peak performance. Read the rest of this entry »

VN:F [1.9.18_1163]
Rating: 0.0/10 (0 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.

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

Tips on Symbolic link or symlink in Unix Linux

In this tutorial I have shared my experience with Unix soft links and hard links.I found them extremely useful and have seen its versatile usage in various project.

This UNIX command tutorial is in continuation of my earlier article Top 10 basic networking Commands in Unix and 10 examples of using find command in UNIX if you haven’t read already you may find some useful information based on my experience in Unix and Linux commands.

Though this UNIX command tutorial is dedicated to highlight Differences between soft link in UNIX and hard link in UNIX which is also a very popular UNIX command interview question, I am not able to resist myself by showing you the usage of soft link in UNIX, below are some of example of UNIX symlinks I have seen during my projects of involving UNIX soft links:

1) In our project our Java process picks latest version of package for executing, which is a UNIX soft link. So whenever we do a release we just need to update latest UNIX symlink which makes release seamless and rollback very easy which in tern increases stability and predictability of our Java application.

2) All our UNIX script takes the location as argument so they are agnostic about the absolute path of resources and these resources are provided them via UNIX soft links and environment variables. This feature of our scripts saves a lot of time whenever we need to do any migration which involves changing location of resources.

3) An important point about UNIX soft link is that they inherit the permission of the folder to which they are pointing out.

Now let” see what are differences between Soft Link and Hard Link in UNIX

Read the rest of this entry »

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

10 example of using find command in linux

Find is very versatile command in UNIX and I used it a lot in my day to day work. I believe having knowledge of find command in UNIX and understanding of its different usage will increase your productivity a lot in UNIX. If your works involve lots of searching stuff or if you are a java or C++ programmer and your code resides in UNIX, find can greatly help you to look for any word inside your source file in the absence of an IDE, find is the alternative way of searching things in UNIX. grep is another command which provides similar functionality like find but in my opinion find is much more powerful than grep in unix.

This article is in continuation of my earlier article Top 10 basic networking Commands in Unix and Top 10 most useful CVS command in Unix .

Here I am listing down some of the way I use find command regularly, I hope this would help some one who is new in UNIX and find command or any developer who has started working on UNIX environment. this list is by no means complete and just some of my favorites , if you have something to share please share via commenting.

1) Running the last executed find command in Unix:

!find
This will repeat the last find command executed. It saves lot of time if you re searching for something and you need to execute same command again and again. In fact \"!\" can be used with any command to invoke previous run of that command.

2) Finding files which has been modified less than one day in Unix:

find . -mtime -1
This is my favorite while looking out some issue just to check which files have been modified recently which could be likely cause of issue, believe me it helps a lot and many a times gives you enough hint of any problem due to intended or unintended file change. Read the rest of this entry »

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