Bypassing UEFI to Install Win7 normally to an MBR HD

Make your Recovery disks and save a System image as a secondary backup. Back up your files, unplug all other HD's and peripherals,

Boot into BIOS setup, if this is a new Win8 PC look for a setting to disable Secure Boot. Then enable Legacy BIOS or Compatibility Support Module (CSM). This should remove any EFI Boot Disk from BIOS Boot order. Set DVD drive first to boot, HDD second. Then set SATA controller to AHCI. Save changes and Exit.

Then boot into installer DVD or flash stick burned or written using tool and latest ISO for your licensed OS version.

At first installer screen Press Shift + F10 to open a Command Box, type:

DISKPART
LIST DISK
SEL DIS 0 (after confirming Windows 7 target HD #)
CLEAN
CONVERT MBR
CREATE PARTITION PRIMARY SIZE=102400 (for 100gb partition, adjust as desired)
FORMAT FS=NTFS LABEL="WINDOWS 7"
ACTIVE
EXIT
EXIT

Next click Install Now to Clean Install Windows 7 to the partition you created. If it fails then report back at which step and the verbatim error message.

In addition read over these steps to understand the tools and methods which work best to get and maintain a perfect Clean Reinstall - Factory OEM Windows 7. The steps are the same for retail.

The purpose of creating the partition above is to wipe the HD and define an Active partition which resolves most install failures. Afterwards you can adjust the OS partition size in Disk Mgmt, create other partitions as desired.

re-port from here

7 easy steps to reset root password on CentOS/Red Hat

So you want to became a hacker a reset someone centos root password??

No, this is not for you..it's rather for windows user who happens to administer centos server and forgot his root password. Only 7 simple steps needed...

1. Boot the system and when you see the following message "Press any key to enter the menu", press any key. (You will see the list of available kernel versions.)

2. Press e in order to edit commands before booting.

3. Highlight the list item with vmlinuz in it by using the arrow keys and press e.

4. Now type single OR init 1 at the end of the line.

5. Then press enter and b to boot the system with the new argument. (The system will boot into single user mode and you will see bash prompt)

Now it's time to change the password:
6. Type passwd

### Shell Commands ###
passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
7. Type reboot to restart the system.

There you have it...




Compact Calendar 2014


While scouring the interwebs, i stumble upon a calendar so simple that's called Compact Calendar by David Seah. I have made Malaysian version for several years and now, here it is for 2014.

Feel free to download and use Compact Calendar Malaysia version and play with it. ;)

According to David:
For those of you new to the Compact Calendar, it’s a single-page calendar that you print out and use for planning. The days of the year are presented as a solid block of days, so it’s easy to count-off weeks when you are figuring out scheduling. There’s plenty of space on the right-hand side too, so you can keep notes. I first made this calendar back in the 90s so I could block-out projects during meetings, but since then I’ve heard that people use it for family vacation planning and even biological purposes (counting weeks of gestation, for example).

Hide Recovery Partition in Windows 7

Got shiny new HP PC from HQ.

Problem is, it has a recovery partition that has a big warning not to touch from HP when opened. I have to hide this so I don't damage it by accident; also it`s an eyesore.

After googling around... I got this:

Click Start, type diskmgmt.msc, press Enter and wait for Disk Management to load. When it does, right-click directly on the recovery partition so it becomes the selected one, then select "Change Drive Letter and Paths..."

On the next dialogue box that appears, click Remove. You'll get a warning box like this:


Click Yes, and from that moment on (you should close any open Explorer windows and re-open them) neither Windows (aka Explorer) nor applications will be able to "see" the recovery partition - you've effectively hidden it from pretty much anything except Disk Management itself.

This keeps the recovery/restore partition intact, "protects" it since nothing can access it (the OS and apps require a drive letter being assigned to access partitions), and you're good to go.

Just as a sidenote: while deleting the partition can recover some extra space on a drive, the issue that most people have nowadays is they put too much on hard drives. One should never ever fill a hard drive more than 85% full, regardless of OS or file system. I can't even begin to tell you how many machines come to me for repairs/tuneups/optimization/reinstalls and they're 90, sometimes 95% full and the performance of the entire machine suffers drastically for it.

If you're so pressed for space you have to actually delete the recovery/restore partition, it's simple: you've got too much stuff on the drive already and should either back material up to another location (and delete it off the drive to recover space), or get another hard drive and move stuff over. But keep that ~85% full figure in your head and do your best not to ever go past that point.

Windows (and all modern OSes) work best when the OS "has room to breathe" aka free space. When you severely reduce the amount of available free space on a system, you're essentially choking it and performance will suffer because the OS can't find storage space when it needs it.

If you do decide to delete the recovery/restore partition, ensure - and I mean triple-check if necessary - that you've created those backup/recovery/restore DVDs before removing the partition.

Hope this helps...

The solution is from here.


edit: and while at it... I found users keep repeating to do some backup with free tool Macrium, and whs from sevenforums.com create nice tutorial.


Install and Configure MySQL on CentOS

This tutorial covers installing MySQL server and client, as well as some basic configuration to get you up and running.

Install MySQL

Install MySQL service and command line tools.

1 $ yum install mysql mysql-server

Once thats done turn on the MySQL service so that it automatically starts on boot.

1 $ chkconfig --level 2345 mysqld on

Finally start the MySQL service.

1 $ /etc/init.d/mysqld start

Open up MySQL Ports

We are going to open up ports 3306 in iptables.

1 $ vi /etc/sysconfig/iptables

Add the following lines (make sure its above the reject statement).

1 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
2 -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

Restart iptables service for changes to take effect.

1 $ /etc/init.d/iptables restart

MySQL Client

That completes the steps to install mysql, from there you can login in through the client to setup whatever you need to.

1 $ mysql -u root

Solved: Cannot scp to CentOS box

Now, I have a centos box that recently been setup. This would be my dev server. The first thing that i would want to do is to use WinSCP to transfer files to and fro. However, here is something...

I cannot scp to CentOS...the error says "Network Error: Connection refused". Naturally i've googled for the solution and WinSCP page have it all. But it does not solve my problem. I've:

  • setup the firewall (even disable the firewall to check for connection)
  • ensure the sshd is running
  • and few other solutions found online.

That box is in server room and i'm too lazy to walk there just to puch in some commands. So, I just ssh using putty to the box. What!!, wait... I actually *can* ssh to the box....I see the light at the end of the tunnel...woot...

To cut the story short.... if you CAN ssh but CANNOT scp/sftp... do the following:

1.  check the promission of /dev/null. If the permission as follows:

[root@localhost ~]# cd /dev
[root@localhost dev]# ls -all null
crw-rw-rw- 1 root root 1, 3 Jan 23 17:49 null

2. change the permission to crw-------

[root@localhost dev]# chmod 600 null
[root@localhost dev]# ls -all null
crw------- 1 root root 1, 3 Jan 23 17:49 null

That should do the trick.

Windows 8: Mana perginya Start-up folder?

Aku selalu guna “Startup” folder di Start Menu launch application lepas logon windows. Tapi masalahnya, dalam Start menu Windows 8 ni, folder Startup ni dah tak ada.Jadi terpaksa la selongkar.

Folder yg simpan Startup item ada dua:

  • C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Cumanya, setiap kali nak akses, jauh sangat nak masuk ke folder ni.

Solution paling mudah ialah guna arahan Shell yang dilarikan(run) dari command prompt (WIN+R):

  • shell:startup
  • shell:common startup

There you have it!.

Compact Calendar 2012

This is another new version of compact calendar. An excellent calendar, so compact, originally created by David Seah. I have made version 2010, 2011 and now, here it is version 2012.

Feel free to download and use Compact Calendar Malaysia version. Posterous doesn't accept .zip files anymore, bear with it. I think downloaded version is nicer compared to converted version displayed here.

Changing XAMPP default error404

1. Edit the following document as root

sudo pico /opt/lampp/etc/extra/httpd-multilang-errordoc.conf

at the end of the file, change the lines as shown i.e. put # to the begginning and add new lines.

ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
#ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 404 /error403.html
ErrorDocument 404 /error404.html
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var

Save and exit (Ctrl+O, CTRL+X)

2.  Prepare custom error files named error403.html and error403.html. These files should be kept in root of your webserver (ie: opt/lampp/htdocs) directory

3.  Just restart XAMPP by below code.

sudo /opt/lampp/lampp restart

4. With the  XAMPP's new security setting of preventing access to XAMPP and phpmyadmin directories rather than the permitted IP addresses, it will throw the error 403 page. To change this setting, edit the following:

sudo pico /opt/lammp/etc/extra/httpd-xampp.conf

Thus,

change the line below:

ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

to

ErrorDocument 403 /error404.html

It is not a mistake. Intentionally I recommend you to direct unauthorized visitors requesting to access xampp and phpmyadmin directories to the "page not found" (404) error page. This will be slightly more secure since the attacker may think that there is no xampp or phpmyadmin directory in the server. (that is also the reason of having error404.html not .php file, though you have to enable seo if you use joomla so that it is not too obvious by looking at the address)