Bharat Banate's Work Profile

View Bharat Banate's profile on LinkedIn
Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Thursday, August 21, 2008

How can I enable theme support in Windows Server 2003?

Windows Server 2003 has the theme support services disabled by default.

To enable themes on Windows Server 2003 follow the next steps:

  1. Go to the Services applet in Administrative Tools (or click Start, then Run, and type "services.msc" (without quotes) and click
    OK).
  2. Find the "Themes" service, right-click and select Properties, select "Automatic" instead of "Disabled" in the startup type box.
  3. Click Apply.
  4. Right-click the Themes service and select Start.
You can also modify start state and start it from a Command Prompt console by using the following command:
sc config Themes start= auto
sc start Themes (or net start Theme)

For now you only have Luna Blue, Silver and Olive Green to choose from.

  1. Go to Control Panel, select Display and then go to the Appearance tab.
  2. In the "Windows and Buttons" drop-down list select "Windows XP Style". Click Ok.
  3. Now you can choose the color scheme.


Sunday, October 14, 2007

How To: Burn a CD using Windows XP

You can burn a CD using Windows XP. No special CD-burning software required. All it needs is a CD-R or CD-RW disk, a machine running Windows XP and a CD-RW disk drive.

Step 1
Insert a blank CD-R or CD-RW disk into the CD-RW drive. A pop-up dialog box should appear after Windows loads the CD. (No pop-up dialog box? Open "My Computer" from your desktop and double-click on your CD-RW drive icon.)

Step 2
Double-click the option, "Open writable CD folder using Windows Explorer." You will see the files that are currently on the CD in your CD-RW drive. If you inserted a blank CD, you will see nothing.

Step 3
Click on the "Start" menu, and then "My Computer." (No "My Computer" on your start menu? It is likely you have the Windows Classic Start Menu enabled, and you will have to double-click "My Computer" on the desktop instead.) Navigate to the files that you wish to burn onto the CD.

Step 4
Single-click on the first file you wish to burn. Hold down the "Control" key and continue to single-click on other desired files until you have selected them all. Let go of the "Control" key. All your files should remain selected and appear blue. Right-click on any file and choose "Copy."

Step 5
Go back to the open window that displays the contents of your CD drive. Right-click in the white space and choose "Paste." The pasted icons will appear washed out, and they will have little black arrows on them indicating your next step.

Step 6
Choose "Write these files to CD" on the left-hand menu bar under "CD Writing Tasks." A wizard will start. First, name your CD. You can use up to 16 characters. After typing a name, click "Next." This will start the burning process. When the CD is finished burning, the CD will eject itself.

Step 7
Follow the remaining wizard prompts. It will ask if you want to burn the same files to another CD. If so, click "Yes, write these files to another CD." If not, click "Finish." You're done.

Tips & Warnings
Make sure to test your newly burned CD—try to open a few files to ensure that the process was done correctly.

Wednesday, September 19, 2007

Linux: How to reset forgotten root password

Sometimes, it may happen that you simply forget the root password. And its more frustrating if it is the only account on your system. What to do if this happens? Re-install the OS? No!!!
When one door closes, the other opens. We have another way to login to system.


There are various methods available for resetting a root password. The list includes booting into a single-user mode, booting using boot disk and edit the password file and mounting the drive on another computer and editing the password file.


In this post, I will list a simple yet useful method only. Others require a little more knowledge of OS-related operations and it may prove dangerous if you perform in a wrong way.


Reseting password by booting into single-user mode
This is the easiest and the fastest method to reset passwords. The steps are a little different depending on if you are using GRUB or LILO as a bootmanager.


For LILO
0) Reboot the system. When you see the LILO: prompt (see Fig. below), type in linux single and press 'Enter'. This will log you in as root in single-user mode. If your system requires you to enter your root password to log in, then try linux init=/bin/bash instead.


1) Once the system finishes booting, you will be logged in as root in single-user mode. Use passwd and choose a new password for root.


2) Type reboot to reboot the system and then you can login with the new password you just selected.


If you have a new version of LILO which gives you a menu selection of the various kernels available press Tab to get the LILO: prompt and then proceed as shown above.


For GRUB
0) Reboot the system, and when you are at the selection prompt (See Fig. below), highlight the line for Linux and press 'e'. You may only have 2 seconds to do this, so be quick.

1) This will take you to another screen where you should select the entry that begins with 'kernel' and press 'e' again.

2) Append ' single' to the end of that line (without the quotes). Make sure that there is a space between what's there and 'single'. If your system requires you to enter your root password to log into single-user mode, then append init=/bin/bash after 'single'. Hit 'Enter' to save the changes.

3) Press 'b' to boot into Single User Mode.

4) Once the system finishes booting, you will be logged in as root. Use passwd and choose a new password for root.

5) Type reboot to reboot the system, and you can login with the new password you just selected.




* Disclaimer *
Use the information in this document at your own risk. I completely deny any potential liability for the contents of this document. Use of the concepts, examples, and/or other content of this document is entirely at your own risk.
The information in this document should only be used to recover passwords from machines to which you have legal access. If you use this information to break into other people's systems, then I am not responsible for it and you deserve your fate when you are caught. So don't blame me.
You are strongly advised to make a backup of your system before performing any of the actions listed in this document.

Monday, September 17, 2007

Windows: How to Use Windows Notepad as a Professional Diary


Use the following VERY easy steps to use Windows Notepad as your own diary, complete with a stamped date & time!

Step 0
First, open a new, blank Notepad file.

Step 1
Second, write .LOG as the first line of the file, and press ENTER. Save the Notepad file and then close it. Note: You must type .LOG in capital letters!

Step 2
Now relaunch the file. Notice how each time you open it, a new time/date entry is neatly placed on the body of the file. Each entry will appear below the previous one. Now you can take your notes more conveniently and organized. Hows trick?
Note: the word .LOG must be in CAPITAL LETTERS.

Friday, September 14, 2007

C: How to use memcpy function in C

The memcpy function in C++ copies the specified number of bytes of data from the specified source to the specified destination. This is a binary copy so the underlying data type is irrelevant. The following steps will help you use the memcpy function.

Step 0
Learn the syntax of memcpy in C++. The complete syntax is void *memcpy (void *destination, const void *source, size_t num);. Note that this function always copies num bytes and does not look for a terminating character in order to be as efficient as possible. Memcpy returns the destination array.

Step 1
Know that the pointers to the source and destination arrays are type-cast to a type of void. The size of the destination and source arrays should be at least num bytes to avoid overflows, although this is not required. Memmove should be considered as a safer approach if the source and destination overlap.

Step 2
Understand that the C++ memcpy function is kept in the cstring library. You may need to include the string.h header file to use memcpy.

Step 3
Look at the following complete program for some simple examples of how to use memcpy:


#include_<_stdio.h_>
#include_<_string.h_>
int main ()
{
__char string1[]="test string";
__char string2[80];
__memcpy (string2,string1,strlen(string1)+1);
__printf ("string1: %s\nstring2: %s\n",string1,string2);
__memcpy (string1,"",1);
__printf ("string1: %s\n",string1);
__return 0;
}

Observe the following output for this program:
string1: test string
string2: test string
string1:
The first use of memcpy copies the contents of string1 to the contents of string2. The second use of memcpy clears the contents of string1 by moving the null terminator character to the first position of string1.

Note: Please DO NOT copy-paste the code given in this post.

Thursday, September 13, 2007

Windows: Why does the Recycle Bin have different file system names on FAT and NTFS?

On FAT drives, the directory that stores files in the Recycle Bin is called C:\RECYCLED , but on NTFS drives, its name is C:\RECYCLER. Why the names change?

The FAT and NTFS Recycle Bins have different internal structure because NTFS has this thing called "security" and FAT doesn't. All recycled files on FAT drives are dumped into a single C:\RECYCLED directory, whereas recycled files on NTFS drives are separated based on the user's SID into directories named C:\RECYCLER\S-.... (It has nothing to do with whether you are running English or Swedish Windows).

Suppose the same directory name were used for both file systems, say, C:\RECYCLED. Since it is possible to upgrade a FAT drive to an NTFS drive with the CONVERT utility, this means that a FAT drive converted to NTFS would have a FAT-style Recycle Bin after the conversion. But since the names are the same, the Recycle Bin says, "Hey, look, here's a C:\RECYCLED directory. That must be my NTFS Recycle Bin!" except that it isn't. It's a FAT Recycle Bin left over from the conversion.

Giving the NTFS Recycle Bin a different name means that the Recycle Bin shell folder won't get confused by the "wrong" type of recycle bin directory structure on an NTFS volume.

Yes, the problem could have been solved some other way. For example, there could have been code to inspect the Recycle Bin directory to determine what format it is and ignore it if it didn't match the actual file system. (Or, if you're feeling really ambitious, somehow convert from one format to the other.) But that would be over-engineering. You have to write and test the detection (and possibly conversion) code, there's the risk of a false-positive, the code runs at every boot, and it needs to be maintained whenever either the FAT or NTFS recycle bin format changes. All for a scenario that happens at most once per drive.

Wednesday, September 5, 2007

Google: The Google calculator

Google is more than a search engine. Isn't it?

The Google calculator is included in Google.com’s normal web search. So instead of entering words you want to find in web pages, you can simply enter math queries like the following:
10+7*3–12
The Google result will then display the solution:
10 + (7 * 3) - 12 = 19.
That’s already a little more fun than using a normal calculator (and incredibly helpful too, at times), but there’s much more to it. Let’s start with an Easter Egg – a hidden function within a program that makes it do something unexpected and interesting – and enter the following:
answer to life, the universe and everything
Entering this will result in the Google calculator showing you the answer “42”.
(If you wish to dig into why google answered so, google for this!!!)

But the fun doesn’t end there. Here are just some more examples of what’s possible, and often these different queries can be combined to larger formulas:
seconds in a year (1 year = 31 556 926 seconds)
furlongs per fortnight (1 furlongs per fortnight = 0.000166309524 m / s)
speed of light in knots (the speed of light = 582 749 918 knots)

Unix/Linux: What is the main advantage of creating links to a file instead of copies of the file?

The main advantage is not really that it saves disk space (though it does that too) but, rather, that a change of permissions on the file is applied to all the link access points. The link will show permissions of lrwxrwxrwx but that is for the link itself and not the access to the file to which the link points. Thus, if you want to change the permissions for a command, such as 'su', you only have to do it on the original. With copies you have to find all of the copies and change permission on each of the copies.