I ran into a situation where I had a number of resources in a CloudFormation stack that may already exist, or I might want to make creation of those objects optional.

To achieve this it turns out that CloudFormation actually has a nice facility, although it is a bit awkward.

In this particular case, I have a stack that creates a CloudFront distribution for a wildcard domain. The stack includes creating the certificate, but I realized that when I go to production with this, I will have an existing certificate that will be used, so there won’t be a need to create a new one.

So in my stack, I added a parameter for the ARN of an existing certificate which looks like:

Notice that I set the default to an empty string, which implies my default scenario, I won’t use an existing certificate, but instead create one.

Then I need a condition statement which I can use later in the stack.

What this says is give me a condition that will be true if the parameter of ACMARN is equal to an empty string. I named it CreateCertificate to make it descriptive to the action that this will have. So if there is a value in ACMARN, then CreateCertificate will be false.

With that I update my certificate creation in the Resources section to be optional.

The “Condition” will only create the certificate if the ARN was not set.

So finally I also need to put a condition in the distribution creation that will use the ARN from the parameter, OR the new certificate, which I use an Fn::If for.


I occasionally run into weird permission problems after a restore of files and folders on my machine, I think it has to do with OSX trying to protect me from myself.

Today I needed to fire up my coding environment on my Mac Mini, so I jumped into the folder for the code that I wanted to update using SourceTree, and did (what I thought was going to be) a quick pull, only to get a weird error message.

I figured it was probably something goofy, so I went to the command line, only to get another weird error:

Well, I’ve seen that before, and knew that message was probably because I’ve updated the OS a few times since I last coded. Basically it means the XCode command line tools are missing. Fixing that is easy: just run:

This fires up the Xcode installer, which will ask you if you want to install Xcode, or just the command line tools. In this case I don’t need Xcode, so I chose the latter.

That took a pretty long time (it was on “about a minute left” for at least 10 minutes), which was a bit worrisome, but not all that unusual.

Going back to the command line, I tried to do my “git pull” only to get another error:

OK, weird – why can’t it write that. Found a few things online that suggested running “git gc” might fix it, so I tried that, but that just gave me this error:

More curious Googling, and finding the suggestion to look at the extended file permissions, so I tried that:

Wait, what’s this “group:everyone deny delete” ? Well, no wonder I can’t run stuff that updates these folders. More Googling and I find the right switch for chmod to clear out the extended permissions:

Note that I had the two flags reversed the first time and the command told me it couldn’t find a file named “-R”. After running the above, the folder permissions looked more normal:

And my commands worked as expected.

Sometimes I get my branch in a state where I need to reset things to what is on the server. Most of the time a simple switch of branches is enough to get everything back in shape, but once in a while I need to actually reset to what is in the parent repo.

To reset your local working copy to exactly what is in the remote (typically called origin) do the following:

These should be done in the root of your project.

I needed to do some work on an old Maven project I have that I’ve worked on for years, and when I fired up my handy Netbeans IDE and ran the obligatory “priming build”, I was surprised to get an error on one of the basic Maven plugins. Continue reading

Two years ago, I moved to Salt Lake City for work. After looking around a bit for a rental property close to my new work, it became clear that I would be better off trying to buy a new home than renting if I could afford to do so. At the time the interest rates and property values in Salt Lake City were very low, so monthly mortgage payments were often cheaper than rental prices.Screen Shot 2015-04-25 at 9.22.15 AM

Sitting at the Salt Lake Roasting Company after we first moved here, we found a really nice real estate agent (Jaral Ferwerda).  I worked with him diligently to find a home while my lovely wife was buttoning up our home in California.

After a while, I started to find it very difficult to keep track of all the homes I was seeing. They started to blur together, and I wasn’t really able to figure out which one I liked best.

Continue reading

I created a WordPress site for a client who needed to support both English and Español versions of their content, which involved using a plugin called MultilingualPress that creates relationships between sites for each language.

I developed the site locally on my server, and then after they created some content, migrated it to their hosting service.

Continue reading

Sometimes I find myself working backwards up a tree of errors to fix a problem. Today was a case in point.

Since I’ve been doing a bit of WordPress grooming, I have the development build checked out locally. Previously I had run phpunit against the unit tests included in the code, but for some reason when I tried to run things under NetBeans, it would error out (Bug 247704).

Continue reading

I don’t usually write about services that I use, but one that I really have been excited about is Square Cash.

Square Cash is an application by Square that uses email to do secure cash transfers. I have been using it for a while now, mostly to send money to friends when I need to pay them back for buying lunch (or when they need to pay me back). It is extremely simple to use, and is free.

It is extremely simple to use, all you need is a bank debit card, and you can start texting your friends money (or asking for money from them.

And right now, if you follow this link https://square.com/cash/D28b8Q, both you and I will get a buck deposited in the bank.

If your organization is like most, they will have sites that use a self-signed (or untrusted authority) certificate.

From Wikipedia:

In cryptography and computer security, a self-signed certificate is an identity certificate that is signed by the same entity whose identity it certifies. This term has nothing to do with the identity of the person or organization that actually performed the signing procedure. In technical terms a self-signed certificate is one signed with its own private key.

Continue reading