Posts Tagged ‘common’

Common commands to Repair Broken or Unbootable Windows XP / Vista / 7 without system Re-install

Monday, October 22nd, 2012

Common commands to repair broken unbootable Windows XP 7 and Vista, the famous genuine great! mfc command :)
If you have severe problems with Windows 7 / Vista / XP whatever and you don’t want to re-install. It is handy to know about the existence of few commands, which can help you fix your basis Windows system without re-install. This commands are not to fix 100% of messed up Windows installs but in most cases I know, they either improved the state of the system or fixed it completely, so here are commands:

1. Change permissions of C:\boot.ini and delete it

Many Viruses install via standard Windows boot.ini file and change permissions of the file to make it hard to delete by programs and by
Administrator user. To solve that in Windows Safe Mode (without networking) exec:


C:\> COPY boot.ini boot.bak
C:\> ATTRIB -RSH C:\boot.ini
C:\> DEL boot.ini

-RSH ATTRIB cmd options instruct it to remove Read Only, System and Hidden flags from boot.ini.

2. Re-build boot.ini and other essential Win boot components


C:\> CD WINDOWS
C:\WINDOWS> BOOTCFG /REBUILD

BOOTCFG /Rebuild is a very important for recovering. The command will do complete evaluation with diagnostic tests trying to replace / repair whatever files are preventing OS boot.

3. Fix problems with Unbootable Windows Systems

If the system is completely unbootable you need to use the Windows Install (Setup) CDRecovery Console and in first boot up (blue screen), type R key to enter recovery console. There is option of automated recovery console but for me Automated System Recovery – ASR, never worked.
Once in Recovery Console to repair broken Windows boot up (fix winboot loader):


C:\WINDOWS> BOOTCFG /Rebuild
C:\WINDOWS> CHKDSK /R /F
C:\WINDOWS> FIXBOOT

You should already know from the MS-DOS, DR-DOS times CHKDSK (Check Disk) is thanksfully still on every next Windows release. As CHKDSK does a hard drive check for irregularities and BAD Blocks (depending on the size of HDD) it takes time usually from 30 minutes to 1 hour.
4. System File Checker (SFC) command – restore basis .DLLs and others to Setup CD (install) originals


C:\WINDOWS> SFC /SCANNOW

SFC – has been useful in many, many Windows installs, I fixed it is really precious cmd. It does check the system essential (DLL – Dynamic Loadable Libraries) and matches them against a clean working copy which was copied on the system by Windows Install (CD) SETUP program. If some of the primary win .EXE or .DLL files checksums are not matching, the file is substituted with a clean (working) copy of the Install CD original ones. Some Viruses and Spyware might change those original (clean) binary files placed by Windows during install time. So intelligent Virus progs are very rare so in lets say 90% of broken Windows installs SFC /SCANNOW solves problems with main win files 🙂

If you have doubt that those binaries which SFC matches with are changed, you can always use a Setup Install CD with same Service Pack version as installed on the host. To restore main Windows binaries and libs using the external recovery CD use:


C:\WINDOWS> sfc /offbootdir=c:\ /offwindir=c:\windows /scannow

This tutorial should solve also all kind of start-up errors like:


Windows could not start because the following file is missing or corrupt:
\\WINDOWS\\SYSTEM32\\CONFIG\\SYSTEM


You can attempt to repair this file by starting Windows Setup
using the original Setup CD-ROM.
Select ‘R’ at the first screen to start repair.

Windows NT could not start because the below file is missing or corrupt:
X:\\WINNT\\System32\\Ntoskrnl.exe


Windows NT could not start because the below file is missing or corrupt:
X:\\WINNT\\System32\\HAL.dll


NTLDR is Missing
Press any key to restart


Invalid boot.ini
Press any key to restart

How to disable spammer domain in QMAIL mail server with badmailto variable

Thursday, July 12th, 2012

I've recently noticed one of the qmail SMTP servers I adminster had plenty of logged spammer emails originating from yahoo.com.tw destined to reache some random looking like emails (probably unexisting) again to *@yahoo.com.tw

The spam that is tried by the spammer is probably a bounce spam, since it seems there is no web-form or anything wrong with the qmail server that might be causing the spam troubles.
As a result some of the emails from the well configured qmail (holding SPF checks), having a correct existing MX, PTR record and even having configured Domain Keys (DKIM) started being marked, whether emails are sent to *@yahoo.com legit emails.

To deal with the shits, since we don't have any Taiwanese (tw) clients, I dediced to completely prohibit any emails destined to be sent via the mail server to *@yahoo.com.tw. This is done via /var/qmail/control/badmailto qmail control variable;

Here is content of /var/qmail/control/badmailto after banning outgoing emails to yahoo.com.tw;;;

qmail:~# cat /var/qmail/control/badmailto
[!%#:\*\^]
[\(\)]
[\{\}]
@.*@
*@yahoo.com.tw

The first 4 lines are default rules, which are solving a lot of badmailto common sent emails. Thanks God after a qmail restart:

qmail:~# qmailct restart
....

Checking in /var/log/qmail-sent/current, there are no more outgoing *@yahoo.com.tw destined emails. Problem solved …

How ot fix Widgets drag and drop not working on WordPress

Thursday, July 14th, 2011

how to fix WordPress widgets missing drag and drop bug

My WordPress blog had an odd problem, all on the blog, worked just fine except the Widgets add new widget drag and drop functionality.
As there was new version of wordpress available I tried updating but this fixed the missing drag and drop widget functionality neither, so finally after a bit of googling and experimentation to follow suggested fixes like using the enable Accessiblity Mode button on top Widgets.Thus the common suggested fix that worked for most of the people who stumbled upon this annoying wordpress bug was to simply nagivate to:

Appearance -> Widgets -> Screen Options -> Enable Accessibility Mode As for me pressing over the Screen Options was impossible (nothing happened when I pressed over it), finally I’ve found a hack 😉

The hack is quite simple, all I had to do is just pass a variable ?widgets-access=on to the widget.php php script
Therefore the fix to the problem was as follows http://blog.mysite.com/wp-admin/widgets.php?widgets-access=on

And done, FIXED! 😉