Pages

Monday, 1 December 2014

Hyper-V Error: An error occurred while attempting to start the selected virtual machine(s)

The virtual machine saved state has compatibility issues, delete the saved state in order to start this VM.


Hyper-V Error Message

Delete Save State

Symptom:
After Windows update, Hyper-V VM stuck at saved state. Unable to power off/ resume VM successfully. Kept on getting error.

Error:
An error occured while attempting to start the selected virtual machine(s).
The virtual machine saved state has compatibility issues, delete the saved state in order to start this VM.

Resolution:
1. Open Hyper-V Management Console
2. Right click on the affected VM and select Delete Saved State
3. Power on VM

Note:
You will loose some last configured stuffs from the previous VM state of after deleting the Saved State. Recommended to restore from backup after that. Equivalent to power cycle desktop/ server without saving last configurations.

Tuesday, 11 November 2014

How to Add a Facebook Like Button to Your Web Page

Adding Facebook Social Plugin Like Button


Facebook Like Box

Facebook Like Box code after <body> tag

Facebook Like Box code to appear on web page

Scenario:

Ever wondered how people include Facebook like button or box on their web site?
Here's the solution to it.

Instruction:

1. Browse to Facebook Social Plugins site at https://developers.facebook.com/docs/plugins
2. Select which type of Facebook Like button or box you wish.
3. Click Get Code to generate the HTML codes.
4. There should be 2 sets of code. First is to be pasted immediately after <body> tag and second is to be pasted where you wish the Facebook Like to appear on web page.

Note:

You must have some basic knowledge in editing HTML using HTML editor such as Dream Weaver or plain text editor.



Monday, 10 November 2014

How to Create a Microsoft Account Live ID

Using Non Microsoft Email as Live ID

Using Gmail as Live ID

Create a Live ID usning non Microsoft email


Scenario:

Too lazy to create a new free Microsoft email account (outlook.com/ msn.com/ hotmail.com/ live.com)?
Just want to use your existing email address to log into Microsoft Account?
Too many sets of email account password to remember?
Here's the solution for you.
You can use your existing non Microsoft email address to login Microsoft account.

Solution:

2. Create an Live ID account using your existing email address
3. Verify email address

Service Supported:

Office365
OneDrive
Windows Azure
TechNet Evaluation Centre
Skype

Note:

You may not want to use the same password as your email address when creating the Live ID account. As this will give Microsoft the actual username and password to your non Microsoft email account.

Saturday, 8 November 2014

Bridge Hyper-V VM Virtual Network to Physical Switch Network

Place Hyper-V VM on the Same Network as Physical Switch


Scenario:

On some instance, after installing VM in Hyper-V. The VM does not have any network connection to the physical switch.

Instruction: 

1. In Hyper-V Manager, click Virtual Switch Manager.

2. Select External virtual switch and click Create Virtual Switch.
3. Click OK

Note:

External - Connects to physical switch network (bridge mode)
Internal - Hyper-V Host can talk to Hyper-V VM (vice versa) but cannot talk to physical switch network
Private - Hyper-V VM can talk to other Hyper-V VM but not with Hyper-V Host and physical switch network

Free Virtualization on Windows Desktop with Hyper-V Client

Hyper-V Client Virtualization on Windows Desktop


Software requirement:

Only Professional and Enterprise editions of Windows 7, Windows 8, Windows 8.1, and Windows 10 is supported.

Hardware requirement:

Only 64 bit processor (Intel Core i5, Core i7, Core i3 4th generation and above).
Intel Virtualization Technology (Intel VT-X) must be enabled in BIOS.

Instruction:

Part 1: Install Hyper-V Client Feature

1. Open up Control Panel > Programs > Programes and Features. Click Turn Windows features on or off.

2. Scroll down and tick Hyper-V. Click OK.

Part 2: Create a New Virtual Machine

1. Click on Windows Start button. Type Hyper-V in search box. Click Hyper-V Manager.

2. Inside Hyper-V Manager, right click on computer name. Select New > Virtual Machine.

3. Click Next.

4. Enter VM Name and Select Location for VM installation. Make sure the target location has at least 20GB free disk space. Click Next.

5. Select Generation 2 if you are virtualizing Windows 8 and above desktop OS or Windows Server 2012 and above server OS. If you are virtualizing any other OS, select Generation 1. Click Next.

6. Enter RAM you wish to allocate for VM. Recommended minimum 2GB for 64 bit OS or 1GB for 32 bit OS. Click Next.

7. Select the physical NIC that VM will be using. For some instance, you may need to configure the Hyper-V Switch Manager first before being able to see the physical NIC here. Click Next.

8. Allocate the desired virtual hard disk size for VM. You can overload the VHD to be larger than your physical HDD, but the VHD cannot outgrow your physical HDD. Click Next.

9. Select the path where the ISO installer is located. You must have downloaded the ISO in advance before coming to this step. Click Next.

10. Review that all configurations are correct. Click Finish.

11. VM name will now be showing up in Hyper-V Manager. Scroll to VM name, right click VM name and start VM. You will now be installing the OS into VM just like on your physical machine OS installation process.

Note:

You must have the ISO OS installer downloaded in advanced. This can be obtained from TechNet Evaluation Centre for Microsoft OS.
You must have a minimum of 20GB free disk space for each VM to be installed.

Friday, 7 November 2014

How to Redirect Web URL Using Meta Tag

Use a Meta Tag to Redirect URL


Meta tag

Redirect message

Scenario:

You have a website www.old.com where you want to redirect it to a different website www.new.com

HTML Code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Refresh" content="0; url=contact.php" charset=utf-8" />
<title>Strawberry Asia Group</title>
</head>

<body>
<p>The contents you are looking for have moved. You will be redirected to the new location automatically.</p>
<p>Click <a href="contact.php" target="_self">HERE</a> to proceed to the new location manually.</p>
</body>
</html>

Refresh will use the redirect function.
Content 0 means it will redirect immediately. You may choose to place 5 (seconds) and let audience to read the redirect message before being redirected.
URL is the new web page that you want to redirect audience too. You may place a complete URL like http://www.new.com.

Instruction:

1. Insert the Meta tag into your web file (*.html/php/etc...) file.
2. Modify the Meta tag properties accordingly. Seconds to refresh, URL destination, and redirection message.
3. Save and upload your file to web server.

Note:

You'll need to know how to do basic HTML editing. Be it using HTML editor or plain text editor.

Wednesday, 5 November 2014

How to Insert Captcha Code into PHP Web Form

CAPTCHA: Telling Humans and Computers Apart Automatically (Stop Spam, Read Books)


Web form with Captcha code

Error message for invalid Captcha code

Insert Captcha PHP code in <Form> PHP page before Submit button

Insert Captcha PHP code on <Form> post action PHP page


Review:

A CAPTCHA is a program that protects websites against bots by generating and grading tests that humans can pass but current computer programs cannot. For example, humans can read distorted text as the one shown below, but current computer programs can't. The term CAPTCHA (for Completely Automated Public Turing Test To Tell Computers and Humans Apart) was coined in 2000 by Luis von Ahn, Manuel Blum, Nicholas Hopper and John Langford of Carnegie Mellon University.

Assumption:

Using reCAPTCHA with PHP.
Web form page and form post action page must be saved in *.php file.
Web server must support PHP.

Instruction:

1. Sign up for an API key at https://developers.google.com/recaptcha/
2. You'll need a Google (Gmail) account for this.
3. Enter your web site domain(s) that you want to use Captcha code.
4. Copy the public key and private key out.
6. There are 2 sets of PHP codes for PHP form page and PHP form post action page.
7. Embed the PHP codes into both PHP pages, don't forget to input your public key and private key accordingly.
9. Unzip the file.
10. Upload "recaptchalib.php" file onto web server, the same directory as your two PHP form pages are.
11. Captcha code installation on web form completed.

Note:

Always have a backup copy of your PHP form pages. Just so if you screw up the PHP page(s), you have a previous good working copy to roll back.

Tuesday, 4 November 2014

How to Block Facebook Pirate Kings Invites

How to Block Facebook App Invites


App page 1

App page 2

Instruction:

1. Go to Pirate Kings app page at https://www.facebook.com/games/ck_islands/?fbs=-1
2. Scroll down to middle of screen and look for Block on right corner of page.
3. Click Block and Confirm.

Note:

This works for all other annoying Facebook App invites too. Feel free to share it with your friends.

Windows Server L2TP Site to Site VPN

Windows Server L2TP Site to Site VPN



Network Topology:


Infrastructure:

2x Windows Server
2x Windows Desktop
Both Windows Server must have 2x NIC

IP Addressing Setup:

Yishun Server 10.0.0.1 and 30.0.0.1
Yishun Desktop 10.0.0.10, Gateway 10.0.0.1
Tai Seng Server 20.0.0.1 and 30.0.0.2
Tai Seng Desktop 20.0.0.10, Gateway 20.0.0.1

Username Setup:

Create a  username for each site.
Username Yishun for Yishun site.
Username TaiSeng for Tai Seng site.

Assumption:

Before configuring Site to Site VPN,
Yishun Desktop must be able to ping Yishun Server, vice versa.
Tai Seng Desktop must be able to ping Tai Seng Server, vice versa.
Yishun Server must be able to ping Tai Seng Server, vice versa.
Remote Access role must be installed on both servers.
Local service account username must be created on both servers.

Note:

In the event of any error in connection or not able to connect. Check in both Windows Server's event logs for RasClient error message/ code.

SuperScan v3.0 - Free TCP Port Scanner, Pinger, Resolver

First and Foremost Tool for Network Administrators


SuperScan 3


URL: http://www.mcafee.com/sg/downloads/free-tools/superscan3.aspx

Review:

SuperScan is a powerful connect based TCP port scanner, pinger and hostname resolver. Multi threaded and asynchronous techniques make this program extremely fast and versatile.

Key Features:

  • Perform ping scans and port scans using any IP range.
  • Use a text file to extract addresses from.
  • Scan any port range from a built-in list or any given range.
  • View responses from connected hosts.
  • Modify the port list and port descriptions using the built in editor.
  • Merge port lists to build new ones.
  • Connect to any discovered open port using user-specified "helper" applications.
  • Assign a custom helper application to any port.
  • Save the scan list to a text file.
  • Transmission speed control.
  • User friendly interface.
  • Comprehensive help file.
Note:

Do not attempt to use this program against computers on the Internet that you have no right to scan since you are highly likely to be tracked down and attract the attention of your ISP, possibly resulting in your account being terminated.

Monday, 3 November 2014

Nmap - Free Security Scanner

Nmap (Network Mapper) a Utility for Network Discovery and Security Auditing


Nmap Output

Ports/ Hosts

Topology

Host Details


Review:

Free and open source utility. Supports many OS: Windows, Linux, Mac OS X, BSD, and Solaris. Useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Pretty good for TCP and UDP port scanning and testing firewall open port. Nmap was named “Security Product of the Year” by Linux Journal, Info World, LinuxQuestions.Org, and Codetalker Digest. It was even featured in twelve movies, including The Matrix Reloaded, Die Hard 4, Girl With the Dragon Tattoo, and The Bourne Ultimatum. (http://www.nmap.org/movies)

Supported OS:

Microsoft Windows
Mac OS X
FreeBSD, OpenBSD, and NetBSD
Sun Solaris
AmigaOS, HP-UX, IBM AIX

Note:

Pentest without obtaining written consent/ approval from network/ server owner/ company is considered a cyber crime which is an arrestable offence. The author is not responsible for any harms or damages that is caused from using this software. Use at your own risk.

Configure iSCSI Initiator on Windows Desktop

Part 2: Configure iSCSI Initiator on Windows Desktop


Set Up iSCSI Initator

1. Click on Windows Start Button, type "iscsi" in search box, click Set up iSCSI initiator button.

2. Click Yes to continue.

3. Enter iSCSI Targer Server IP Address in Target field, click Quick Connect.

4. Click Done.

5. Click on Volumes and Devices tab, click Auto Configure.

6. Click OK.

Initialize Disk to Create New Volume

1. Start > Run > "diskmgmt.msc"

2. Click OK to initialize newly detected disk.

3. Right click on new Unallocated disk, click New Simple Volume.

4. Format new disk as X drive.

5. New disk is formatted and ready to use.

Configure iSCSI Target Server on Windows Server

Part 1: Configure iSCSI Targer Server on Windows Server


Install iSCSI Target Server Role

1. Open Server Manager, click on Add roles and features.

2. Expand File and Storage Services, expand File and iSCSI Services, check iSCSI Target Server, hit Next to install.


Create iSCSI Virtual Disk

1. Open Server Manager, click on File and Storage Services.

2. Click on To create an iSCSI virtual disk link.

3. Click on Type a custom path radio button, click Browse

4. Click New Folder, name folder as iSCSI, click Select Folder.

5. Click Next to continue.

6. Enter Name and Description for virtual disk, click Next.

7. Set virtual disk Size, click Next.

8. Select New iSCSI target radio button, click Next.

9. Set Name and Description for iSCSI target, click Next.

10. Click Add.

11. Select Enter a value for the selected type radio button, select IP Address for drop down box, enter IP Address of desktop client in Value field, click OK.

12. Click Next.

13. Click Create.

14. Click Close.

15. iSCSI virtual disk and iSCSI targer successfully created.