Wednesday 1 October 2014

Installing laravel environment using vagrant and vm virtualbox


Environment : Windows 64-bit 8.1
1) Accumulated all the environment files into one folder
2) Either create a vagrant file using "vagrant init precise64/hashicorp"(64-bit windows system) command(windows command prompt) / use the configured vagrant file by copying that to the folder location
Refer : vagrant doc
3) While doing "vagrant up" after the file is created, an error was displayed while running the OS image on Oracle VM Virtual BOX.The error obtained was due to a compatibility problem with 64bit Win 8.1 OS by Virtual box for the particular version. The error obtained while running VM is as follows :
Result Code: E_FAIL (0x80004005)Component: ConsoleInterface: IConsole {8ab7c520-2442-4b66-8d74-4ff1e195d2b6}
Discussion regarding the error : Ticket raised

The issue was solved downloading a later version of virtual box


Dual booting Ubuntu and Windows 8 (64-bit) System (UEFI Supported)

A Brief on the problem

Before explaining the steps to do it I want to be clear that I have tried many ways of installing Ubuntu (Or any other distro for that matter) from within Windows 8. No luck. Microsoft Windows really created a big mess for all Linux distributions. If you have a pre-installed Windows 8 system, you will probably never be able to install Ubuntu or any other OS in the normal (LiveCD/LiveUSB) or Wubi way. This is because Windows 8 introduced several new features, of which 2 are:
  • UEFI which substitutes what we have known as the BIOS (an alternative to)
  • Secure Boot which prevents anything but the installed operating system, in this case Windows 8 from booting. This is no longer the case for Ubuntu since 12.04.2
On a further note I want to mention something about Secure Boot taken from the UEFI Wiki
SecureBoot
"Secure Boot" is a new UEFI feature that appeared in 2012, with Windows 8 preinstalled computers. Ubuntu supports this feature starting with 12.10 64 bit (see this article) and 12.04.2 64 bit, but as PCs implementing support for it have only become widespread at the end of 2012 it is not yet widely tested, so it's possible that you may encounter problems booting Ubuntu under Secure Boot.
IMPORTANT: If you do find a bug, please file a bug report against the shim package in Ubuntu, preferably using the command:
ubuntu-bug shim
once you've installed with Secure Boot disabled. As mentioned by slangasek:
It is not required to disable SecureBoot in the firmware to install Ubuntu on a Windows 8 machine. Ubuntu 12.04.2 and 12.10 are SecureBoot-compatible. Any machine that ships with the recommended Microsoft Third-Party Marketplace keys in firmware will be able to boot Ubuntu under SecureBoot. If there is any problem file a launchpad bug for the shim package.
So with all of this said, installing Ubuntu via WUBI is not doable (not recommended at least from me), things like trying to boot for example with the Windows 8 bootloader are not possible right now unless something changes in the future (There are also some bugs related to this in launchpad, like the one mentioned by bcbc). Apart from this, WUBI does not work from within Windows 8 if you have UEFI with a GPT Partition (Not MS-DOS type partition). Pleas read Does UEFI support mean Wubi will now work on laptops shipped with Windows 8? for more information.
Not only that, but trying to install 32 bit Ubuntu is impossible. You need the 64 bit version for everything to work correctly. Read more about Wubi in Can I install Ubuntu inside Windows?
The following is a small guide to install Ubuntu with a Pre-Installed Windows 8 system. The steps HAVE TO BE done in the precise order I mention them here to get everything started. If a step is skipped or done before another, you will most likely end up with some of the problems mentioned at the bottom of this guide.
For the time, you need to do it via a LiveCD, LiveDVD or LiveUSB, assuming (actually requiring) you have the following points:
  • You are using a 64-bit version of at least Ubuntu 12.04.2. 32-bit versions will not work.
  • Your system came with Windows 8 pre-installed (And you do not want to delete it)
  • You are not installing Ubuntu inside of Windows 8 but rather alongside of it. Inside of it is impossible because it needs Wubi which is unsupported.
  • Your system has UEFI activated (And can not be disabled) with Secure Boot.
  • You have already created a free space for Ubuntu from within Windows 8 with at least 8 GB (I recommend to leave at least 20 GB or so, so you can test the hell out of it).
  • You made sure that you actually have free space left on the drive to create the needed partitions and you also made sure that you did not have all primary partitions used (In case of using an MS-DOS Scheme) because this will create a problem with the Ubuntu installer showing you only the "Replace Windows" option instead of the "Alongside Windows" option.
  • You know how to burn a LiveCD, LiveDVD or LiveUSB from within Windows 8. If not, look for Windows apps that can do that for you. I do mine in another PC with Ubuntu ^^.
  • Windows 8 was not shutdown in either Hibernation mode or any other mode ('fast start-up' which is by default on Windows 8) that leaves it on a saved state. Shutdown Windows 8 in the normal way, with the shutdown option. This will prevent other problems related to this from appearing. Read the bottom (TROUBLESHOOT) of this answer for more information regarding this point.
  • You are installing on an MS-DOS type disk scheme (You can only have 4 primary partitions as opposed to GPT Scheme) which has at least 1 Free Primary Partition. Remember that if you are already using 4 Primary Partitions no partitions will appear on the Ubuntu installer since there are no more Primary partitions left to use (MS-DOS type partitions are limited to 4 Primary ones, GPT are limited to 128). This happens a lot on many laptops that come with 4 pre-created primary partitions. If you are installing on a GPT type partition and want it to boot, you need to leave UEFI enabled.
PLEASE READ THE ABOVE POINTS SINCE MANY USERS JUMP THIS PART AND WHEN THEIR PROBLEMS ARE FOUND IT NORMALLY IS BECAUSE THEY DID NOT FOLLOW ONE OF THEM.
Before we start we need to do the following:
Run compmgmt.msc on Windows 8. From there on, create a partition with enough size. Note that I mention creating this FROM Windows 8 because I have had cases where doing the partition from the LiveUSB rendered Windows 8 unbootable, even after doing a boot repair. So to remove that problem or have a greater chance of removing it (Or simply skipping the problem altogether) and making sure both systems work, partition your hard drive from within Windows 8 first.
Now follow this steps to have a working Windows 8 + Ubuntu installed on your system:

Windows 8 + Ubuntu

We first need to know with what type of motherboard options we are dealing with. Open a terminal (By going to the start menu and typing powershell for example) and run the terminal as an Administrator (Right Click the app that will show in the start menu and select Run as Administrator). Now type Confirm-SecureBootUEFI. This can give you 3 results:
True - Means your system has Secure boot and is Enabled
False - Means your system has Secure boot and is Disabled
Cmdlet not supported on this platform - Means your system does not support Secure boot and most likely you do not need this guide. You can install Ubuntu by simply inserting the LiveCD or LiveUSB and doing the installation procedure without any problems.
If you have it Enabled and have the necessary partitioning done then we can proceed with this guide. After booting into Windows 8 we go to the power off options and while holding the SHIFT key, click on Restart.
enter image description here
(This is a really old trick on most Windows, even since Windows 3.1 where you hold a key to do something special when rebooting)
Windows 8 will show you a totally different restart window:
enter image description here
When you get the menu above, select Troubleshoot
You will then get the following options:
enter image description here
Select UEFI Firmware Settings
NOTE - In the Spanish version of Windows 8, the option for UEFI Firmware Settings is not available in several laptops, tested Lenovo, HP and Acer. They do have an option to boot the computer and another custom menu will appear which lets you do a couple of things. In the case of Lenovo you will not have an option to install Ubuntu with Windows 8, the only option is to remove Windows 8 completely.
THIS IS AN IMPORTANT PART
The system will reboot and you will be allowed to go to the BIOS (If not press the appropriate key, some common are DEL,F2 or F10).
In this part I can't help much since each BIOS is different for each Motherboard model. There are 2 options you can take here, both of which are optional since Ubuntu might install without any problems at all. You can either look for an option to disable Secure Boot or an option to disable UEFI. In some cases you will be able to find both, it will show in the BIOS as an option called Secure Boot or Enable UEFI.
If you find this options, then depending if you can not install Ubuntu with Secure Boot enable then disable Secure Boot (Remember to report this as a bug using ubuntu-bug shim), to be able to still stay in UEFI mode and also be able to Boot with Ubuntu. In some motherboards, this will be the only option you actually need to change and also will be the only option you see related to UEFI because they will not offer the possibility to disable UEFI.
DUAL BOOT ISSUES
I would also like to mention an important note here. If you happen to install Ubuntu in Legacy Mode (No SecureBoot) you might have problems booting both, Windows and Ubuntu at the same time since they will both not appear on a Dual-Boot Menu. If you have Windows on UEFI for example and you install Ubuntu on Legacy Mode, you will only be able to boot to Ubuntu on a Legacy Mode and Windows on an UEFI Mode.
So before proceeding, make sure that you are installing Ubuntu with the same boot options as Windows. This way you will be able to choose which one to boot from in the same boot menu and not worry if one will work or not. From the Ubuntu UEFI Guide you can see that there is a section that teaches you how to know if you actually installed Ubuntu in the same Boot setup as Windows (UEFI Mode):
An Ubuntu installed in EFI mode can be detected the following way:

    its /etc/fstab file contains an EFI partition (mount point: /boot/efi)
    it uses the grub-efi bootloader (not grub-pc)
    from the installed Ubuntu, open a terminal (Ctrl+Alt+T) then type the following command:

    [ -d /sys/firmware/efi ] && echo "Installed in EFI mode" || echo "Installed in Legacy mode" 
So if you have ANY dual boot problems, this could be the problem. Please read the Ubuntu UEFI Guide since it covers various ways on solving Dual boot problems and converting Ubuntu to Legacy or EFI mode. I have already tested this with various Ask Ubuntu members that helped me apart from 2 Laptops I was provided with for the testing. This should then solve any Dual Boot problems related to Windows 8 + Ubuntu, but I again encourage anyone with problems (same or new) to file a bug report as mentioned above. The Ubuntu Developers are working very hard in providing an easy to install solution for all cases and this is one of the top priorities.
Continuing with the guide, in other motherboards that do offer the possibility to disable UEFI which would completely eliminate UEFI and Secure Boot on it and boot in the normal BIOS like way, if you find this is the way you want (To have a UEFI free computer and not face any of the problems related to this) then by all means do it. I for one have tested the Intel DZ68DB and did both case studies. Remember that doing so will make the Dual Boot process not work in almost all cases you will be left with a system that either Boot Windows in UEFI or Boots Ubuntu in Legacy.
With that in mind, remember to also select the Boot Order to make sure that it boots either your CDROM, DVDROM or USB Drive so you can boot from your Live Ubuntu image after rebooting.
Some points we should consider before continuing:
  1. If Windows 8 was installed with UEFI enabled, it is highly recommended to stay in UEFI, although if you still want to disable it for specific reasons you can, GRUB will create the bootable part for Windows 8. But if you do disable UEFI and want to access Windows 8 afterwards (before installing Ubuntu), it will not work since the boot part for Windows 8 needs UEFI (Again the Dual Boot problem).
  2. If you only disable Secure Boot, there is no problem in some cases. You are only disabling the part that creates the most problem between Windows and Linux, which is the one that prevents Ubuntu from booting correctly. In either case, I encourage you to first try to install Ubuntu with UEFI/Secureboot, since in most cases it will work. if you disable any of them and install Ubuntu, you might not be able to boot to Windows 8 afterwards through the GRUB Boot Menu.
Now before saving, some motherboards offer a Boot Mode option. Verify that this option is not pointing to UEFI Boot but instead to CSM Boot (Compatibility Support Module) which provides support for Legacy BIOS like systems.
Other systems offer a UEFI Boot option you can enable or disable. Depending on the options I mentioned above you can set this to the one you want.
And lastly others offer a UEFI/Legacy Boot First option where you select which one you wish to use first. Obviously the option is self explanatory.
Now save the changes and reboot.
When the Ubuntu Live image starts, it will show rather different than the normal one we are all used to. Do not worry, this is because Ubuntu has an alternative boot option when a system has EFI installed. Just select everything like you are used to. I highly recommend reading the following article in the Ubuntu site regarding Ubuntu installations when using UEFI. If there is a problem, then try to create a small partition (About 250 MB of size) for the EFI part of the system. This is done in the installation part where it asks you if you want to install on a desired partition or used the Advanced Options. Select the advanced options if you come up with a problem. In there, create a 250 MB partition for EFI and the rest for GRUB and other stuff you are accustomed to.
I think up to here you should be fine and have avoided several problems typically found when trying Ubuntu with Windows 8 which are:
  • Not booting a LiveCD/LiveDVD/LiveUSB/Wubi
  • Not installing Ubuntu because of security issues (Yeah right, more correctly monopoly issues)
  • Not booting either Windows 8 or Ubuntu (not showing either one of them)
  • Not letting Ubuntu create a partition
  • Not recognizing the EFI part of the system
  • Ubuntu not recognizing Windows 8 Partition
  • Not seeing GRUB and booting directly to Windows
  • Windows 8 not booting or readable because or partition changes done from Ubuntu

TROUBLESHOOT

YOUR COMPUTER BOOTS DIRECTLY TO WINDOWS
This is a common problem and if you do not get a GRUB menu , re-installing or repairing grub will NOT HELP
Every BIOS is different, it my look like one of the following pictures:
UEFI 1
UEFI 2 Notice the "UEFI Boot Option Priority" or "Boot Option Menu" . Usually Windows is the default and Ubuntu (or as in the second picture elementary OS) will be an option.
Once you select Ubuntu on the UEFI boot menu you will then get a grub menu. You should be able to boot either Ubuntu or Windows from the grub menu.
Another issue that could make the system boot directly to Windows (without even showing the GRUB menu) is if either Windows took hold of the boot manager or after installing Ubuntu, the EFI partition was not properly configured for Windows. To solve this, simply go to Windows and open a terminal, then type the following (Need Administrative Privileges):
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
This will configure the Windows Boot Manager to take into consideration the GRUB Boot Manager. This could still happen even after running the Boot Repair from within Ubuntu. So making sure that Windows reads the Ubuntu EFI partition will solve it.
Windows 8.1 Not Recognized / Ubuntu not showing option to Install Alongside
If you have followed all the steps above including making a partition ahead of time through Windows 8.x, proceed with the normal Ubuntu installation. When you arrive at the option to how you would like to install it, if you do not see the option to install Alongside of it, select "Something Else" instead of wiping the hard drive. Configure the new partition layout on the empty space you've set aside that isn't Windows 8.
You need to create at least 1 partition for the root system (Which shows as the symbol "/") and set it to Ext4, another for SWAP (Virtual Memory). The SWAP space can be as small as 128MB if you have a lot of ram or as high as 4GB. With this 2 partitions created based on the empty space you provided you should be ready to proceed. And one last one for the EFI part which should be around 100MB.
When the installer asks where to put the bootloader, tell it to put it on the partition with the type "efi". This will install GRUB which will load once your system starts in the future which will give you the choice of going with Ubuntu (or whatever flavor is installed) or going to the Windows Boot Manager which will take you to Windows 8.
I would also recommend reading the following links to get additional information of some issues and causes in this particular part:
REPAIRING THE BOOT
After finishing the installation, if you happen to have Windows 8 disabled from booting and it only boots to Ubuntu, do not worry. In Ubuntu after it boots, open a Terminal and type the following:
sudo add-apt-repository ppa:yannubuntu/boot-repair  
sudo apt-get update
sudo apt-get install boot-repair
If you're using Trusty (14.04), the above may fail. In that case you can follow the instructions on how to install Boot-Repair in Ubuntu, namely: run sudo sed 's/trusty/saucy/g' -i /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list after you have added the PPA repository.
Now run boot-repair.
Boot Repair will mention that we have some GRUB error, that we have an EFI system and that Ubuntu rocks. Since Ubuntu rocks (It does not work if Ubuntu does not rock! ^^), just click on Apply so boot repair fixes everything. Now reboot and you should see Windows 8 and Ubuntu side by side.
For cases with rare booting problems, partitioning or using old hard drives on newer motherboard, your solution might be checking out FixParts which solves misaligned partitions and other partitioned type problems.
If you are experiencing one of the following issues:
  • Loosing Data when copying from Ubuntu to Windows 8 after shutting down Windows 8
  • Can not access your Windows partitions from Ubuntu getting a Disk contains an unclean file system
    This is most likely the cause of an option in Windows 8 called Fast Startup which behaves similar to hibernation and keeps a snapshot of the system so when you boot up, it will load faster. Since it keeps a snapshot, anything you copy or change in Windows 8 from Ubuntu after doing the fake shutdown will be lost (Apart from other issues found HERE).
    The solution in Windows 8 is to go to:
    Control Panel --> Power Options --> Choose what the power button does
    In here click on "Change settings that are currently unavailable" where you should see something like this:
    enter image description here
    Uncheck the option that says "Turn on fast startup". You also need to disable hibernation. You can to this with this command (you need to be in a console with admin rights):
    powercfg.exe -h off
    
    This should remove the hibernation file and enable partition to be mounted in Ubuntu.
A demonstration video is now available on this issue. We can install Ubuntu 12.04.2 (64 bit versions) onwards with SecureBoot enabled. But we need to disable the SecureBoot after the Boot Repair step.



GRUB RESCUE 

ls - to find the existing partitions. (hd0,gpt0) -> first partition on first disk, ls (hd0,gpt8)-> finds the files inside (hd0,gpt8)
Search inside : ls (hd0,gpt8)/boot/grub to find the efi loader for the OS

Follow these if stuck inside grub,
  1. set root=(hd0,gpt8)
  2. set prefix=(hd0,gpt8)
  3. insmod normal
  4. normal
  5. sudo update-grub (run this in terminal after booting into Ubuntu)
  6. sudo grub-install /dev/sda (run this in terminal after getting into Ubuntu)



References 

http://askubuntu.com/questions/221835/installing-ubuntu-on-a-pre-installed-windows-8-64-bit-system-uefi-supported

Creating responsive HTML5 page

HTML 5 tags are listed in HTML 5 W3 schools

A sample theme used [2] : Theme Dropbox

Creating/embedding responsive youtube videos : responsive youtube

Youtube API for embedding videos dynamically : Youtube API

Tools :
Eclipse plugin : Aptana Eclipse plugin
Cloud9 IE [2] - an online html, javascript tool is used



References:

1) http://www.2createawebsite.com/design/mobile-website-design.html
2) https://ide.c9.io/davismathew/biennale#openfile-README.md
3) https://github.com/davatron5000/FitVids.js