Monday, May 2, 2011

How to find the largest files on Windows?

— SkyHi @ Monday, May 02, 2011

Windows XP

  1. Go to Start / Search / For Files or Folders
  2. Select the search option All Files and Folders
  3. Enter *.* in the file name search box
  4. Select the hard drive(s) you would like to search
  5. (Optional) Select the What size is it? option and choose Large
  6. Click the Search button
  7. Click the Size column to sort the results

REFERENCES
http://superuser.com/questions/156034/how-to-find-the-largest-10-files-on-windows-7

http://www.nirmaltv.com/2009/03/30/find-largest-files-and-folders/
http://heatware.net/linux-unix/find-largest-file-on-hard-drive/
http://www.raymond.cc/blog/archives/2007/04/30/find-out-what-files-and-folders-are-taking-up-hard-drive-spaces/
http://mintywhite.com/windows-7/7maintenance/find-top-10-largest-files-click-windows-7/
http://www.technospot.net/blogs/finding-the-biggest-folder-or-file-windows/
http://serverfault.com/questions/8894/best-places-to-free-space-on-windows
http://windows7themes.net/how-to-find-large-files-in-windows-7.html

Check your disk usage with df and du

— SkyHi @ Monday, May 02, 2011
As system administrator , but also as common user on my PC, one of the more common problem is the fill up at 100% of a filesystem.
So, in this article we’ll see 2 commands that can help us in keeping under control or check the space used in every filesystem and in his directory.
df : report file system disk space usage
du: estimate file space usage


DF

Basic usage

df [Option...] [FILE_NAME...]
description
If [FILE_NAME...] is not given df displays the following information for each file system that was activated with mount: total space, used space, free space and use in %.
if it’s given [FILE_NAME...] the same information is given for the filesystem containing the specified files .
Options:
The most used options for df are -k that show the output values in Kilobytes (this is usually teh default), -h that print sizes in human readable format (e.g., 1K 234M 2G) and -i that give information about inodes
Examples:
#df
 
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/root_vg-root_lv
                       4128448    400936   3517800  11% /
/dev/mapper/root_vg-home_lv
                        516040     17568    472260   4% /home
/dev/mapper/root_vg-tmp_lv
                       4128448    164316   3754420   5% /tmp
/dev/mapper/root_vg-usr_lv
                       8256952   1240372   6597152  16% /usr
/dev/mapper/root_vg-var_lv
                       4128448    490632   3428104  13% /var
/dev/mapper/root_vg-var_log_lv
                       8256952    320836   7516740   5% /var/log

Same machine but with the -h option:
#df -h
 
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/root_vg-root_lv
                      4.0G  392M  3.4G  11% /
/dev/mapper/root_vg-home_lv
                      504M   18M  462M   4% /home
/dev/mapper/root_vg-tmp_lv
                      4.0G  161M  3.6G   5% /tmp
/dev/mapper/root_vg-usr_lv
                      7.9G  1.2G  6.3G  16% /usr
/dev/mapper/root_vg-var_lv
                      4.0G  480M  3.3G  13% /var
/dev/mapper/root_vg-var_log_lv
                      7.9G  314M  7.2G   5% /var/log

Same machine but with the -i option:
#df -i
 
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/mapper/root_vg-root_lv
                        256K    7.0K    250K    3% /
/dev/mapper/root_vg-home_lv
                         32K      55     32K    1% /home
/dev/mapper/root_vg-tmp_lv
                        256K      27    256K    1% /tmp
/dev/mapper/root_vg-usr_lv
                        512K     51K    462K   10% /usr
/dev/mapper/root_vg-var_lv
                        256K    4.0K    253K    2% /var
/dev/mapper/root_vg-var_log_lv
                        512K     473    512K    1% /var/log

An example a bit more interesting, we do a df, then we use the ouput to see when is the next check of the filesystem (it works on ext3 /4):
df  | awk '{print $1}' | grep dev\/ | xargs -i tune2fs -l {}| egrep "mounted|Next"
 
Last mounted on:          /
Next check after:         Sat Oct  1 19:05:57 2011
Last mounted on:          /home
Next check after:         Sat Oct  1 12:33:16 2011
Last mounted on:          /tmp
Next check after:         Sat Oct  1 19:06:00 2011
Last mounted on:          /usr
Next check after:         Sat Oct  1 19:06:04 2011
Last mounted on:          /var
Next check after:         Sat Oct  1 19:06:07 2011
Last mounted on:          /var/log
Next check after:         Sat Oct  1 12:33:22 2011

 

 

DU

Basic usage

du [Option...] [FILE_NAME...]
description
The du command serves to return the size of either an entire file system or a folder, file, etc..
du command returns the size of each file and directory that is within that directory. If [FILE_NAME...] is not given du will print the disk usage of every file from the current directory and all subdir.
Options
You can use the option -a , which tells the du command to return the size of individual files and directories, while -s display only a total for each argument.
Another important parameter is -h which makes the output, of the du command, more friendly to the human eye such as 18M instead of displaying 17,532 (the same number shown in bytes without rounding).
Another recommended setting is -c which returns the total size of all files.
Examples

Show the disk usage of /var
# du -hs /var/
481M /var/


Show the disk usage of every directory in /var and print the total:
# du -hsc /var/*
5.3M /var/backups
188M /var/cache
112M /var/lib
4.0K /var/local
16K /var/lock
177M /var/log
16K /var/lost+found
12K /var/mail
4.0K /var/opt
100K /var/run
604K /var/spool
4.0K /var/tmp
120K /var/www
481M total


Get the 10 biggest files/folders for the /var/ directory
# du -s /var/* | sort -nr |head
191676 /var/cache
180760 /var/log
113712 /var/lib
5332 /var/backups
604 /var/spool
120 /var/www
100 /var/run
16 /var/lost+found
16 /var/lock
12 /var/mail

Conclusions

With these two simple commands you can control the growth of your file system and quickly see if the space is exausted, or if there are problems on inode and which directory is consuming all of your disk.

Why command df and du reports different output ?

Short answer: this is due to open files and how they are counted by the 2 commands.
Long answer: Check this post at nixcraft

REFERENCES
http://www.linuxaria.com/howto/check-your-disk-usage-with-df-and-du?lang=en
http://www.cyberciti.biz/tips/freebsd-why-command-df-and-du-reports-different-output.html

failed as Volume Shadow copy operation failed for backup folumes with following error code '2155348129

— SkyHi @ Monday, May 02, 2011
We're having the exact same problem with Server 2008 Standard 64-bit. I cannot successfully complete any backups with Windows Server Backup in its default configuration.

Event Viewer also displays error code '2155348129' but our System parition is correctly marked as Active already.

However, If I disable SQL Server VSS Writer in services.msc, the Backup successfully completes. I decided to stop this service when I noticed that its entry in 'vssadmin list writers' was marked as 'non-retryable error'


REFERENCES
http://social.technet.microsoft.com/Forums/en/winserverfiles/thread/9cf42e8a-2a33-47c5-a797-269330e9ba1a
http://bonkel.wordpress.com/2010/04/09/windows-server-backup-failed-creation-of-shared-protection-point/

Monday, April 25, 2011

How to use ComboFix

— SkyHi @ Monday, April 25, 2011
How to use ComboFix

Table of Contents
  1. Using ComboFix
  2. Forums to receive help analyzing ComboFix logs
  3. Manually installing the Windows Recovery Console
  4. Manually restoring the Internet connection
 
 
 ntroduction ComboFix is a program, created by sUBs, that scans your computer for known malware, and when found, attempts to clean these infections automatically. In addition to being able to remove a large amount of the most common and current malware, ComboFix also displays a report that can be used by trained helpers to remove malware that is not automatically removed by the program.
At this time ComboFix can only run on the following Windows versions:
  • Windows XP (32-bit only)
  • Windows 2000 (32-bit only)
  • Windows Vista (32-bit/64-bit)
  • Windows 7 (32-bit/64-bit)
You should not run ComboFix unless you are specifically asked to by a helper. Also, due to the power of this tool it is strongly advised that you do not attempt to act upon any of the information displayed by ComboFix without supervision from someone who has been properly trained. If you do so, it may lead to problems with the normal functionality of your computer.
It should also be noted that when you run ComboFix it will automatically delete files from the following locations:
  • Windows Recycle Bin
  • Temporary Internet Files
  • Temp Folder
If you store files that you wish to keep in one of these location, it is suggested that you move them to a safer location rather than relying on the above temporary storage locations. Please note that this guide is the only authorized guide for the use of ComboFix and cannot be copied without permission from BleepingComputer.com and sUBs. Furthermore, the ComboFix program cannot be hosted at any other site without direct permission from the developer. It is also understood that the use of ComboFix is done at your own risk.

 Using ComboFix
If you need help with malware removal, then please create a topic at one of the forums listed later in the guide and ask for help. Please note that each forum has different policies, so please be sure to read any pinned topics and rules for the particular forum about how you should go about receiving help. If a ComboFix log has been requested by a helper then please create one by following the instructions below.
The first thing you should do is print out this guide, as we will close all the open windows and programs, including your web browser, before starting the ComboFix program.
Next you should download ComboFix from one of the following URLs:
To download ComboFix, simply left-click on one of the links above and you will see a prompt similar to the figure below.

Download ComboFix Screenshot
Download ComboFix Prompt

Click on the Save button, and when it asks you where to save it, make sure you save it directly to your Windows Desktop. An image showing this is below.

Downloading ComboFix to the Desktop
Downloading ComboFix to the Desktop

When you have the Save as screen configured to save ComboFix.exe to the Desktop, click on the Save button. ComboFix will now start downloading to your computer. If you are on a dialup, this may take a few minutes. When ComboFix has finished downloading you will now see an icon on your desktop similar to the one below.

ComboFix Icon
ComboFix Icon

We are almost ready to start ComboFix, but before we do so, we need to take some preventative measures so that there are no conflicts with other programs when running ComboFix. At this point you should do the following:
  • Close all open Windows including this one.
  • Close or disable all running Antivirus, Antispyware, and Firewall programs as they may interfere with the proper running of ComboFix. Instructions on disabling these type of programs can be found in this topic.
Once these two steps have been completed, double-click on the ComboFix icon found on your desktop. Please note, that once you start ComboFix you should not click anywhere on the ComboFix window as it can cause the program to stall. In fact, when ComboFix is running, do not touch your computer at all. The scan could take a while, so please be patient.
Once you double-click on the icon, you may see a screen similar to the one below.

Windows Open File Security Warning
Windows Open File Security Warning

Windows is issuing this prompt because ComboFix does not have a digital signature. This is perfectly normal and safe and you can click on the Run button to continue. If you are using Windows Vista, and receive UAC prompt asking if you would like to continue running the program, you should press the Continue button.
You will now see the first ComboFix screen as shown below.

ComboFix is Preparing to Run
ComboFix is Preparing to Run

ComboFix is now preparing to run and when it has finished you will see a screen showing the authorized locations to download Combofix. On this screen please press the OK button and you will be shown the Disclaimer screen shown below.

ComboFix Disclaimer
ComboFix Disclaimer

If you do not agree to the disclaimer, then click on the No button to exit the program. Otherwise, to continue you should press the Yes button to continue. If you decided to continue, then ComboFix will create a System Restore point so that if any problems occur while using the program you can restore back to your previous configuration. When ComboFix has finished creating the restore point, it will then backup your Windows Registry as shown in the image below.

ComboFix is backing up the Windows Registry
ComboFix is backing up the Windows Registry

Once the Windows Registry has finished being backed up, ComboFix will attempt to detect if you have the Windows Recovery Console installed. If you already have it installed, you can skip to this section and continue reading. Otherwise you will see the following message as shown below:

ComboFix Recovery Console
ComboFix Recovery Console

At the above message box, please click on the Yes button in order for ComboFix to continue. Please follow the steps and instructions given by ComboFix in order to finish the installation of the Recovery Console. Once it has finished installing, you will be presented with the screen shown below.

ComboFix Recovery Console Finished
ComboFix Recovery Console Finished

You should now press the Yes button to continue. If at any time during the Recovery Console installation you receive a message stating that it failed to install, please allow ComboFix to continue with the scan of your computer. When it is done, and a log has been created, you can then perform the manual install of the Recovery Console using the steps found in the Manually installing the Windows Recovery Console section.
ComboFix will now disconnect your computer from the Internet, so do not be surprised or concerned if you receive any warnings stating that you are no longer on the Internet. When ComboFix has finished it will automatically restore your Internet connection.
ComboFix will now start scanning your computer for known infections. This procedure can take some time, so please be patient.

ComboFix is scanning the computer for infections
ComboFix is scanning the computer for infections

While the program is scanning your computer, it will change your clock format, so do not be concerned when you see this happen. When ComboFix is finished it will restore your clock settings to their previous settings. You will also see the text in the ComboFix window being updated as it goes through the various stages of its scan. An example of this can be seen below.

Stages of the ComboFix AutoScan
Stages of the ComboFix AutoScan

At the time of this writing there are a total of 50 stages as shown in the image below, so please be patient. The amount of stages will go up as time goes on, so if the amount of stages is different when you run it, please do not be concerned.

34th Stage of the ComboFix AutoScan
34th Stage of the ComboFix AutoScan

When ComboFix has finished running, you will see a screen stating that it is preparing the log report as shown below.

ComboFix is preparing the log report
ComboFix is preparing the log report

This can take a while, so please be patient. If you see your Windows desktop disappear, do not worry. This is normal and ComboFix will restore your desktop before it is finished. Eventually you will see a new screen that states the program is almost finished and telling you the programs log file, or report, will be located at C:\ComboFix.txt. This can be seen in the image below.

ComboFix is almost done!
ComboFix is almost done!

When ComboFix has finished, it will automatically close the program and change your clock back to its original format. It will then display the log file automatically for you as shown below.

ComboFix Log File
ComboFix Log File

You should now post this log as a reply to the topic where you were asked to run combofix. Your helper will now analyze this log and let you know what they would like you to do next. If you having problems connecting to the Internet after running Combofix, then please read the Manually restoring the Internet connection section.
It is possible that ComboFix, even on its first run, may have fixed the problems you are having. We strongly suggest that you still post your log into the topic that you are receiving help as you most likely will have infections left over that your helper will need to analyze further.

REFERENCES
http://www.bleepingcomputer.com/combofix/how-to-use-combofix

Thursday, April 21, 2011

Remove Old Addresses From Outlook Drop Down List

— SkyHi @ Thursday, April 21, 2011

Remove Old Addresses From Outlook Drop Down List

In Outlook, as you start typing a name in the To box, a drop down list may appear, showing names of people to whom you’ve previously sent an email.
OutlookDropdown
Sometimes those names are out of date, and the list includes old email addresses.
In my Outlook drop down lists there are multiple entries for some people – a current address and one or more older addresses. When sending email to those people, I waste time trying to remember which address is the correct one. I’d like to get rid of the old items in the list, so the correct addresses are the only ones left.

Remove the Old Addresses

  1. Create a new email message
  2. Start typing a name in the To box
  3. When the drop down list appears, click the down arrow (or up arrow) key on your keyboard, to move to the name that you want to delete.
  4. On the keyboard, click the Delete key.
Now when you start typing the name, the deleted names don’t appear.
OutlookDropNew

REFERENCES
https://msmvps.com/blogs/deborahk/archive/2009/11/09/outlook-sending-to-the-wrong-email-address.aspx
http://blog.contextures.com/archives/2009/01/21/remove-old-addresses-from-outlook-drop-down-list/

Why is Outlook sending email using the wrong account, and how do I fix it?

— SkyHi @ Thursday, April 21, 2011
Why is Outlook sending email using the wrong account, and how do I fix it? This is a great question, because this is an especially vexing and annoying problem that Outlook has. So here’s the situation. You’ve set up Outlook and, because it’s oh ever so helpful and convenient, you’ve configured several different email accounts to run through it. You can basically set up however many you want. Then Outlook will send email through a specific account that you tell it to. So let’s say that you have one main email account that you want to use, or maybe even you have a main email account and then you have another account that you use when you post on blogs and message boards and things like that. You don’t want to use your main personal account when you post on blogs and message boards because sometimes those email addresses can be picked up by spammer and who knows who else. You don’t want any of that spam or junk mail coming to your regular account. So, you think that you have everything all worked out, Outlook is managing and handling all of your different email accounts just the way that you want it to because, hey, you’re not getting any message that it’s having trouble and problems doing what you tell it to. And then you notice that it’s not working. Your main personal email account is the one showing up when you post on blogs and message boards. Or let’s say that you are sending emails to people and horrifically enough, your terrifying ex-girlfriend’s name and email account are the ones showing up as the sender because she used to live with you and you two shared a computer. No wonder nobody’s writing you back! They all think that your ex is hunting them down!

The really aggravating thing about this situation, other than the obvious fact that Outlook is screwing up your email account settings and turning everything into a disaster, is that Outlook doesn’t tell you when it’s going on. Outlook 2003 and earlier just goes on its merry little way, deciding which email account it’s going to be using to send your emails. You’re left entirely in the dark. Now you as the user might assume that since you’re the user you would be able to 1. make the decision regarding which email account is being used and 2. decide what to do if for some reason Outlook can’t use that account. Well, you, dear user, are assuming a bit too much.

So what’s going on when Outlook sends email using the wrong account? Here’s basically what’s happening when Outlook sends email using the wrong account. Now, let’s say that you have a bunch of different email addresses that you’re running through Outlook 2003 or earlier. Here are some things that you should know.

1. When you write a new email, then Outlook is going to use whichever email account you have designated as your default email account.

2. When you receive an email, and you reply to the email or forward it on to someone, Outlook will use whichever email account received the original message. So if you have a Hotmail account that’s being run through Outlook, and you receive an email sent to your Hotmail address, if you just hit reply, Outlook will send the reply mail through Hotmail instead of your Gmail address, which is the default email account.

3. No matter what the situation, you can decide explicitly which account to use. What you do is you click on the Accounts button that’s next to the send button. Then you can change which account you want to use, if it’s not the default or the receiving account.

Now the problem is that a lot of the time, even if you specify a specific account using the Accounts button, Outlook won’t use the account that you tell it to. This is because Outlook is having a difficult time sending an email on the account that you tell it to. The frustrating thing is that Outlook won’t tell you that it’s having a hard time; it just chooses a different email account.

One way that you can fix this problem is to go to the account that’s having problems. Send a test email and make sure that the sending authorization configuration is properly set. It should be set to “Use the same settings as my incoming mail server” instead of something along the lines of “Log in to mail server before sending mail”. It’s not really a particularly evident solution, but it should work.

REFERENCES
http://www.businessknowledgesource.com/technology/why_is_outlook_sending_email_using_the_wrong_account_and_how_do_i_fix_it_021513.html

Wednesday, April 13, 2011

How to clear sendmail queue

— SkyHi @ Wednesday, April 13, 2011
If you ever felt the need of flushing the sendmail queue then this post will be handy to you.

How to flush sendmail queue under linux sendmail mailq command in linux how to flush mail queue in sendmail under linux

If u r worried about sendmail pending mail flush do the following 2 things.

1) manually method –> delete /var/spool/mail/*.* files in this dir –> delete /var/mqueue/*.* files

then check if all mail gone using mailq command. all mail will be deleted.

2) using command:

use simple command sendmail -v -q in root prompt. it will flush all pending mails. rest to confirm u can run mailq command if all are really gone !!….

3) if u want perticular domain or user or recepitience mail to delete use this command

sendmail -qS -v test.com it will delete all mail from *@test.com

sendmail -qR -v hotmail.com it will delete all mail from recepient of hotmail….


REFERENCES
http://www.kpsolution.com/blog/tips/how-to-clear-sendmail-queue/9/