Friday, March 16, 2018

Windows 7 - How to reset Windows 7 password

This is just a post of what I had found in the Internet and it works for me (See reference for the actual post). While I knew that there are other ways to reset Administrator password, this is very easy.

Below is a simplified steps.

1. Use a Windows 7 boot disk and boot into repair mode so that you could launch the command line utility

2. Run

 copy c:\windows\system32\sethc.exe c:\

3. Run

copy c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe
4. Reboot the machine

5. Once the machine startup and reach the login page, hit the Shift key 5 times and it will launch an administrator command prompt

6. Use net user command to change the password

net user YourUserName YourNewPassword

7. You should be able to log in now. And of course, you should copying the c:\sethc.exe file back to c:\windows\system32\sethc.exe.



Thursday, February 1, 2018

Windows 7 - STOP 0x0000007B (0xFFFFF880009A97E8 0xFFFFFFFFC0000034 0x0000000000 0x0000000000)

If you encounter STOP 0x0000007B (0xFFFFF880009A97E8 0xFFFFFFFFC0000034 0x0000000000 0x0000000000) blue screen of death. This is very likely a hard disk driver issue.

In my case, it is a valid error in the sense that I had just move one hard disk (with pre-configured Windows 7 in IDE SATA disk mode) from one machine to another newer machine (With BIOS in AHCI SATA disk mode).

The detail of this error can be found at Microsoft Knowledge Based 922976. In summary, a generate example, assume that you install Windows Vista or Windows 7 on a computer that contains a controller that uses the Pciide.sys driver. Later, you change the SATA mode to AHCI. Therefore, the drive must now load the Msahci.sys driver. However, you must enable the Msahci.sys driver before you make this change.

And the fix is to locate


and fixed them

Below is what I had done to fix the issue.

1. Find a Windows 7 bootable disk and boot into Windows7 (remembered, I have a blue screen of dealth whenever I start up the machine and all options in F8 does not work)

2. Follow the wizard and select Repair when you are prompted to select Install or Repair

3. On the Recovery Tools menu, choose Command Line Console

4. In the Command Line Console, type regedit

5. It will open the regedit program. Now, highlight HKEY_LOCAL_MACHINE

6. Then, navigate to File -> Load Hive

7. Locate the Windows partition and look for \Windows\System32\config\system (Backup this first if possible)

8. Enter a key name when Regedit prompt for it (Any value will do, for this example, use tmp)

9. Located HKEY_LOCAL_MACHINE/tmp/

10. Search for Msahci and replace and Start key with Value 0.

11. Repeat step 10 for IastorV

12. Once step 10 and 11 is done, highlight "tmp"

13. Next, navigate to File -> Unload Hive to load it back to the Windows 7 Installation

14. Once done, restart the machine

15. Windows 7 should be able to start with AHCI SATA Disk Mode now.



Monday, December 4, 2017

Oracle - Reclaim disk space

Oracle does not release disk space even if you had delete the data or tablespace. If you have enterprise manager, you should use it to reclaim waste space.

You could do it manually but it will be troublesome. Below is a very simple steps to reclaim disk space used by Oracle if

1. You had added a continuous chunk of data

2. You had deleted the same continuous chunk of data added in point 1 and you had not added any data in between.

The reason being is you cannot shink and release space if free space are in between data.

If you are sure that you had met the above condition, do the following with sqlplus

1. Set column format so that the print is nice

2. Find the datafile and it used space

SELECT name, bytes/1024/1024 AS size_mb FROM v$datafile;

NAME                                                  SIZE_MB
-------------------------------------------------- ----------
/u01/app/oracle/oradata/users.dbf        10000

3. Shink the data file.

ALTER DATABASE DATAFILE '/u01/app/oracle/oradata/XE/users.dbf' RESIZE 1000M;

The final command is the trick and is pretty safe. If you try to shink a size which contain used data, it will throw an error

ORA-03297: file contains used data beyond requested RESIZE value



Monday, October 30, 2017

Sed - Example guide

sed is a very useful stream editor to perform search and replace. Below are some useful tip

1. Usage

sed 's/apple/orange/' file

The above will look for first occurrence of apple and replace with orange in the file and send the output to stdout

2. Make changes to the file

sed -i 's/apple/orange/' file

add -i option will make changes to the file itself

3. All occurrence changes

sed -i 's/apple/orange/g' file

adding g mean global replacement

4. Escape single quote

sed -i 's/'\''apple'\''/orange/' file

You can use '\'' to escape a single quote.

Monday, September 11, 2017

Facebook - Control privacy setting of liked page

By default, Facebook displayed your liked page to public. It is the user responsibility to adjust the privacy setting. And in my opinion, Facebook hide it well.

To adjust the privacy setting of liked page, do the following

1. Go to your profile page

2. At the top of the profile page, click on More

3.  Then, select Likes

4. At the Likes page, you will see a pencil button. Click on it and select Edit Privacy.

5. At the Edit Privacy page, edit the privacy of Likes to either Public, Friends, Only Me or Custom.

Thursday, August 10, 2017

Hadoop - How to setup a Hadoop Cluster

Below is a step-by-step guide which I had used to setup a Hadoop Cluster


3 VMs involved:

1) NameNode, ResourceManager - Host name:
2) DataNode 1 - Host name:
3) DataNode 2 - Host name:


1) You could create a new Hadoop user or use an existing user. But make sure the user have access to the Hadoop installation in ALL nodes

2) Install JAVA. Refer here for a good version. In this guide, Java is installed at /usr/java/latest

3) Download a stable version of Hadoop from Apache Mirrors

This guide is based on Hadoop 2.7.1 and assume that we had create a user call hadoop

Setup Passphaseless SSH from NameNode to all Nodes.

1) Run the command


This command will ask you a set of questions and accepting the default is fine. Eventually, it will create a set of private key (id_rsa) and public key ( at the user directory (/home/hadoop/.ssh)

2) Copy the public key to all Nodes with the following

ssh-copy-id -i /home/hadoop/.ssh/
ssh-copy-id -i /home/hadoop/.ssh/
ssh-copy-id -i /home/hadoop/.ssh/

3) Test the passphaseless SSH connection from NameNode with

ssh (hostname)

Install Hadoop in all Node

1) With the downloaded Hadoop distribution. Unzip it to a location where the Hadoop user had access

For this guide, I had create a /usr/local/hadoop and un-tar the distribution at this folder. The full path of Hadoop installation is /usr/local/hadoop/hadoop-2.7.1

Setup Environment Variables

1) It is best that Hadoop Variables are exported to the environment when user log in. To do so, run the command at the NameNode

sudo vi /etc/profile.d/

2) Add the following in /etc/profile.d/

export JAVA_HOME=/usr/java/latest
export HADOOP_HOME=/usr/hadoop
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native"
3) Source this file or re-login to setup the environment.

4) (OPTIONAL) Set up the above for all Nodes.

Setup NameNode & ResourceManager

1) Make a directory to hold NameNode data

mkdir /usr/local/hadoop/hdfs_namenode

2) Setup $HADOOP_HOME/etc/hadoop/hdfs-site.xml

Note: value must be a URI

3) Setup $HADOOP_HOME/etc/hadoop/core-site.xml

4) (OPTIONAL) Setup $HADOOP_HOME/etc/hadoop/mapred-site.xml (We are using NameNode as ResourceManager)

5) (OPTIONAL) Setup $HADOOP_HOME/etc/hadoop/yarn-site.xml (We are using NameNode as ResourceManager)

6) Setup $HADOOP_HOME/etc/hadoop/slaves

First, remove localhost from the file, then add the following

Setup DataNodes

1) Make a directory to hold DataNode data

mkdir /usr/local/hadoop/hdfs_datanode

2) Setup $HADOOP_HOME/etc/hadoop/hdfs-site.xml

Note: value must be a URI

3) Setup $HADOOP_HOME/etc/hadoop/core-site.xml

Format NameNode

The above setting should be enough to set up the Hadoop cluster. Next, for the first time, you will need to format the NameNode. Use the following command to format the NameNode

hdfs namenode -format

Example output is

Note: the same command can be used to reformat your existing NameNode. But remember to clean up your datanodes hdfs folder as well.

Start NameNode

You can start Hadoop with the given script

Example output is

Stop NameNode

You can stop Hadoop with the given script

Example output is

Start ResourceManager

You can start the ResourceManager, in this case, Yarn, with the given script

Example output is

Stop ResourceManager

You can stop the ResourceManager, in this case, Yarn, with the given script

Example output is

Show status of Hadoop

You can use the following command to show status of Hadoop


Example output is

Complete Testing

You can also do the following to perform a complete test to ensure Hadoop is running fine.

You could access the Hadoop Resource Manager information at http://NameNode_hostname:8088

You could also access the Hadoop cluster summary at http://NameNode_hostname:50070. You should be able to see the number of datanodes being setup for the cluster.



Tuesday, July 11, 2017

Android - Peel Remote App "Good Night" Screen

Even since upgrading to Android 7.0 "accidentally", I saw the following "Good Night" screen at night. 

This is irritating, and apparently, this "Good Night" screen come from Peel Remote App. If you disable the Peel Remote App, the "Good Night" screen will be gone. I don't use this app anyway...

Windows 7 - How to reset Windows 7 password

This is just a post of what I had found in the Internet and it works for me (See reference for the actual post). While I knew that there a...