Ubuntu apt-get Hangs At 0%

Ubuntu apt-get Hangs At 0%

apt-get-stuck-0-percent

I had an issue where I installed Ubuntu 14.04 in VirtualBox and apt-get kept hanging at 0%.

I noticed it was automatically attempting to use IPv6 because normally apt-get says connecting to us.archive.ubuntu.com the IPv4 address (eg 0% connecting to us.archive.ubuntu.com 111.111.111.111). This time the address looked like version 6.

To force apt-get to use IPv4 exclusively

  1. Create a file in /etc/apt/apt.conf.d/99force-ipv4
  2. Add this line to newly created file Acquire::ForceIPv4 true;
  3. Apt-get will now use IPv4 exclusively

 

This article on StackExchange helped me find the right answer!
Convince apt-get *not* to use IPv6

Ubuntu 14.04 Hangs After Login With Virtualbox VDI

I fell into the trap while installing Ubuntu in virtual box to only give Ubuntu 8gb for the hard drive because it was recommended. I quickly realized that this wasn’t big enough. While searching on the internet I found the commands for virtualbox to increase the VDI size. I ran the command and started Ubuntu. Everything appeared normal until after logging in. Ubuntu just sat and didn’t do anything. After realized that the resize likely caused this issue I searched online and found a great article  Growing a hard drive partition in a VirtualBox ubuntu guest. The article mentions resizing Ubuntu’s partition after resizing the VDI. I resized the partition and everything is working as expected!

Steps to resize VDI

  1. Run VBoxManage modifyhd <absolute path to file> –resize <size in MB>
  2. Boot the VM to either gparted cd or Ubuntu live CD
  3. Resize Ubuntu’s main partition (You might need to delete the swap partition and readd to move main parititon)
  4. Restart
  5. Enjoy 🙂

Laravel 4 Project On Shared Hosting

Laravel 4 is capable of running on a shared hosting environment. It’s a lot easier than you probably think.

  1. Login to your host and go to your home directory. This does not mean your public home directory, they are separate.
  2. Upload all the contents Laravel project EXCEPT the public folder to your home directory.
  3. Upload the contents of your Laravel public directory to your public directory on your host. The public directory is sometimes called public_html.
  4. Edit file paths.php located in the bootstrap folder so the public path matches the path to your public directory on your host.

After completing each of those steps you should now have a working Laravel 4 project on a shared hosting environment. This assumes the shared host has all the PHPmodules required to run Laravel as well. I was able to accomplish this on HostGator.

If you have any questions feel free to ask.

BSOD Windows 8.1 CRITICAL_STRUCTURE_CORRUPTION

Blue Screen Of Death (BSOD) an inevitable part of using a windows machine.

Today I received a BSOD with an error CRITICAL_STRUCTURE_CORRUPTION while working on my Android homework. The error wasn’t very descriptive and I wasn’t hopeful to find a resolution. I thought maybe this was random, but searched and fortunately Google lead me to  StackOverflow.

In the post it outlines the cause is possibly due to Intel Hardware Accelerated Execution Manager  (HAXM) software which is used to speed up Android emulators. The post also mentions to download the new updated Intel HAXM software through Intel and not necessarily Android SDK Manager. I had just updated through the Android SDK Manager prior to the blue screen with version 1.0.6. I thought the most recent version was just installed, but I was wrong. Intel’s site has 1.0.8 which apparently fixes the BSOD issue.

Here’s the link to Intel’s site for the most up to date version.
https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

PHP Pages Displaying Code And Not Rendering Code

For some reason my server started displaying code instead of actually processing or rendering the code.

After playing around with the server I noticed the php5 module was missing from Apache.

If your code is displaying and not rendering you may have the same issue.

To install and enable it run the following command.

sudo apt-get install libapache2-mod-php5
sudo a2enmod php5

Then restart your apache. The restart command is different depending on the distro you’re using.
A simple Google search will help you.

 

This is the forum post that helped me fix my issue.

http://ubuntuforums.org/showthread.php?t=1546116&p=9681081#post9681081

Git Force Push Branch

I had a problem where I want to push my branch and overwrite what was the on the server.

I kept receiving an error telling me to merge. I did not want to merge and found a way to force push a branch.

In general you don’t want to do this unless you absolutely have to.

git push -f origin <branch>

This Stackoverflow question and answers helped me.

http://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge

Mod Rewrite Enabled But Not Working

If you find that your mod rewrite is enabled, but doesn’t seem to be working you may need to add this little bit of code to your httpd.conf file.

AllowOverride All

It’s possible your file might have the following:

AllowOverride None

If your AllowOverride was set to none then your .htaccess files in your project directory are not able to set their own settings including url rewriting.

Make sure to restart Apache after applying this change to your httpd.conf file.

 

The following link helped me solve my problem.

http://stackoverflow.com/questions/17772962/laravel-4-simple-route-not-working-using-mod-rewrite-and-htaccess