Showing posts with label HowTo. Show all posts
Showing posts with label HowTo. Show all posts

Sunday, March 6, 2022

Use Windows Subsystem for Android in Windows 11

Windows Subsystem for Android i.e. WSA allows your device to run Android apps natively in Windows 11.

This article explains how to set up WSA in Windows 11 to Run Android Apps. WSA runs as a virtual machine using Hyper-V and is based on AOSP version 11. Also, The feature is only available for Windows Insiders in Beta Channel as of now.

Requirements

As of now, WSA has some specific requirements. With time, some pre-requisites like Region would be eased. See the following requirements:

  1. Your Device must be running Build 22000 and meeting the requirements for Windows 11, including supported processors.
  2. The Computer must support virtualization and be enabled in BIOS/UEFI and Optional Features.
  3. The device must have at least 8GB of RAM and SSD as a Storage device. For WSA, a Hard drive is not supported.
  4. The Store version must be 22110.1402.6.0 or higher. Go to Store Library to update.
  5. The PC's Region must be set to the US.
  6. The Amazon account you plan to use must be US-based.
  7. Your PC must be in Windows Insider Program Beta Channel.


If these requirements are met, follow the steps below to set up and use Windows Subsystem for Android.

Getting started with Windows Subsystem for Android

  1. Open the Amazon App store from this link.
  2. Click Install. It would download Amazon AppStore and Windows subsystem for Android.
  3. When done, you would see the Windows subsystem for Android on your app list, together with Amazon AppStore.
  4. Open the Amazon AppStore, and sign in with your US-based Amazon Account on the screen that shows.
  5. Locate your App in the catalog and click Install. At the time of writing, only around 50 apps are available in the Store, but Microsoft will update the list over time.

Amazon AppStore started using WSA
Windows Subsystem for Android Settings.

There are also a bunch of Android Settings you can customize as well, which are as under.

F
  1. files show the files which Apps download to the Device.
  2. Subsystem Screen reader helps accessibility-wise, like screen reading on in Android apps you plan to run.
  3. Developer mode helps you to sideload an APK file manually using ADB. See here
  4. Resources: If the Subsystem is selected As needed, no resources are used in the Background, so as a result, apps open slowly. If a continuous option is selected, resources continue to be used in the Background, and Apps open quickly.

These steps can help you get started with running Android apps using Windows Subsystem for Android on Windows 11. Hopefully, it would be available for the general public soon.

Monday, February 28, 2022

How to Fix Time and Date Issues in Windows 11 / 10 and 7 | 6 Different Methods in 2022

If your computer is showing the wrong date or time then you will face significant difficulty in some applications especially if you are browsing. In order to fix this issue follow these simple fixes and your computer will be showing the right time and date just like before.

Fix-1 Set time automatically-

You can always enable your computer to show time automatically

1. Press Windows key+I together to open the Settings window on your computer.

2. Now, click on “Time & Language” in the Settings window.

Time And Launguage Settings


3. In the Settings window, on the left-hand side click on “Date & time“.

4. Now, on the right-hand side of the same window, under Current date and time settings, toggle “Set time automatically” to “On“.

Set Time Automatically New


Close the Settings window and restart your computer.
Check if it works or not.

For Windows 11 users

1 – Open Windows search and Type Change the date and time in it and click on search result.

Change Date Time Settings Search Min

2 – Make sure the Set time automatically option is turned to “On“.

Set Time Automatically Min

Fix-2 Automate Windows Time service-

Automate Windows Time service on your computer.

1. Click on the Search box beside the Windows icon and then type “services“.

2. Now, click on “Services” in the search results to open the Services window.

Services New

3. In the Services window, scroll down and double click on “Windows Time“.

Windows Time Double Click

4. In the Windows Time Properties window, click on ‘Startup type:‘ and then choose “Automatic” from the drop-down list.

5. Now, click on “Start” to start the service on your computer.

Windows Time Automatic

6. Finally, click on “Apply” and then on “OK” to save the changes.

Apply Ok Windows Time

 

Close Services window.

Reboot your computer to witness the changes on your computer.

After rebooting check the time and date settings on your computer.

Fix-3 Set time according to Internet Time settings-

1. Press Windows key+R to launch the Run window on your computer.

2. Type this run command in the Run window and then hit Enter. The date and Time window will be opened.

timedate.cpl

Time Date Settings

2. In the Date and Time window, go to the “Internet Time” tab and then click on “Change settings…“.

Date And Time Change Settings

3. In the Internet Time Settings window, check the option “Synchronize with an Internet time server“.

4. Now, click on ‘Server:‘ and choose “time.windows. com” server from the drop-down.

Internet Time Settings New

5. Then click on “Update Now“. Finally, click on “OK” to save the changes on your computer.

Udpate Now

6. In the Date and Time settings window, click on “Apply” and “OK” to save the changes on your computer.

Apply And Ok

Close Settings window. Check if you are still facing the same problem at your end or not. Your problem should be solved.

Fix-4 Reset w32time.dll from CMD-

Res-registering w3time.dll from Command Prompt may work out for you.

1. Click on the Search box beside the Windows icon and then type “cmd“.

2. Then, right-click on “Command Prompt” in the elevated search result and choose “Run as administrator“.

Cmd Search

Command Prompt with administrative rights will be opened.

3. In Command Prompt window, copy-paste this command and then hit Enter to execute it on your computer.

regsvr32 w32time.dll

After executing the command, close the Command Prompt window.

Restart your computer to save the changes.

Check if it works or not.

Fix-5 Set time and date manually-

If nothing is working out, set time and date manually-

1 – Open Windows search and Type Change the date and time in it and click on search result.

Change Date Time Settings Search Min

2 – Now, Turn Off Set Time automatically option to off.

Now, click on change.

Set Time Automaticallu

For Windows, 11 users screenshot will look like the one given below

Change Date Time Min

5. In the Change date and time window, click on “Date” to change the date to the actual date.

6. Repeat the same feat for “Time” by setting the right time.

7. Now, Click on “Change“.

Change Date

8.  Now, in the Settings window, scroll down and find ‘Time Zone‘.

9. Click on the drop-down and then select the time zone you are currently in*.

Time Zone Final Copy

*NOTE– You will notice the same time zone for a variety of locations. Choose the particular time zone where you are.

  • Close Settings window.
  • Now, reboot your computer.
  • After rebooting check the time and date settings.
  • Your problem will be solved.

Fix-6 Using Registry Editor

1. Press Windows key + R key together to open Run.

2. Now, Type Regedit in it and click OK.

 

Press Win + R To Open Run Box, Type Regedit, Hit Ok

 

3. After it opens up, before proceeding, take a registry backup.

Now, Move to the following location in the registry editor.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet

4. Now, locate ControlTimeZoneInformation in the left menu, if it does not exist, Right-click on CurrentControlSet and create a new key.

Right Click New Key

5. name it ControlTimeZoneInformation .

6. Now, on the right side, right-click on empty space anywhere and click on New > Dword (64 bit).

Name it as RealTimeIsUniversal .

New Dword 64 Bit

7. Double click on RealTimeIsUniversal  . Change Value data to 1.

Valuedata0real

 

Note: If still your problem is not solved, try to change your BIOS battery as it may be the reason behind this. As BIOS is having no battery backup, it fails to update time after the computer is shut down.

Tuesday, August 31, 2021

How to Creating a Virtual Private Cloud in AWS - Architecting on AWS Part 3 (2021)

Traditional networking is difficult—it involves equipment, cabling, complex configurations, and specialist skills. Fortunately, Amazon Virtual Private Cloud (Amazon VPC) hides the complexity while making it easy to deploy secure private networks.


This lab shows you how to build your own VPC, create subnets, and direct traffic between VPC components. The following image shows the final architecture:


An optional Challenge task is available. In the challenging task, you create a VPC peering connection to a shared services VPC. Then, you use an application and database to test connectivity between the VPCs.


Objectives


After completing this lab, you will be able to:


  • Create a VPC

  • Create public and private subnets

  • Create an internet gateway

  • Configure a routeing table and associate it to a subnet


Article Process Duration


This Article Procedure requires approximately 30 minutes to complete.

Common Login Errors
Error: You must first log out



If you see the message, You must first log out before logging into a different AWS account:

Task 1: Creating a VPC

In this task, you create a new VPC in the AWS Cloud.


A VPC is a virtual network dedicated to your AWS account. A VPC is logically isolated from other virtual networks in the AWS Cloud. You can launch AWS resources, such as Amazon Elastic Compute Cloud (Amazon EC2) instances, into the VPC. You can modify the VPC's IP address range; create subnets; and configure route tables, network gateways, and security settings.


  1. In the AWS Management Console, on the Services menu, click VPC.

  2. If you see New VPC Experience at the top-left of your screen, ensure  New VPC Experience is selected. This lab is designed to use the new VPC Console.


The VPC management console offers a VPC Wizard, which can automatically create several VPC architectures. However, in this lab, you will create the VPC components manually.


  1. In the left navigation pane, click Your VPCs.


A list of your VPCs displays. A default VPC is provided so that you can launch resources as soon as you start using AWS. There is also a Shared VPC, which you will use later in the lab. However, you will now create your own VPC.


The VPC will have a CIDR range of 10.0.0.0/16, which includes all IP addresses that start with 10.0.x.x. This range contains over 65,000 addresses. You will later divide the addresses into separate subnets.


  1. Click Create VPC and configure:

  • Name tag: Lab VPC 

  • IPv4 CIDR block: 10.0.0.0/16 

  1. Click Create VPC


 Note If these options do not appear, cancel and ensure you clicked Your VPCs in the left navigation pane. Then, click Create VPC again.

  1. In the lower half of the page, click the Tags tab.


Tags are useful for identifying resources. For example, a tag can be used to identify dev/test/production environments or cost centers.

  1. Above the list of VPCs, click Actions and select Edit DNS hostnames.

This option assigns a friendly DNS name to Amazon EC2 instances in the VPC, such as the following:

ec2-52-42-133-255.us-west-2.compute.amazonaws.com


  1. Select  Enable.

  2. Click Save changes


Any Amazon EC2 instances launched into the VPC will now automatically receive a DNS hostname. You can also add a more meaningful DNS name (for example, app.company.com) later by using Amazon Route 53.

Task 2: Creating subnets

A subnet is a sub-range of IP addresses within the VPC. You can launch AWS resources into a specified subnet. Use a public subnet for resources that must be connected to the internet, and use a private subnet for resources that are to remain isolated from the internet.


In this task, you will create a public subnet and a private subnet in the Lab VPC, as shown in the following image:


Create a public subnet

The public subnet will be for internet-facing resources.


  1. In the left navigation pane, click Subnets.

  2. Click Create subnet and configure:

  • VPC: Lab VPC

  • Subnet name: Public Subnet

  • Availability Zone: Select the first Availability Zone in the list (Do choose No Preference.)

  • IPv4 CIDR block:

  1. Click Create subnet


 Note The VPC has a CIDR range of 10.0.0.0/16, which includes all 10.0.x.x IP addresses. The subnet you just created has a CIDR range of 10.0.0.0/24, which includes all 10.0.0.x IP addresses. These ranges may look similar, but the subnet is smaller than the VPC because of the /24 in the CIDR range.

Now, configure the subnet to automatically assign a public IP address for all instances launched within it.

  1. Select  ☑ Public Subnet.

  2. Click Actions and select Modify auto-assign IP settings.

  3. Select ☑ Enable auto-assign public IPv4 address.

  4. Click Save

 Note Even though this subnet is named Public Subnet, it is not yet public. A public subnet must have an internet gateway, which you will create and attach later in the lab.

Create a private subnet

The private subnet will be for resources that are to remain isolated from the internet.

  1. Use what you have just learned to create another subnet with the following settings:

  • VPC: Lab VPC

  • Name tag: Private Subnet

  • Availability Zone: Select the first Availability Zone in the list (Do choose No Preference.)

  • IPv4 CIDR block: 10.0.2.0/23

 ☑ Note The CIDR block of 10.0.2.0/23 includes all IP addresses that start with 10.0.2.x and 10.0.3.x. This is twice as large as the public subnet because most resources should be kept private unless they specifically need to be accessible from the internet.

Your VPC now has two subnets. However, it is totally isolated and cannot communicate with resources outside the VPC. You will next configure the public subnet to connect to the internet via an internet gateway.

Task 3: Creating an internet gateway

An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between instances in a VPC and the internet. An internet gateway does not impose availability risks or bandwidth constraints on network traffic.

An internet gateway serves two purposes:

  • To provide a target in route tables to connect to the internet

  • To perform network address translation (NAT) for instances that have been assigned public IPv4 addresses

In this task, you will create an internet gateway so that internet traffic can access the public subnet.

  1. In the left navigation pane, click Internet Gateways.

  2. Click Create internet gateway and configure:

  • Name tag: Lab IGW

  1. Click Create internet gateway

You can now attach the internet gateway to your Lab VPC.

  1. Click Actions and select Attach to VPC.

  2. For VPC, select Lab VPC.

  3. Click Attach internet gateway

The internet gateway is now attached to your Lab VPC. Even though you have created an internet gateway and attached it to your VPC, you must also configure the routeing table of the public subnet to use the internet gateway.

Task 4: Configuring route tables

A routeing table contains a set of rules, called routes, which are used to determine where network traffic is directed. Each subnet in a VPC must be associated with a routeing table; the table controls the routing for the subnet. A subnet can only be associated with one route table at a time, but you can associate multiple subnets with the same route table.

To use an internet gateway, a subnet's route table must contain a route that directs internet-bound traffic to the internet gateway. If a subnet is associated with a routeing table that has a route to an internet gateway, it is known as a public subnet.

In this task, you will do the following:

  • Create a public route table for internet-bound traffic

  • Add a route to the routeing table to direct internet-bound traffic to the internet gateway

  • Associate the public subnet with the new route table

  1. In the left navigation pane, click Route Tables.

Several route tables are displayed, but there is only one route table associated with Lab VPC. This route table routes traffic locally, so it is called a private route table.

  1. Select the routeing table that shows Lab VPC in the VPC ID column. (You can expand the column to see the names.)

  2. Hover in the Name column and click the pencil  ✏ icon.

  3. Enter the name of Private Route Table and then click the checkmark  ✔ icon.

  4. In the lower half of the page, click the Routes tab.


There is only one route. It shows that all traffic destined for 10.0.0.0/16 (which is the range of the Lab VPC) will be routed locally. This allows all subnets within a VPC to communicate with each other.

Now, create a new public route table to send public traffic to the internet gateway.


  1. Click Create route table and configure:

  • Name tag: Public Route Table

  • VPC: Lab VPC

  1. Click Create and then click Close

  2. Select  ☑ Public Route Table, ensuring that it is the only route table selected.

  3. On the Routes tab, click Edit routes

Now, add a route to direct Internet-bound traffic (0.0.0.0/0) to the internet gateway.

  1. Click Add a route and configure:

  • Destination:

  • Target: Select Internet Gateway and then Lab IGW

  1. Click Save routes and then click Close

The last step is to associate this new route table with the public subnet.

  1. Click the Subnet Associations tab.

  2. Click Edit subnet associations

  3. Select the row with Public Subnet.

  4. Click Save

The Public Subnet is now public because it has a route table entry that sends traffic to the internet via the internet gateway.

To summarize, you can create a public subnet as follows:

  • Create an internet gateway

  • Create a routeing table

  • Add a route to the routeing table that directs 0.0.0.0/0 traffic to the internet gateway

  • Associate the routeing table with a subnet, which therefore becomes a public subnet

Task 5: Creating a security group for the App Server

A security group acts as a virtual firewall for instances to control inbound and outbound traffic. Security groups operate at the instance network interface level, not the subnet level. Therefore, each instance can have its own firewall that controls traffic. If you do not specify a particular security group at launch time, the instance is automatically assigned to the default security group for the VPC.

In this task, you will create a security group that allows users to access the App Server via HTTP.

  1. In the left navigation pane, click Security Groups.

  2. Click Create a security group and configure:

  • Security group name:

  • Description:

  • VPC: Lab VPC

  1. For Inbound rules, click Add rule and configure:

  • Type: HTTP

  • Source: Anywhere

  1. At the bottom of the page, click Create a security group

The inbound rules determine what traffic is permitted to reach the instance. You have configured it to permit HTTP (port 80) traffic coming from anywhere on the internet (0.0.0.0/0).

You will use this application security group in the next task.

Task 6: Launching an App Server in the public subnet

To test that your VPC is correctly configured, you will now launch an Amazon EC2 instance into the public subnet and confirm that the App Server is accessible from the internet.

  1. On the Services menu, click EC2.

  2. At the top-left of the screen, ensure that  New EC2 Experience is selected. This lab is designed to work with the New EC2 Console.

  3. Scroll down the page, click Launch instance and select Launch Instance.

  4. Configure the following:

Step 1 (Choose AMI)

  • AMI: Amazon Linux 2 AMI

Step 2 (Choose Instance Type)

  • Instance Type: t3.micro (If you are unable to launch t3.micro, try using t2.micro. This is because all instance types are not available in all regions/AZs.)

Step 3 (Configure Instance)

  • Network: Lab VPC

  • Subnet: Public Subnet

  • IAM role: Inventory-App-Role

  • Scroll down to and expand  Advanced Details. Copy and paste the following into User data:

#!/bin/bash

# Install Apache Web Server and PHP

yum install -y httpd mysql

amazon-linux-extras install -y php7.2

# Download Lab files

wget https://us-west-2-tcprod.s3.amazonaws.com/courses/ILT-TF-200-ARCHIT/v6.8.26/lab-2-webapp/scripts/inventory-app.zip

unzip inventory-app.zip -d /var/www/html/

# Download and install the AWS SDK for PHP

wget https://github.com/aws/aws-sdk-php/releases/download/3.62.3/aws.zip

unzip aws -d /var/www/html

# Turn on web server

chkconfig httpd on

service httpd start


Step 4 (Add Storage)

  • Use default settings (no changes)

Step 5 (Add Tags)

  • Click Add Tag

  • Key:

  • Value:

Step 6 (Configure Security Group)

  • Click Select an existing security group

  • Select App-SG

  • Click Review and Launch

You receive a warning that you will not be able to connect to the instance. This is acceptable because you will not be connecting to the instance. All configuration is done via the user-data script.

  • Click Continue

Step 7 (Review)

  • Click Launch

  • Select Proceed without a key pair

  • Select  I acknowledge that...

  • Click Launch Instances

A status page notifies you that your instances are launching.

  1. Click View Instances

Before continuing, wait for the instance state to display running.

 Tip To update the display, click the refresh icon occasionally.

  1. Once the instance is running, select  App Server.

  2. In the Details tab, copy the IPv4 Public IP address.

  3. Open a new web browser tab, paste the IP address into the address bar, and press ENTER.

If your VPC was configured correctly, you should see the Inventory application and the message Please configure Settings to connect to the database. No database settings have been configured yet, but the appearance of the Inventory application proves that the public subnet has been correctly configured.

 Note If the Inventory application does not appear, wait 60 seconds and refresh the browser tab to try again. It can take a couple of minutes for the EC2 instance to boot and run the script that installs software.

Challenge: Configure VPC peering

 Note This challenging task is optional and is provided in case you have lab time remaining. To skip to the end of the lab, click here.

Another VPC called Shared VPC has been provided as part of this lab. Your task is to create a peering connection between your Lab VPC and the Shared VPC, as shown in the following architecture diagram:


A VPC peering connection is a networking connection between two VPCs that enables you to route traffic between them privately. Instances in either VPC can communicate with each other as if they are within the same network. You can create a VPC peering connection between your own VPCs, with a VPC in another AWS account, or with a VPC in a different AWS Region.

A database has already been provisioned in the Shared VPC. Once you have configured VPC peering, you will connect the database to the Inventory application to confirm that the peering has been correctly configured.

Create a peering connection

  1. In the AWS Management Console, on the Services menu, click VPC.

  2. In the left navigation pane, click Peering Connections.

First, create a peering connection, which is the VPC component that links two VPCs together.

  1. Click Create Peering Connection and configure:

  • Peering connection name tag:

  • VPC (Requester): Lab VPC

  • VPC (Accepter): Shared VPC

  1. Click Create Peering Connection and then click OK

When a peering connection is created, the target VPC must accept it. This is because the target VPC might be owned by a different account, or the user creating the peering connection might not have permission to accept the connection for the target VPC. However, in this lab, you will accept the connection yourself.

  1. Select  Lab-Peer.

  2. Click Actions and select Accept Request.

  3. Click Yes, Accept and Close

Configure route tables

Now, update the route tables in both VPCs to send traffic from the Lab VPC to the peering connection, as shown in the following image:


  1. In the left navigation pane, click Route Tables.

  2. Select  Public Route Table.

You will configure the public route table that is associated with the Lab VPC to send traffic to the peering connection if the destination IP address falls within the range of the Shared VPC.

  1. On the Routes tab, click Edit routes

  2. Click Add a route and configure:

  • Destination:

  • (This is the CIDR range of the Shared VPC.)

  • Target: Select Peering Connection and then Lab-Peer

  1. Click Save routes and then click Close

Now, configure the reverse flow for traffic coming from Shared VPC and going to the Lab VPC.

  1. Select  Shared-VPC Route Table, ensuring that it is the only route table selected.

This is the routeing table for the Shared VPC. You will configure it to send traffic to the peering connection if the destination IP address falls within the range of the Lab VPC.

  1. On the Routes tab, click Edit routes

  2. Click Add a route and configure:

  • Destination:

  • (The is the CIDR range of the Lab VPC.)

  • Target: Select Peering Connection and then Lab-Peer

  • Click Save routes and then click Close

The route tables have now been configured to send traffic via the peering connection when the traffic is destined for the other VPC.

Test the peering connection

A database has already been provisioned in the Shared VPC. You will now test the peering connection by configuring the Inventory application to access that database across the peering connection.

  1. Return to the web browser tab with the Inventory application.

  2. Click  Settings and configure:

  • Endpoint: Paste the Endpoint value shown to the left of the instructions you are currently reading

  • Database:

  • Username:

  • Password:

  1. Click Save

The application should now show data from the database.

This proves that the peering connection is working because the Shared VPC does not have an internet gateway. The only way to access the database is via the peering connection.

Conclusion

Congratulations! You now have successfully:

  • Created a VPC

  • Created public and private subnets

  • Created an internet gateway

  • Configured a routeing table and associated it to a subnet

End of Article Please Submit your Review.

1 star = Very dissatisfied
2 stars = Dissatisfied
3 stars = Neutral
4 stars = Satisfied
5 stars = Very satisfied

Your feedback is welcome and appreciated.
If you would like to share any feedback, suggestions, or corrections, please provide the details in our

YouTube Channel: https://youtube.com/c/CodeOn