Thursday, November 07, 2013

Managing Hosts File on OS X with Gas Mask

If you use Homebrew as your package manage on OS X then you really should consider adding Homebrew-cask.  A simple howto is available here.

One of the great things about Homebrew-cask is that you can look at all of the applications in the directory and see all the different applications that are out there that you may not have known about.

I came across a simple hosts file manager called Gas Mask.  If you're someone like me who works multiple projects and has to maintain a number hostnames so that they resolve to IP Address, then you may find this tool fairly useful.

It's fairly simple and there's already some good write-ups out there so I won't clog up the internet tubes with unnecessary redundancy.   If you have Homebrew and HomeBrew-Cask installed, it's super simple to get started.  Just run:

       brew cask install gas-mask

Then follow the instructions here to get started.

Wednesday, November 06, 2013

VirtualBox, Mavericks - Hanging on Shutdown

I upgraded VirtualBox to 4.3.0 to work as it apparently addresses the network issues that I was having with running earlier versions on OS X Mavericks.

However, a new nuisance popped up - one that forces me to do a hard shutdown when closing shutting down.  Thankfully, the interwebs are experiencing the same issue and people much smarter than me were able to figure it out.

In short, my problem was that I had some old libraries in /Library/Extensions/ so I removed the VBox*.kext libraries.  I also did a reinstall of VirtualBox just for good measure and so far so good.  Now I can shutdown my laptop cleanly and run networked VMs.    Yay!!!

Friday, November 01, 2013

The Case of the Disappearing HOSTS file

For a few months now, I've been having an odd issue on OS X where my /etc/hosts file keeps getting reset to some default.  It was a nuisance and I basically resorted to some scripts to update my hosts file and restore the correct settings.

Finally, spent some time investigating this and the mystery is now solved


Turns out that if you have installed the Cisco AnyConnect VPN, it creates an /etc/hosts.ac file and, on reboot, restores that file as the /etc/hosts file.

Simple fix is to modify the /etc/hosts.ac file instead.  So basically, I've traded one kludge fix for another one.


Thursday, September 12, 2013

Accessing KVM instances via Virt-Manager on OS X



Getting X11 to run on OS X via xQuartz is a fairly painless process.  You just have to download it from here and install it.

There is no virt-manager native equivalent for OS X so the best way is to run X over SSH and remotely access virt-manager.  However there are a couple of gotchas that I experienced as the remote linux server I was accessing needed a few more packages to make this work.


Enable Remote Access to Virt-Manager via an OS X Machine

Install xauth

When connecting to a remote server via ssh with the -X option, the following error is displayed:

    X11 forwarding request failed on channel 0

To resolve this install xauth:

    [root@host ~]# yum -y install xorg-x11-xauth

Install Fonts

Virt-Manager is a X application which is capable to manage RHEL's XEN, QEMU/KVM, LXC service. Similar to other X application, it could be launched remotely via X11 Forwarding.

However, it happens that garbage fonts will be shown if the host is not installed with appropriate font package. To fix this, package dejavu-lgc-sans-fonts have to be installed.

    [root@host ~]# yum -y install dejavu-lgc-sans-fonts

Saturday, September 07, 2013

VirtualBox and OS X Mavericks

If you're like me and  one of those that like to live on the bleeding edge, you've probably installed Mavericks already.

While I haven't played with too many of the new features, I did stumble across an issue with VirtualBox that is a bit of a nuisance.   The gist of it is in this ticket, but in general Mavericks fully stops using the legacy StartupItems piece of OS X.

StartupItems no longer exist in Mac OS 10.9 Mavericks. StartupItems was deprecated 8 years ago. Host-only adapters (and possibly other functionality) cannot be used in Mac OS 10.9.
Temporary work around: sudo /Library/StartupItems/VirtualBox/VirtualBox start (Must be run after each restart)
 This is important for VirtualBox as, among other things, this is how it starts its networking services that provides the ability for host-only adapters.  A bit of a nuisance and hopefully the issue gets resolved soon.


Monday, July 22, 2013

ownCloud Openshift Quickstart Updates

Thanks to @iandexter for the pull request to add cron job functionality to the ownCloud quickstart for OpenShift.  This change will leverage the cron cartridge for OpenShift to call the ownCloud cron job at the quarter hours.  In addition to adding in cron functionality, it's a good example of how to execute a particular task for a given minute interval.

The latest update is in the master branch here: owncloud-openshift-quickstart

Friday, July 19, 2013

Installing Ansible on OS X via Homebrew

I use Homebrew to manage the package installation on OS X.  I've recently started looking more into ansible  but its not available via the standard brew repositories.

Ansible is available for install via MacPorts, but since its generally a bad idea to install both HomeBrew and MacPorts on the same machine, that wouldn't work for me.

Thankfully, I'm not alone in this and thanks to some Google queries targeted toward github, I found a brew recipe out there.

So to install ansible on OS X, here's the quickest way to get started:

- Install Homebrew
- Install python 2.7 (Currently 2.7.5 in Homebrew)

    brew install python  

- Install ansible

    brew install https://raw.github.com/mnot/homebrew-stuff/master/ansible.rb


And voila!  Thanks to  @mnot , I am able to get up and running on ansible

Tuesday, May 28, 2013

Fedora 19 Beta - Braving the Unknown

The latest beta for Fedora is out - 19.  Since I have a fairly clean install of Fedora 18 from a Memorial Day weekend laptop rebuild, I figured I'd be bold and just start off with the latest beta.  So here goes:

     yum install fedup
     fedup --network 19 --instrepo http://alt.fedoraproject.org/pub/fedora/linux/development/19/x86_64/os/

Let's see how far we get...

Monday, March 25, 2013

ownCloud OpenShift Quickstart Update

Back in September, I wrote up how to get ownCloud running on the OpenShift Online.  Since then there have been several versions of ownCloud released and I went through and updated the ownCloud quickstart to use the latest bits.

As part of this update and in preparation for my talk at Red Hat Summit 2013 I also have been working with OpenShift Enterprise to develop an on-premise, private cloud solution that is a DropBox clone.  I'll have details on how to set this up in another blog entry either here or at my Company's Blog - An Open View.

For this version, I'm working with the HA-Proxy configurations to build a complete solution that has auto-scaling inherently built-in and has a strong security foundation.

Stay tune for details.

Friday, March 01, 2013

Mongo and Hibernate OGM

The next article in our series looking at different Java frameworks is out and it covers Hibernate OGM.  My colleague, Ken, took a look at OGM and came up with an expanded sample application that is more in the JEE mold - complete with JPA, REST, and other JEE goodness. You can check out our mongo-odm sample project over at Vizuri's GitHub repository.

Hibernate OGM provides Java Persistence (JPA) support for NoSQL solutions. It reuses Hibernate Core's engine but persists entities into a NoSQL data store like MongoDB or Infinispan.

In addition to OGM, Hibernate Search and Lucene are important components.  Check out the article  here and check out the project from the  Vizuri GitHub repository.  This is a JEE stack application and includes some Arquillian tests to get you started fairly quickly.

As always, comments are highly encouraged.


Friday, February 08, 2013

Morphia and MongoDB

The next article in the series on Mongo and Object Document Mappers is out.  For this article, we created a sample project over at our GitHub repository.

You can check out the article over here - Java and Mongo Object-Document Mappers - Morphia

I'm sure that over time, we can simplify the domain model and leverage the Query objects within Morphia for more generic classes.  But for now here's a good start.  As always, comments are highly encouraged.

Next up is Spring Data.

Friday, January 25, 2013

MongoDB and Java Persistence

I've been taking a look at how to approach persistence with Java and MongoDB.  Leveraging the Data Mapper and other JPA-related patterns seems like a good practice to continue with Mongo - especially given its non-relational status.

My colleagues and I are currently doing a bake-off of the different frameworks and are publishing our results over on our company's blog.  

In the interest of not incurring any DRY violations, I'll simple link to the articles from here.  However, I'm interested in hearing what everyone thinks and whether or not there is even a need for Data Mappers with Mongo.


Thursday, January 17, 2013

Reverse Engineering Java to UML Class Model

Found a great little tool for generating UML Class diagrams from existing Java classes. It's a plugin in Eclipse that outputs the image to Omnigraffle. The good news is that Mac OS X users can create diagrams in their favorite tool.

Its available in the Eclipse Market place as 'javatoomnigraffle' or you can check out the page here.

Granted you have to pay some bucks for Omnigraffle, but its worth it and now with the Eclipse integration, it will make for some good pictures for upcoming blog posts.

Monday, January 07, 2013

Configuring PHP Values for OpenShift

This is probably basic stuff for you PHP experts out there, but recently I was doing some work to upgrade my ownCloud instance that's sitting in OpenShift.

There were some significant changes in the upgrade which required completely replacing the php directory - at least according to the upgrade instructions on ownCloud's site.

This was a fairly smooth process as I made sure I had checked out my latest deployed instance on OpenShift. Then, I removed everything in the PHP directory but the config and copied in the latest ownCloud version, committed the changes and watched the OpenShift magic automatically deploy the new CodeBase.

Well almost. I ran into an issue where the session.save_path php variable was not set to a writeable directory. Simple enough fix, just modify the php.ini to do this - except on OpenShift. The next place to set this then is to configure it in a .htaccess file. So in the .htaccess file I added -- 'php_value session.save_path /tmp' and then did an rhc app restart owncloud -l. Viola, I'm off and running again.

To fix it correctly, I need to modify the .htaccess to use one of the environment variables for openshift - most likely OPENSHIFT_TMP_DIR, but for now this works and I can tinker with the latest bits of ownCloud.

So in the future, if you need to modify a PHP variable, make sure to use the .htaccess file for this.

Now my next thing is to make sure that I modify the ownCloud openshift quickstart to use the latest code.