Thursday, September 30, 2021
Here we created an object called "person" with three properties we are going to use the for/in loop to display the property names as well as the values of those properties
var person = new Object();
person.name = "Tech Junkie";
person.occupation = "Blogger";
person.location = "Mars";
for(var p in person)
console.log(p + ": " + person[p]);
Wednesday, September 29, 2021
In the previous post we went over how to create a Classic Load Balancer, in this post we are going to create one of types of load balancer AWS offers. We are going to create a Network Load Balancer, this balancer is for websites that require high performance and low latency websites, think of streaming data. If your website needs real time streaming data, this is probably the load balancer for you. It supports layer 4 protocols such as UDP, TLS and TCP protocols. If you need a static IP or Elastic IP assigned to your load balancer this is your only choice because the other two load balancer does not give you the option to assign Elastic IPs.
Before we create the load balancer we need to create more than one instances with a web server because we need to test that the load balancer is able to switch.
1. Create two instances with the user data to create Apache Web Servers with these commands in the User Data for instance, if you need the full instruction on how to create instances with User Data you can read this post
Tuesday, September 28, 2021
Here are the steps to setup your user name and editor for git:
1. First let's set our user name, with the command git config --global user.name "Your name goes here"
Friday, September 24, 2021
Thursday, September 23, 2021
For example something like this sudo yum update unlike the su command which prompts you for the root password. The sudo command prompts you for the password of the logged in user.
In order for the sudo to work we have to configure the /etc/sudoers file. There is a special command for editing the sudoers file and it's the visudo command. This command should be used at all times when editing the sudoers file instead of a text editor.
Wednesday, September 22, 2021
If your website starts to become popular, especially if it's not static you might noticed that the performance is starting to degrade. The most logical step is to scale your architecture with a load balancer. AWS offers three types of load balancers, there are:
- Application Load Balancer
- Protocols (HTTP, HTTPS)
- Specializes in web applications, deals with traffic at the request level (layer 7)
- Supports query strings, path routing, parameter routing, IP routing
- Supports IP addresses, Lamda Functions (serverless, microservices), and containers
- Network Load Balancer
- Protocols(TCP, TLS, UDP, TCP_UDP) - Layer 4
- When high performance and low latency is required
- TLS offloading
- Elastic IPs can be assigned
- Classic Load Balancer
- Protocols (TCP, SSL, HTTP, HTTPS) - Layer 4, 7
- Old generation, not recommended unless you are running EC2-Classic instance
Tuesday, September 21, 2021
Here are the steps to setup WildFly on your machine:
- Go the WildFly website and download the latest version, https://wildfly.org/downloads/
Monday, September 20, 2021
In the last post we created a new partition for a new disk that we've just added, in this post we are going to mount the partition and create a filesystem for the partition so that we can use it. First lets check to see that we have a new partition by running the fdisk -l command
As you can see a new partition called /dev/sdb1 has been created with 8 GB of disk space. Now we all good to go.
Here are the steps to mount and create a file system in Linux:
1. First we need to create a filesystem so that the Linux system can read and write to it. Linux uses the xfs filesystem so that's what we are going to use. To do that we have to run the mkfs command. To make an xfs filesystem you simply type mkfs.xfs /dev/sdb1
2. Now that we have a filesystem that Linux could understand, it is time to mount the partition so that we could use in our server. It's a two step process to accomplish that, first you have to create a directory, type mkdir /data to create /data directory. Then you are going to mount the partition to that directory with this command mount /dev/sdb1 /data now if you run the command df -h you will see the partition has been mounted to the /data director
3. We still have one more step before we are finished. Everything will work like it should, but once you reboot the settings will not persist in it's current state. To make the settings persist we have to edit the fstab file. So type the command vi /etc/fstab make sure you have your system backed up and you can revert back because if you messed up you will not be able to log in. When you are in the fstab file type in the following line at the end of the file
/dev/sdb1 /data xfs defaults 0 0
Friday, September 17, 2021
Thursday, September 16, 2021
Wednesday, September 15, 2021
In the previous post we went over what a load balancer is, in this post we are going to create one of types of load balancer AWS offers. We are going to create a Classic Load Balancer, this balancer is not recommended by Amazon, you should only create this if you have to support EC2-Classic instances.
Before we create the load balancer we need to create more than one instances with a web server because we need to test that the load balancer is able to switch.
1. Create two instances with the user data to create Apache Web Servers with these commands in the User Data for instance, if you need the full instruction on how to create instances with User Data you can read this post
Tuesday, September 14, 2021
Here are the steps to create a web project in Eclipse:
1. Right-click on "Servers" → "New" → "Other"
2. Expand the "Web" node then select "Dynamic Web Project", then click "Next"→
Monday, September 13, 2021
In the previous post we used the df and fdisk commands to gather storage information about our Linux system. In this post we are going to add a new disk and partition to our system. I am using VBox and you can create a new storage by going to settings and adding a new disk, it will be just like adding a real physical disk on a physical machine except it's virtual. You can go to this post if you want to know how to do it
Here are the steps to adding a new disk and creating a partition for the disk:
1. First we want to see what the new disk is identified as in our Linux system, we can do that by typing the command fdisk -l
As you can see the new disk is identified as /dev/sdb and it has 8 GB which is correct
2. We want to go into the fdisk utility to work with our new disk, to do that you type fdisk /dev/sdb then press enter
3. Press m to see all the options that are available
From the help menu we know that we have to use the n option to add a new partition
4. Type n and then press Enter to get into the create partition steps
5. You will be given a choice of the partition being a primary or extended, since this is a new disk we want to make it a primary partition, so press p and ENTER
6. For the partition number accept the default 1 by pressing ENTER, once again it's a new disk so it's going to be the first partition on the disk
7. Accept the default again for the first sector by pressing ENTER
8. Accept the default again by pressing ENTER, if you want to create more than one partition and not use the entire disk you enter the size so that there's disk space left like this +4G, and it would use only 4 GB for the partition, but since we want to use the entire disk we just going to press ENTER
A new partition has been created for the new disk. Or have you? A lot of beginners forget to do the next step and the partition is not created even though they went to through all the steps. The final step to the process is that you have to type w to write your changes else nothing will happen. It's just a confirmation that fdisk needs, for you to confirm that the changes are correct in the final step.
In the next post we are going to mount the partition and create a filesystem for the new partition.
Friday, September 10, 2021
Thursday, September 9, 2021
In this post we will install, update and remove the php package.
Wednesday, September 8, 2021
In the world of AWS you have to be familiar with the different features and what they are called. Well two very important building blocks of all the services that AWS offers are the S3 and the IAM Role. S3 is basically an object storage repository that are called buckets, but it is more than just a storage, you can turn to the storage into a static website. We'll get into that later. It's public facing, so you can access it over the internet.
IAM Role is an identity that you can assign policies to and that role assumes the permission. Therefore only instances with a role that has a policy to access S3 can assume that role and have access to the S3.
So let's start creating the assets on the diagram above:
Tuesday, September 7, 2021
Here are the steps to configure Tomcat to work with Eclipse:
You have to download the zip file version of the install to make Tomcat work with the Eclipse. I had no luck with the Windows Installer
So go to https://tomcat.apache.org/download-90.cgi
Then click on the .zip version of the download, and then extract the files into the
Now extract the content of the zip file into the folder C:\apache-tomcat-9.0.24
Monday, September 6, 2021
To simulate a real world scenario often times you have to add components to your virtualize Linux operating system. In this post we are going to add a new disk to our virtual machine in Oracle's VirtualBox.
Here are the steps to adding a new disk to a VM:
1. Right click on your virtual machine and select settings then select "Storage", the power must be off. Click on the second icon next to the "Controller: SATA" section
2. On the next dialog click on the "Create" icon
3. Click "Next"
4. Click "Next"
5. Type in a name for the disk and then click "Create"
6. Select the disk under "Not Attached" and then click on "Choose"
7. Now your new disk is attached to the Virtual Machine, click "OK"
Friday, September 3, 2021
Thursday, September 2, 2021
SELECT MAX(UnitPrice) AS HighestPrice, MIN(UnitPrice) AS LowestPrice FROM Products
The query above gets the highest and lowest prices for the Products table in the Northwind database
Wednesday, September 1, 2021
In the previous post we created a public and private subnet in our VPC. In this post we are going to create a NAT gateway so that our private instances can access the internet. That's useful when there's a need to update the instance. For example if we ping google.com right now there will be 100% package lost in our private instance because we cannot get to the internet. After we attach the instance to the NAT gateway we will be able to ping google.
It would go on for a while but eventually it would say the package is lost.
Now let's create our NAT Gateway, it is important that we delete the NAT Gateway if it's not in use because you have to pay for it.