Wednesday, July 15, 2015

Installing NVM And Node.js To Your Home Directory

On Fedora I've found that installing node.js and npm to be less than useful for my needs; i.e., while they install and work, they want to put things into the system directories and not my home directories. And, like with Ruby on Rails, you get locked into whatever is the latest version packaged for Fedora itself, which isn't always what you'd want.

What would be nice is to have something akin to RVM for Ruby, that lets you install the specific version you want regardless of what's packages for your release.

Enter NVM, the Node Version Manager. The name is even reminiscent of RVM! :D

To install this on my Fedora system, I first downloaded the nvm release script and executed it using:

 $ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.12.1/install.sh | bash

and then sourced my .bash_profile, which was updated to include NVM.

 $ . ~/.bash_profile

I then checked to see what the latest version of node.js was to download and install

 $ nvm current
v0.12.7


so I could be sure to install the latest version, which I did:

 $ nvm install v0.12.7
######################################################################## 100.0%


Then, to use it, you type:

 $ nvm use v0.12.7

and you should now see node in your path:

  $ which node
~/.nvm/v0.12.7/bin/node


Wednesday, July 1, 2015

Converting VMWare Disk Images For Use With QEMU

At my current job we have a VM that was created by someone using VMware which hosts a scaled down version of our runtime environment. Being the new guy, and someone who's way more comfortable with Fedora Linux than Windows, I wanted to take the VM and run it on my favorite OS.

But I couldn't just copy the image over since the 60G disk was split up into 31 separate VMDK files, which cried out to be converted to a format usable by Linux.

So here's what I did:

 $ for vmdk in *.vmdk; do qemu-convert -f $vmdk -O raw $(basename -s .vmdk $vmdk).img; done
 $ cat *.img >> runtime_environment_vm.img

When it was all done I had a bootable disk. I created a new VM using that disk and was off to work in no time!