wesley tanaka

Tech

Version in which .vagrant changed from a file to a directory

()

Vagrant converted the .vagrant file into a directory in version 1.1.  There's code in Vagrant that will automatically convert your .vagrant file into a .vagrant directory: https://github.com/mitchellh/vagrant/commit/4e649cc98792c192c1589a0bd86e8433e90f60cd

Making directory trees equivalent to mkdir -p in puppet

()

When you create a directory in Puppet using the file type, you may get this error if you haven't already created all parents of the directory in question first:

err: /Stage[main]//File[/path/to]/ensure: change from absent to directory failed: Cannot create /path/to; parent directory /path does not exist

This puppet module defines a custom function all_parents() which you can use to create a directory and all of its ancestors simultaneously.

Install ruby gems without root access in your home directory

()

You can install a ruby gem in your home directory with:

gem install --user-install puppet-module 

or:

gem install --install-dir=$HOME/.gem/ruby/1.8 puppet-module

And then you can run the command line programs installed by adding the local bin directory to your path:

PATH="$HOME"/.gem/ruby/1.8/bin:"$PATH"
export PATH

Using celery with SQS

()

Some notes about using celery with SQS:

  • acks_late does not seem to work
  • sending a task that's larger than the SQS message size limit fails with <?xml version="1.0"?><Error><Type>Sender</Type><Code>InvalidParameterValue</Code><Message>Value for parameter MessageBody is invalid. Reason: Message body must be shorter than 262144 bytes.</Message><Detail/></Error>

MessagePack vs JSON vs BSON

()

Here is a benchmark of MessagePack vs JSON vs BSON in Python 2.7.3 in Ubuntu 12.04.4 LTS on a 2.5 GHz Intel Core2 Quad Q8300. The software used was:

Install python packages without root access using easy_install or pip

()

You can run easy_install to install python packages in your home directory even without root access. There's a standard way to do this using site.USER_BASE which defaults to something like $HOME/.local or $HOME/Library/Python/2.7/bin and is included by default on the PYTHONPATH

To do this, create a .pydistutils.cfg in your home directory:

Create MySQL hashed password for Puppet password_hash setting

()

To generate a password_hash for a MySQL user in the puppetlabs-mysql Puppet Forge module, run the mysql command line program and run the query SELECT PASSWORD('opensaysme'); where opensaysme is the password you want to use for the MySQL user. For example:

Switching from GoDaddy.com to Namecheap.com

()

Years ago, I registered a few domain names with GoDaddy under their cheap promotional pricing. Every year since, I've wanted to transfer my domains away from GoDaddy to avoid their jacked up renewal fees, but every year I'd procrastinate until the expiration date and, out of fear that the transfer would fail and I'd lose the domain names entirely, I'd end up searching online for a coupon, biting the bullet, and renewing with them.  Last year, I tried to switch to 1&1 but they did not support wildcard domain names, so I gave up.

Implied State Space Size

()

Consider these two if statements:

If statement #1

if (color == RED and has_thorns == TRUE)
  return "Roses are red"
else if (num_petals == 5)
  return "Violets are blue"

If statement #2

if (species == ROSE)
  return "Roses are red"
else if (species == VIOLET)
  return "Violets are blue"

The Architecture of Open Source Applications ePub download

()

You can download an ePub version of "The Architecture of Open Source Applications" (edited by Amy Brown and Greg Wilson) here.

The book is also available to read for free at http://aosabook.org/en/index.html under the Creative Commons Attribution 3.0 Unported license.

Syndicate content
by Wesley Tanaka