Thursday, July 2, 2015

Installing CentOS in Oracle VirtualBox Part 1: Create a New Virtual Machine For CentOS















If you want to know your way around Red Hat Enterprise Linux distribution, but the you don't have the financial ability to obtain a license.  CentOS is your best bet get to the the Red Hat Enterprise Linux official experience.  Because CentOS is a binary capatible version of Red Hat Enterprise Linux.  Meaning all the things that matters are the same, only the branding and logos are different.  CentOS is open sourced and can be downloaded for free.  Although it might be a couple of versions behind Red Hat Enterprise Linux.  But, you should be able to perform everything you can with CentOS that you can with Red Hat Enterprise.  Below is a step by step instruction on how to install CentOS in Oracle VirtualBox.

Step-By-Step Instructions:

1.  Type http://centos.org in your browser
2.  Click on the "Get CentOS Now" button

3.  Click on "DVD ISO"


4.  Select the mirror site that is closest to you, or whatever fancies you, then save it to a folder that you will remember later on.



4.  Now we are ready to create a new machine in Oracle VirtualBox to prep for the installation of CentOS

2. Launch VirtualBox and click on the "New" button

VirtualBox New Virtual Machine
3. The "Create Virtual Machine" dialog box will be displayed, input the following information



4. It's important that you select 64-bit system, from the drop down if you want to install a 64-bit version of Red Hat

5. Give your virtual machine 2 GB of memory to start off with, you can increase this value later, if needed.  Two GB should be enough for most tasks.  You don't want to allocate too much memory to your VM machines because it might slow down your host machine.



6.  Click "Next"

7.  Select "Create a virtual hard drive now" option


8.  Click "Create"

9. On this screen you will see the flexibility of VirtualBox you can actually create Microsoft Virtual Machines with VirtualBox, it's the best of both worlds.  Select "VDI (VirtualBox Disk Image)" to create a VirtualBox Disk Image.  Then click "Next"


10.  Select "Dynamically allocated" option, this will grow your disk as needed. Then click "Next"


11. The next screen is the "File location and size" screen. The initial disk space is 8 GB,  I gave my VM 64 GB, but you can give the amount of disk space that you are comfortable with.  After you've allocated the disk space, click the "Create" button.



12. Now you have a new virtual machine ready for a CentOS in VirtualBox


























Wednesday, July 1, 2015

AngularJS SPA Pt 1 : Setting Up Angular-Seed

angular-seed is an AngularJS application skeleton template.  An application skeleton let's gives you a boiler plate template so that you don't have to start the application from scratch.  You can get the source code from https://github.com/angular/angular-seed.  Below are the steps to use angular-seed ass your application template for AngularJS.

Step-By-Step Instructions:

1.  Go the page https://github.com/angular/angular-seed

2. Open Git GUI.  if you don't have Git install you can follow this blog.

3.  In the Github angular-seed page copy the "HTTPS clone URL"

4.  In Git GUI click on the link "Clone Existing Repository"


5.  In "Source Location" paste the angular-seed clone URL that you've just copied, then on the "Target Directory" field type in or browse to the folder that you want to store the repository in on your local machine.  Then click "Clone"


6.  Click on "Expore Working Copy" to see the repository on your local machine


7.  As you can see the repository has been cloned in your local PC


8.  Now we want to add npm NodeJs to the node package manager to run, debug, and package the AngularJS, follow this blog to setup NodeJs

9.  In the command line navigate to the angular-seed git in your local machine, then type "npm install" without the double quotes.  This process might take awhile, so don't cancel the process especially if it's the first time you run the command.

10. Now open up the bower.json file then add the bootstrap library to the list of dependencies, by typing in "bootstrap": "~3.3.6" the final markup should look like the following

{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.5.7",
"angular-route": "~1.5.7",
"angular-loader": "~1.5.7",
"angular-mocks": "~1.5.7",
"html5-boilerplate": "^5.3.0",
"bootstrap": "~3.3.6"
}
}


11.  Open the .bowerrc file and change the directory to "app/js/lib", the final markup should look like the following

{
"directory": "app/js/lib"
}

Note: If you need more information on bower you can visit this blog that I wrote about it

12.  After "npm install" command finish executing type in "npm start" in the command line to have nodejs start a local web server



12. Open up the index.html file in the app folder and replace all the instances of bower_components/ path with js/lib/



13.  In the browser type in the http://localhost:8000, you will see that angular-seed is hosted on the web server