Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Tuesday, 8 April 2014

Migrate VMware Fusion Virtual Machines to VirtualBox

If you Google on how to migrate a VMware Fusion virtual machine (VM) to Oracle VirtualBox, you will find a lot of different methods and responses.  I selected the following due to the simplicity of it, as well as the small size of the open virtualization format (OVF) used for moving between physical machines.

On your OSX machine that has Fusion installed, and since we will be working from the command line, I link the ovftool to /usr/local/bin/ which is on my $PATH (you can link it to any other location, or skip and access with the full path).
    ln -s /Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/ovftool /usr/local/bin/
Ensure your VM is powered off before starting this.  Run the tool against the VMX file - outputting the OVF file to wherever you want.
    ovftool --acceptAllEulas ../../Virtual\ Machines.localized/Debian.vmwarevm/Debian.vmx Debian.ovf
 Then in Virtual Box do an Import Appliance from the File menu.

Once finished, don't forget to remove the VMware Tools and install the VirtualBox Guest Addons.  Oh yea, double check your VirtualBox settings for this newly converted VM as well - do not assume they converted correctly.

Finally, cross your fingers and start it up!




Thursday, 27 March 2014

Use Remote Login on OSX for File Sharing

Big shocker - I'm a heterogeneous kind of guy.

While I prefer Linux, I also have OSX boxes - and sometimes the odd Windows machine will show up on my LAN.  I want to share files across these machines.  You'd suggest SMB right (or File Sharing in Apple parlance)?

Wrong.

For a long time, File Sharing (SMB or AFP) was a hit and miss type of service on every OSX machine I used.  Most of the time it worked - and then it doesn't, and you hunt around for a cause, trying various actions to fix the issue that strangely appeared without any changes to the machine.  It was frustrating.  (and no, it wasn't just user error! lol)

Then the fix hit me one day - SFTP!

And I've never been happier.  (and the bonus, all my communications are encrypted!)

On your OSX box, head to System Preferences -> Sharing -> disable File Sharing and enable Remote Login.  Chose who to allow onto your box.


You may not know it - but your life just got easier (and less frustrating).

Connecting to that machine from various other machines will now be dependable and consistent.  You can use, from your command line, sftp, ssh, scp (and probably others).  For GUI clients, there are too many to list - from Dophin on KDE, to ForkLift on OSX.

The biggest negative to this solution is that the default Connect to Server on OSX won't (natively) support SSH, neither does Windows.  There are ways to make me into a liar though - and I encourage you to check these out.

While describing OpenSSH is out of scope for this post - configuring this tool correctly will allow for a secure and simpler authentication experience.

Tuesday, 11 March 2014

Speed Up Mission Control Animations

While I love virtual desktops, in general, I found Mission Control in OSX Mavericks to be frustrating.  You may think that the lack of cube animation or the fact that only horizontal desktops are supported, to be my largest complaint, but you would be wrong.  Its the animation, the lag when you mouseover the virtual desktops or to add a new desktop.  I found a little fix that will speed this up on OSX, making virtual desktops again usable.



Saturday, 8 March 2014

Testing if an Application Exists in Bash

Some of my Bash scripts need to be used on various systems I use.  It is very common to call other command line tools that do some job or another, from these scripts.  Sometimes I am forgetful (big surprise!) and forget to install these required applications.

So I use a simple function to check that these other applications exist, returning true or false.



Now you use the function, placing your call below the code above.  This example exits the script if the application is not found.


Tuesday, 11 February 2014

My Favourite Git Alias

I use this git alias every day, a number a times a day.  Unfortunately I don't know where I originally found it, as I did not create it, I did update it a little to my needs.

In your projects .gitconfig or your home folders ~/.gitconfig add this (just add the lg line to the [alias] section to an existing file) :


I don't have a project, that includes a lot of branching, that I am able to show you - I do have a flat project of my own that gives you an idea of what the output looks like.


If you have some great git command line tricks, please toss them my way - I live in a version control world!

Doesn't that look better than git log:

Friday, 7 February 2014

Updated Your Bash Shell in OSX

Are you a Bash shell user on OSX? (by default you are!)  Well, did you realize that Bash is at version 3.2.51 on Mavericks, 10.9.1?   I hit a wall when I realized some of my dotfiles were not going to run as expected with this older version.

No worries - since I use the fantastic Homebrew package manager for OSX, installing Bash 4.2.45 was a simple:
    brew install bash
Thats not the end of the story though.  Now you have to change your login shell on OSX.

First step after installing is to edit /etc/shells, and add /usr/local/bin/bash to the top of the list:
    sudo vi /etc/shells
Being a nerd, you know you can just to change your shell:
    chsh -s /usr/local/bin/bash
Or you can go to System Preferences, then Ctrl-Click on your Users & Groups user profile (ensuring screen is unlocked):


And finally, after selecting Advanced Options, just change the shell to /usr/local/bin/bash:


If you want to be sure it worked, just do this in a new terminal:

    echo $SHELL



Wednesday, 5 February 2014

OS Detection in Your Vim Configuration

If you use your vim configuration across multiple machines, and even multiple operating systems (OS), then you may need to have separate configuration based on that OS.

Using has(), do something like this in your ~/.gvimrc:



In fact, there is a lot more you can set up conditionals for.  To discover all the options use the following in vim:

    :help feature-list