How to shut down VirtualBox / Vagrant from CLI

So you need to stop one or more running VirtualBox instances that you may have started and are hanging around. Here are a few helpful commands:

List all running machines (returns name and UUID)
VBoxManage list runningvms

Stop running VMs by "hibernating" them (recommended to avoid data loss)
VBoxManage controlvm <name|uuid> savestate

Poweroff running VMs (not recommended because we may lose data in the guest)
VBoxManage controlvm <name|uuid> poweroff

Use ACPI in an ACPI-aware guest OS (preferable to poweroff for graceful shutdown of guests)
VBoxManage controlv m <name|uuid> acpipowerbutton

New Relic Goodness

Send deployment information directly to New Relic via HTTP.

Ever wish you knew what impact a new deployment had on your web app and when?  Trying to keep track of deployments (especially in a continuous deployment environment) can be error prone and tedious.  Why not just send those details automatically to New Relic?  You can - check it out from the New Relic site:

To notify New Relic of a deployment, you can POST to

and add the API key as a header

x-api-key: 8d00e2869400597af4a114d31789088e3724f391f287a4c

To use the API Key turn on API access in your account integration settings.

This example uses the application id.  If you were to specify the optional description, revision, changelog, and user fields, the curl command would look like this:

[warn] NameVirtualHost *:443 has no VirtualHosts

There are two ways to eliminate this message if indeed you do not have a site running at SSL port 443.  The first way is to create a site on port 443 and add a symlink to it (use the a2ensite command to do this).  Fortunately there is one provided by default: 

$ cd /etc/apache2/sites-available
$ a2ensite default-ssl

The second way is to comment out (use the # symbol) the "Listen 443" and "NameVirtualHost *:443" lines of /etc/apache2/ports.conf 

# Listen 443
# NameVirtualHost *:443

Custom Logs for Apache Virtual Host

Let's say you have a few apps running on Apache under the VirtualHost configuration. If you'd like to have logging for these apps written to a particular directory and file name, you can make an entry under the VirtualHost section within the sites-available directory.

There are a variety of logger settings that can be configured as well - find them here.