fusiongrokker

Expanding a VirtualBox hard drive

We've all been there. You create a virtual machine thinking it'll be a small utility, so you only give it a 20gb virtual hard drive. But its use unexpectedly grows. All of a sudden that 20gb limit is a problem. You could recreate the machine from scratch, but that would take a long time. Here's how you can do it, if you're using VirtualBox, extremely simply.

First, shut the guest OS down completely. You might be able to do this when paused/suspended, but personally I wouldn't risk it.

Second, in a terminal, type the following command:

VBoxManage modifyhd <path/to/vdi/or/vmdk> --resize <new-size-in-mb>

So when I wanted to resize a 20gb drive to 35gb, I ran:

VBoxManage modifyhd /users/adam/vm/my_vm/my_vm.vdi --resize 35840

This only takes a second or two.

Full documentation for the VBoxManage utility is here. I believe you also need to have chosen to install the command line tools during your VirtualBox install. (Why wouldn't you?)

This increases the "physical" size of the (virtual) drive, but does not touch the partitions it creates. At the moment I only have Windows VM's, so here's how you finish up from inside a Windows guest. I'm using Windows 7.

Boot your VM back up. Right click on "Computer" on the desktop and choose "Manage". Select "Disk Manaement" in the "Storage" section. Note that the drive now has unallocated space:

Expanding a windows drive partition to use unallocated space (1)

Right click on that partition that you want to expand, and select "Extend Volume...":

Expanding a windows drive partition to use unallocated space (2)

Then just accept all of the defaults that the wizard provides, and it will fill up the unallocated space of the partition.

There you have it. Done. Quick and easy.

Posted in Misc | 2 Responses November 28 2011

Be the change...

After a long time of complaining about it, I've finally decided to start doing something about the CFScript compatibility (or lack thereof) in ColdFusion 9 and later.

As of CF9, some of the new script functionality is implemented as CFCs, and the code is not at all obfuscated. We can see and modify the source. You can find them in {cf-root}/CustomTags/com/adobe/coldfusion/. It's debatable whether or not writing CFScript language this way is a Good Idea™, but for better or worse, it's there.

And you know we can add our own CFCs to that folder, right? And when you do, you don't even have to restart the service, your new code just starts working immediately.

So, in order to be the change I've started two things:

I've already pushed my attempt (most of them fully tested and working to my satisfaction) at: CFContent, CFFlush, CFHTMLHead, CFRegistry, and CFSchedule. And there's still lots of low-hanging fruit!

I'm happy to let anyone into the organization who would like to contribute. How do you get added to the organization? Simple: send 1 pull request that improves the code or documentation of the project in some meaningful way.

I know, I know... some of you are saying, "But I've never done a pull request before!" or worse, "I've never done anything with git before!" Well? Now's your chance. Really, honestly, truly: It's not that hard.

If you are motivated enough about this goal, to improve the CFScript language, then I hope you'll take this as an opportunity to learn something new (git + pull requests) in order to participate. Plus, it shows a certain level of commitment and motivation. Those are the types of people we want making changes! After your first pull request is merged, you'll be added to the organization, and then you can just commit directly to the repository.

The readme lists all* of the tags that are currently missing from cfscript, broken up into some sort of priority classification. Feel free to disagree on the classifications -- they are just the opinions of a couple of people who have contributed so far. In fact, changing them up a bit could be your pull request. :)

Of course, I'm not the first to have this idea. Ray has already released his components for cfsearch and cfindex. I'm just trying to organize our efforts and make sure that we do things in a way that will allow Adobe to integrate our work into future versions of ColdFusion.

What do you say? Will you be the change?

* Where appropriate. Not all tags need to be script. Think CFPod. CFDiv. CFForm.

Posted in ColdFusion | Community | 2 Responses November 15 2011

My experience moving from 1Password to LastPass

I love 1Password. A lot. So this is a bittersweet post.

I love 1Password so much, in fact, that after several months -- maybe a year -- of using it for my personal password management, I recommended it as a way for my team to share passwords. We have ~30 applications we maintain, and each has sql passwords, api keys, etc, for each environment (dev, stage, prod)... plus a gamut of other passwords that need to be shared, so something was necessary. The series of text files we inherited wasn't scaling well.

It worked out great... For a while.

I keep my personal 1Password keychain file in my dropbox, for various reasons:

When we started sharing a 1Password keychain for our team, it only made sense to also put that file in dropbox too. We have a folder that we share with everyone on the team, and we just put it in there.

For a while, this worked quite well. The only problem was that switching between keychain files could be annoying. Luckily, I figured out a workaround that made this pretty painless: Just drag shortcuts to both keychain files onto the OSX Dock (YMMV on other operating systems), and click them to tell 1Password which one you want to use. The browser extensions will always associate with the last file you had open in the application.

That was then. The good ole days. These days, if you use this approach, you may find your credit card numbers (and other private information) in the wrong keychain! Unless you want your coworkers ordering prank books for you, this is probably bad.

So, after much agony and strife, I reluctantly decided to switch my personal password repository to LastPass. I figured switching myself would be less hassle for the rest of the team, who are likely not using 1Password for their personal data.

I was thrilled to find that you can export your 1Password data and import it into LastPass. In fact, that made my day! I was not excited at the prospect of having to manually copy over the details of several hundred accounts. So thank you, LastPass team, for that feature.

So that's the story of how I got here. But what do I think of LastPass so far?

It's only been a day. We'll see how I feel about it in a week/month/year. Maybe I'll follow up further down the road.

Posted in Meta | 9 Responses November 03 2011

Why Tabs Are Superior To Spaces

Once and for all, I have the answer! I've long known and exercised my belief that tabs are (far, far) superior to spaces, but only recently have I gained enlightenment as to exactly why they are superior.

Spaces are "hard coded", while Tabs are "dynamic".

What does that mean, exactly? Every IDE worth a damn allows you to adjust the number of spaces that a tab appears to take up. This is commonly referred to as "tab size" or "tab width". If your team agrees (begrudgingly?) to use spaces, then everyone has the exact same view of the code.

The problem is that people's preferences are different. I might like to use 3 space indents so that things don't start flying off the right side of the screen after just a few levels of nesting, whereas you might like 5+ spaces, to really draw attention to where things nest. There's nothing wrong with either preference. And the beautiful thing is, using Tabs and letting everyone set their own tab width (because one person's tab width has no affect on anyone else's view), everyone gets to see what they want to see.

So there you have it. Tabs win. You're welcome.

Posted in Best Practices | Meta | 5 Responses November 01 2011