Introduction to AWS

What is AWS?

Amazon defines Amazon Web Services (AWS) as "a secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses scale and grow".

What is cloud computing?

On demand delivery of IT resources and applications via the Internet

Resources on cloud

With the traditional model, you need to procure sufficient hardware, bandwidth, and human resources to run the IT infrastructure. Your infrastructure is fixed and financed.

The VirtualBox VM was created with a user that doesn't match the current user running Vagrant.

Error Message

The VirtualBox VM was created with a user that doesn't match the
current user running Vagrant. VirtualBox requires that the same user
be used to manage the VM that was created. Please re-run Vagrant with
that user. This is not a Vagrant issue.


You copied someone vagrant box or your own from one machine to another. The box comes with its own settings that are specific to the user so they need to be removed.


Simply remove the .vagrant directory

$ rm -rf .vagrant

Python3 with MySQL database

If you don't already have MySQL installed, install it with the following commands (mac only):

$ brew info mysql
$ brew install mysql
$ brew tap homebrew/services

Run the following commands to start or stop mysql. Start MySQL before proceeding:

$ brew services stop mysql
$ brew services start mysql

To see available sevices:

$ brew services list

To check MySQL version:

$ mysql -V

Set root password

Python3 with Oracle database


These instructions are for Mac OS:

First install homebrew. Never use sudo for brew.

$ /usr/bin/ruby -e "$(curl -fsSL"
$ which brew

Install Python3. The installation comes with pip3.

$ brew install python3
$ which pip3

Install cx_Oracle, the library that allows python3 to communicate with Oracle database.

File Management

Node uses the fs library to provide rich and powerful file management functionality. First let's a directory and some files:

$ mkdir data; cd data
$ touch provinces.txt capitals.txt

Add the following text to provinces.txt

British Columbia
New Brunswick
Newfoundland and Labrador
Nova Scotia
Prince Edward Island

Add the following to capitals.txt

Child Process

The child_process module allows you to communicate with other applications on your system by executing external processes in your environment. There are four kinds of child processes; exec(), spawn(), execFile(), fork(). I will be covering exec() and spawn() here. If a child process will execute once, use exec() function. For example the "cal" command on terminal prints the current month's calendar in the terminal. The command is executed once, prints a result and that's it. If a child process would be running for a long time and printing output several times, use spawn() function.


Node.js is an event-driven system. When you are performing different tasks, different events are emitted. You need to understand those events and how to use them. Events are defined by different modules. For example process.on() is an event. You can also create and use your own events. See example:

var events = require('events');
var eventEmitter = new events.EventEmitter();

eventEmitter.on('bankrupt', function() {
    console.log('You are bankrupt');

var networth = -20000;
if (networth < 0) {


Built-in Modules

A module encapsulates relate code, such as code for handling files, into a single unit of code. Node ships with many useful modules. These are called built-in modules. Programmers can create new modules. These are called custom modules.

Following is a list of some built-in modules: