Translate

Archive for the 'Geeklife' Category

How to resize a VirtualBox fixed size virtual drive (.vdi) on Mac

Monday, August 29th, 2011

So you created a disk for your Windows or Linux VirtualBox VM and you made the mistake of not creating the drive as a dynamically expanding storage drive, you chose fixed size.

Now you’re running out of space and all your Google searches point you to stupid posts on the virtualbox.org forums that lead to nowhere, specially if you are a MacOSX user, look no further, you’ve found the solution to your problem on this post.

VirtualBox for Mac comes with a tool called VBoxManage, this tool is all you need to resize your virtual disk.

When you’re using the VBoxManage tool make sure your VM is not running, stop it completely to be safe.

Step 0. Backup your current drive (optional)

I recommend that before you do anything you clone your existing drive, just in case…

You can clone your drive using guess what? yes, the VBoxManage tool. No need to download any external tools.

$ VboxManage clonehd <path to your original drive> <path of the copy>

in my computer it looked exactly like this:

$ VBoxManage clonehd /Users/gubatron/VirtualBox\ VMs/windows7-64bit/windows7-64bit.vdi /Users/gubatron/windows7-64bit.cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

If you don’t know where your .vdi file is, it’s very simple, right Click your VM > Settings > Storage, and mouse over the .vdi to see it’s physical location on your Mac hardrive.


Mouse over your virtual drive if you don’t know its location

Step 1. Resize!

The command to resize is:

$ VBoxManage modifyhd <path to your vdi> --resize <new size in megabytes>

In my case I had a 20GB drive that I wanted to double in size (40GB), a quick Google search for “40GB to megabytes” yields the number 40960, so that’s what I put on my –resize parameter.

This is how it looked for me:

$ VBoxManage modifyhd /Users/gubatron/VirtualBox\ VMs/windows7-64bit/windows7-64bit.vdi --resize 40960
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

The ‘resizing’ is almost immediate.

Step 2. (Re)Start VirtualBox

After you’ve physically resized your drive, both VirtualBox and your OS should know about the changes.

At this point, clicking on your VM in the VirtualBox window will show that it still has the old size:

Before: (Note the size of the drive at the bottom of the image)

After doing the resize, shutdown completely your VirtualBox, and launch it again. When you see the information about the storage drives attached to your VM you should see the new disk size.

After: (Note the size of the drive at the bottom of the image)

Step 3. Let your OS know the new logical size of the drive


Your OS is still not aware of the changes, you need to let it know about them

When you start your VM, it won’t know right away what the new size of the disk is, you’ll have let the operating system know that there is additional space it can use.

If your VM is running Windows 7, the way to let the operating system know that it can use the additional space on your drive is very straight forward.

Click on the Windows (Start) Icon on the Bar > Right Click on “Computer” > Manage (You’ll need to be an Administrator)

The “Computer Management” window will open, in it go to:

Storage > Disk Management > Right Click on the partition you want to extend.

Select the option that says “Extend”, a Wizard will open, just hit Next until it ends if you want to use the whole space.

After you’re done, if you refresh your “Computer” on the File explorer the resized drive should show right away

That’s it, enjoy and let me know how it went.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Mc Donalds introduces “EASY ORDER” in-store ATMs, and they rock

Saturday, August 13th, 2011

Saw these on a McDonalds near Paris.

Haven’t seen it anywhere in the US, if you have, please share a link of a picture and let me know how was your experience.

They did a great job with UX on it, it was quite easy to put together an order for three people, very flexible and easy to use.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

DON’T UPGRADE YOUR VERIZON 4G THUNDERBOLD FIRMWARE, JUST ROOT IT

Saturday, August 13th, 2011

So I had to work outside today, and as usual I wanted to use my Verizon 4G Android (Thunderbolt) to connect my laptop using the Wi-Fi hotspot feature, as I’ve been doing since I got the phone, it’s been a real life saver many times.

This morning I saw that there was a firmware update, and I gladly accepted it, after that upgrade, now dear Verizon has decided to charge 4G users with $30 A MONTH to use the Hotspot feature that was free on my phone.

Really Verizon…?

So well, the outcome is that, NO, I’m never gonna pay you $30 a month to use my own Wi-Fi card to share my internet connection, but instead I’ve gone and signed up for Clear’s 4G hotspot, which allows me to connect up to 8 computers.

Verizon, I was happy with you until now, you suck balls, Android users are not stupid, this is pure evil. I guess my $250 a month on my line and my family’s lines are not enough for you.

So, if Clear ends up working well for me, what I think I’ll do at the end of the contract will be radical and I hope more and more people will do the same, I’m gonna get rid of my phone line, bye bye stupid 10 digit numbers, bye bye dynamic monthly bills, bye bye Verizon. I’ll just have it connected to my Wi-Fi hotspot, I’ll have faster internet access, and if I need to make a phone call, I’ll use either GTalk or Skype, fuck it. I don’t answer the phone anyway, I’ll send everyone straight to Google Voice.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Geek T-Shirt Collection #29 – Creative Commons

Sunday, June 12th, 2011

Gubatron wearing another Creative Commons T-Shirt

See the Previous T-Shirt

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Your profile can not be used because it is from a newer version of Google Chrome

Sunday, May 22nd, 2011


Getting this error every time you start Chrome?

Fix for MacOSX

Remove the “Web Data” file inside your Home’s Library/Application Support/Google/Chrome/Default folder
“~/Library/Application Support/Google/Chrome/Default/Web Data”
Then restart Chrome and the error message should be gone.

Fix for Windows

Remove the “Web Data” file inside the following folder
%APPDATA%\Local\Google\Chrome\User Data\Default
Then restart Chrome and the error message should be gone.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Geek T-Shirt Collection #28 – Google IO 2011

Tuesday, May 17th, 2011

Front

Back (Message encoded in Morse Code)

See the Previous T-Shirt
See the Next T-Shirt

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

What if Life is…?

Friday, April 15th, 2011

What If Life is a collective avatar of almost an infinite number of individuals whose infinitely contradictive number of commands/decisions towards that avatar result in what we think is “free will”. These “video game” players sharing the avatar seem to like creating mathematical laws while playing this game, we’re talking about the ones responsible for the laws of physics to keep the universe going for ever.

Now imagine each one of those guys is a shared avatar too.
Putting the infinite into something small feels good in the brain.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

eclipse.ini gone after Helios update? No worries

Saturday, March 5th, 2011

So you had a pimped out eclipse.ini file and for some odd reason in the world, eclipse.ini is missing in action after one of the numerous updates, you try to put it where it was, but none of the options you pass it seem to have an effect.

Here’s what I did

After I gave up on reading the documentation on what the hell happened to eclipse.ini and why it’s not having any effect on my eclipse, I just created my own eclipse launcher.

Here’s what it has inside:

#!/bin/bash
./eclipse -vmargs -XX:MaxPermSize=512M-Xms512m -Xmx1024m -XX:+UseParallelGC -XX:PermSize=256M
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Playing with basics of HTML5 Canvas

Saturday, December 18th, 2010

Here’s a snippet of something I did tonight to play a bit with the Canvas and 2d Graphics context objects in javascript.

<html>
  <head>
    <title>Playing with Canvas</title>
  </head>

  <body style="padding:0 0; margin: 0 0; background:black">

    <canvas id="myCanvas" width="1024" height="1024" ></canvas>

    <script type="text/javascript">

    //convert to CSS friendly Hex String
    function d2h (n) {
      var result = n.toString(16);
      if (n < 16) {
	result = '0'+result;
      }
      return result;
    }

    var preparingBackground = true;
    var canvas = document.getElementById("myCanvas");
    var ctx = canvas.getContext("2d");

    var canvasWidth = parseInt(canvas.getAttribute("width"));
    var canvasHeight = parseInt(canvas.getAttribute("height"));

    var r=255; var red;
    var g=255; var green;
    var b=255; var blue;

    var rectHeight = canvasHeight/256;
    var rectWidth = canvasWidth/256;

    var rectX = 0;
    var rectY = 0;

    var Rect = function(xval,yval,speedXval,speedYval,r,g,b) {
      this.x = xval;
      this.y = yval;

      this.speedX = speedXval;
      this.speedY = speedYval;

      this.r = r;
      this.g = g;
      this.b = b;

      //so colors dont jump from 255 to 0.
      this.rDelta = 1;
      this.gDelta = 1;
      this.bDelta = 1;

      this.width = 1;
      this.height = 1;

      //so rectangle colors wont change so fast.
      this.colorChangeDefaultValue=1;
      this.colorChangeAcumulator=1;

      this.move = function () {
	this.x = this.x+this.speedX;
        this.y = this.y+this.speedY;

	//if you reach a borders change direction.
        if ((this.x+this.width >= canvasWidth && this.speedX > 0) ||
	    (this.x <= 0 && this.speedX < 0)) {
	  this.speedX = this.speedX*-1;
	}

        if ((this.y+this.height >= canvasHeight && this.speedY > 0) ||
	    (this.y <= 0 && this.speedY < 0)) {
	  this.speedY = this.speedY*-1;
	}
      }

      //draw and change colors
      this.draw = function () {
	//play with color gradients when you have a chance...
	if (this.colorChangeAcumulator--==0) {
	  if ((this.r >= 255 && this.rDelta > 0) ||
              (this.r <= 0 && this.rDelta < 0)) {
	    this.rDelta=this.rDelta*-1;
	  }

	  if ((this.g >= 255 && this.gDelta > 0) ||
              (this.g <= 0 && this.gDelta < 0)) {
	    this.gDelta=this.gDelta*-1;
	  }

	  if ((this.b >= 255 && this.bDelta > 0) ||
              (this.b <= 0 && this.bDelta < 0)) {
	    this.bDelta=this.bDelta*-1;
	  }

	  this.r=(this.r+this.rDelta) % 256;
	  this.g=(this.g+this.gDelta) % 256;
	  this.b=(this.b+this.bDelta) % 256; 

	  this.colorChangeAcumulator=this.colorChangeDefaultValue;
	  this.width++;
	  this.height++;
	}

	//paint the reactangle
	ctx.fillStyle="#"+d2h(this.r)+d2h(this.g)+d2h(this.b);
	ctx.fillRect(this.x,this.y,this.width,this.height);
      }
    }

    //animation interval ids
    var prepareBackgroundIntervalId = 0;
    var rectsIntervalId = 0;

    var speedX = 7;
    var speedY = 7;

    var theRects = [new Rect(0,0,speedX,speedY,10,44,100),
		    new Rect(canvasWidth,canvasHeight,-speedX,-speedY,125,0,0),
		    new Rect(canvasWidth,0,-speedX,speedY,0,210,80),
		    new Rect(0,canvasHeight,speedX,-speedY,40,40,0),
		    new Rect(canvasWidth/2,0,0,speedY,-4,40,40),
		    new Rect(canvasWidth/2,canvasHeight,4,-speedY,0,100,250),
		    new Rect(0,canvasHeight/2,speedX,0,210,100,100),
		    new Rect(canvasWidth,512,-speedX,0,100,10,0)];

    function prepareBackground() {

      if (preparingBackground) {
	r=r-1;
	g=g-1;
	b=b-1;

	red = d2h(r);
	green = d2h(g);
	blue = d2h(b);

	ctx.fillStyle = "#"+red+green+blue;
	ctx.fillRect(rectX,rectY,canvas.getAttribute("width"),rectHeight);

	rectY = rectY + rectHeight;

	preparingBackground = !(r==0 && g==0 && b==0);
      } else {
	clearInterval(prepareBackgroundIntervalId);
	rectsIntervalId = setInterval("moveRects()",33);
      }
    }

    function moveRects() {
      for (i in theRects) {
	var rect = theRects[i];
	rect.draw();
	rect.move();
      }
    }

    prepareBackgroundIntervalId = setInterval("prepareBackground()",1);

    </script>
  </body>

</html>
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

To Download or to Rip used CDs?

Sunday, October 3rd, 2010

What you see above is a picture of the last 30 USED CDs I bought on Amazon.com.

These 30 CDs total a number of 454 tracks.

CD prices ranged between $1.61 to $9.18

The total of these purchases, including shipping was $291.78

This makes the average cost per track only $0.64.

ITunes charges $1.29 per track, that’s a 48% saving per track, and I keep the CDs and the booklets, if anything happens to my hard drive, I just rip the CDs again to put my music on as many devices as I can.

So I ask you… Should online music stores get their prices down to $0.50 per track? or you think $1.29 is the price of getting your song whenever you want, wherever you want?

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)


  • Categories

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004