Archive for the ‘How-Tos / Tips’ Category

Time Machine Backups from Airport Extreme

Hopefully Apple doesn’t make up some way to disable this in the future, but it seems that despite claims elsewhere on the web, the latest Airport Extreme can be used with a USB hard drive to perform Time Machine backups. I’ve always heard great things about the Airport devices and really wanted to do backups over it, but I already had a larger USB hard drive, so a Time Capsule seemed like a bit of a waste. This worked with an Airport Extreme 802.11n 5th generation. My Macs are both Lion and Snow Leopard.

All you have to do is first plug the hard drive directory into your Mac, partition as desired and format filesystems as an HFS (Mac OS Extended). Then, plugin the drive and enable disk sharing on the Airport. After that’s done, your Aiport should show up in Finder. Once you mount it, you can select it from the Time Machine settings (it will appear as a Time Capsule).

That’s it! Glad I found out and wasn’t deterred by what Apple says and is on their forums. The Airport has been amazing, video streaming is far smoother now unlike with the aging wireless router I was replacing. Definitely a recommended buy!

Tags: , , , , ,
Filed under How-Tos / Tips : Comments (0) : Nov 10th, 2011

Launching Ubuntu 11.04 Instances on KVM

This post is mostly for my own record as I keep having to look at my shell history every time I want to spin up a new virtual machine on my KVM server at home (so for those looking for something earth shattering, move along). For anyone looking for a how-to to get started, I followed an entry over a howtoforge. It’s pretty good, so no need to replicate.

Now, the goods.

If this is your first image, I recommend looking for the section in the page referenced titled “3 Creating An Image-Based VM” (seems no way to link to specific sections..). For me, I just copy one of the dirs from an existing one and clear out the ubuntu-kvm dir and edit vmbuilder.partition as necessary.

Then, from that dir, run:
sudo vmbuilder kvm ubuntu --suite=natty --flavour=virtual --arch=amd64 -o --libvirt=qemu:///system --ip=172.16.0.10 --templates=mytemplates --user=wyatt --name=Wyatt --pass=supersecret --addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid --addpkg=openssh-server --firstboot=/home/user/host.whatan00b.com/boot.sh --mem=1024 --hostname=host.whatan00b.com --bridge=br0 --part=vmbuilder.partition

Then, start the vm:
sudo virsh start host.whatan00b.com

It should boot shortly and you can ssh to the shiny new vm with the IP and username/password specified. Hopefully soon I can find some fancy way to integrate Puppet into the mix. :)

Tags: , ,
Filed under How-Tos / Tips : Comments (0) : Oct 23rd, 2011

Vagrant Fails To Start VM with Bad Default Machine Folder

I’m here at PuppetConf in Portland and one of the speakers got me all excited again about Vagrant. I’ve played around with Vagrant before, but he was showing off some awesome features that I didn’t realize existed which made me want to play with the tool again (more on that later!). Anyway, I updated all the versions of things Vagrant-related and tried to use it again. However, when I downloaded one of the default images from the getting started page I was greeted with an awesomely descriptive error:

[default] Importing base box 'lucid32'...
The VM import failed! Try running `VBoxManage import` on the box file
manually for more verbose error output.

Running it with VBoxManage as instructed gave a slightly-better-yet-not-so-useful error:
VBoxManage: error: Appliance file must have .ovf extension
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Appliance, interface IAppliance, callee nsISupports
Context: "Read(Bstr(pszAbsFilePath).raw(), progressRead.asOutParam())" at line 302 of file VBoxManageAppliance.cpp

A few Google searches for this error got me almost nowhere except that it was likely a VirtualBox configuration issue. Great. After digging around for far too long, I figured out that it was because when I had played with Vagrant/VirtualBox in the past I had configured VirtualBox’s default machine folder to an external drive that I didn’t have plugged in! Doh. Anyway, was a pretty easy fix but I thought I’d share if it saved someone some time. The default machine folder is set on the first screen in the VirtualBox preferences window (at least for me on my Mac).

Tags: , , ,
Filed under How-Tos / Tips : Comments (0) : Sep 23rd, 2011

Enabling Tab Complete for Python Shell on OS X

I have been struggling with an issue for a bit while trying to get tab completion working on the python shell on OS X. I’ve been working on a Django project and not being able to tab complete has been a bit obnoxious. It took a few sessions of searching around to find out what’s going on, so I thought I’d share it in one place. Turns out that the default shell settings are ready to go with tab complete (I spent a lot of time making sure configs were correct), but OS X simply doesn’t ship GNU readline. Instead, Apple just symlinked BSD libedit which is problematic because the default python readline module links to GNU readline.

Someone has already created an egg with readline statically linked just for OS X so the fix is super-easy. Just install the standalone readline module with your favorite python installer. I used:
sudo easy_install readline

Tags: , , , ,
Filed under How-Tos / Tips : Comments (0) : May 30th, 2011

SugarCRM Chef Cookbook Published

After delaying cleanup on the code for a week or two, I’ve published my cookbook for deploying SugarCRM CE using Opscode Chef. The cookbook utilizes the community cookbooks from Opscode for deploying the standard LAMP stack on a machine, grabs a copy of the latest stable build of SugarCRM CE from Github, and creates a silent installer file for super-easy installation of SugarCRM.

Some quick notes on setup:

Usage

Usage is super easy, especially with a general knowledge of Chef. I’m not going to dive into setting up Chef, they’ve got some great documentation for that.

You’ll need to pull down the php, apache2, mysql, openssl, and git community cookbooks from Opscode and upload to your organization as well.

Then, you can just download the sugarcrm cookbook and upload to your organization:
knife cookbook site vendor sugarcrm
knife cookbook upload sugarcrm

Then, add the sugarcrm recipe to whatever node or role you desire. For me, I created a role for sugarcrm:
$ knife role show sugarcrmchef_type: role
default_attributes:
description:
env_run_lists:
json_class: Chef::Role
name: sugarcrm
override_attributes:
run_list: recipe[sugarcrm]

You can either bootstrap a new VM / cloud instance or apply the role to an existing machine and do a run of chef-client.

For my example, I created a new EC2 instance based on Ubuntu (can be any OS that the Opscode community cookbooks support):
knife ec2 server create -r 'role[sugarcrm]' --image ami-7000f019 -d ubuntu10.04-apt -S mykey -x ubuntu -i ~/.ssh/mykey.pem

Then, you can navigate to your server’s FQDN/sugarcrm in your browser to complete the install. Not to worry, the cookbook configures a config_si.php (si = silent installer), so no need to know any details about your install.

Once complete, you’ll reach the login page. Default login is admin/admin (which can be overridden with override attributes in the role/node).

That’s it!

Filed under How-Tos / Tips, News : Comments (0) : Apr 30th, 2011