Script to restore SQL Server database

A lot of people know how to restore an SQL Server database using the SQL Server Management Studio. Sometime it will not work if the database is in use. You have to close all active connections or even to take database offline and then online again.

It is much easier to restore the database via the attached script. Just unzip the file to a folder called C:\RestoreDB and copy the backup file to the same folder. Then edit RestoreDB.bat file and update it with the appropriate information – server name, user name, password, backup name, etc.

The last step is to run RestoreDB.bat – you can double-click it in Windows explorer or can oped a DOS prompt change the folder to C:\RestoreDB and run the script by typing its name and pressing “Enter” key.

RestoreDB_Script

New Grill

For few days now I am a proud owner of a new grill – Weber Genesis EP-310 Premium Edition.

Why it is so good? Because it is really well made and uses stainless still grates for starters. Took me 2-3 hours to assemble it at home and I could see at first hand it was a quality built product. Very solid. Here is a review about this same model:

Weber Genesis EP-310 Premium Edition – Gas Grill Review

More useful links:

There is a really nice article about grilling outdoors available here:

A Complete Guide to Outdoor Grilling: Set Up, Stay Safe, and Cook Great Food

How to install FreeNAS to USB stick


Note: This post is more than an year old. You can still use it to install FreeNAS on USB but I strongly recommend you to read the new one first which is much simpler:

Installing FreeNAS to USB stick (new and simpler way)

FreeNAS is an Open Source Storage Platform based on FreeBSD and supports sharing across Windows, Apple, and UNIX-like systems. It comes with a lot of protocols and services

Search inside files under Windows

Do you know how to search for a piece of text inside multiple files in Windows. I do not – not anymore. Earlier versions of Windows had this feature but I cannot figure out how to do it in Windows 7. It seems you have to index your files and folders and then maybe you can find what you are looking for. I do not want to do this.

In Unix and Linux you can use grep for this. Luckily there are some similar programs for Windows too. I found this one: AGREP

Go to Download page and get the stand-alone executable for Win95 and Win/NT (link)

Extract the archive – there is one file called agrep.exe. I copied it to C:\Windows\System32. This folder by default is in the PATH environment variable so you will be able to run the command from everywhere (no matter which is your current working folder).

Open the command prompt and try to search:

c:\> agrep -r word_to_search_for .

This will search all the files in the currect folder and all sub-folders for the word word_to_search_for

If you just type agrep it will show help and usage information.

Support Wikipedia

I was looking for some information online today and ended up reading an article in Wikipedia about that matter. It is so nice to have a free encyclopedia where you can go and find the information you need. I made a small donation to keep it free and accessible for everyone. If you would like you can donate too. Just click on the image below:

Support Wikipedia

Test your speakers with these sounds

Recently I was looking to buy a good computer speakers and was wondering how to test the sound. Then I found these:

VMware ESXi

Step 1. Connect to ESXi console and press the Alt+F1 key combination.

Step 2. Type unsupported and then press . Note that nothing will appear on the screen whilst you type this.

Step 3. When prompted enter in the Root password and press.

Step 4. You will now be presented with a prompt on the console. From this prompt type vi /etc/inetd.conf

Step 5. vi (the file editor) has now opened the inetd.conf file. Using the direction arrows scroll through the lines until you reach the line that has #ssh and remove the hash (ie: #). This is effectively un-commenting this line so that the ssh service can be started.

Step 6. Now that you have made this minor file you want to save this change and exit out of the editor (vi). To do this press the ESC key (to put vi back into Command Mode) and then type :wq *Note: If you want to exit without saving any changes to the file then just press the ESC key (Command Mode) and then type :q!.

Step 7. With the SSH service now un-commented from this file we want to restart the