Fixing Java on OS X 10.10 Yosemite

After upgrading to Yosemite, I was unable to run Apache Solr as it could not find a version of Java installed.

$java -version

No Java runtime present, requesting install.

I downloaded and installed the latest version of Java 8, but that didn’t work. I removed it and downloaded the latest version of Java 7.  Still no dice.

After a bit of digging around, I found a reference to installing Java for OS X 2014-001. While this is Java 6, it fixed my issue and allowed me to start Solr.

Hardwiring the Xantech ML85 IR Receiver to a Connecting Block

I recently added a Xantech ML85K IR repeater kit to my theater room. All of my equipment sits in the back of the room and I needed a solution for my remotes to work while pointing them at the screen as one would normally do.

The challenge with this kit is that the IR receiver comes with a standard 1/8″ (3.5mm) stereo mini plug designed to plug right into the 789-44 connecting block. Unfortunately, the cable in only 7 feet long and I needed to run over 30 feet through the walls and ceiling.

In this case I had two options:

  1. Use a 50ft stereo mini extender cable (or a 20ft and a 10ft)
  2. Use CAT6 wire

As I already had CAT6 laying around and it was better suited for in wall use, I decided to cut off the end of the IR receiver and splice the wires. The only problem is that Xantech doesn’t provide the mappings between wire color and function. They do however tell us what the tip, ring and sleeve of the mini-jack do.

So to make this work I did the only logical thing: I cut apart the mini jack to figure out the mappings my self. So you have them, here are the mappings:

  • Tip > White > Signal
  • Ring > Black > Ground
  • Sleeve > Red > +12VDC

While this works for the ML85, my guess is that it will work for other Xantech IR receivers as well.

Caching a Wildcard Domain Using Varnish with Multiple Virtual Hosts

At my company, TGFI, we have a handful of sites that run through Varnish to cache images, css, javascript and even full pages in memory. To date, all of this had been done with known domains (domain.host, www.domain.host). This week, however, we have a new application going live in the system that uses a wildcard domain. Despite looking around, I was unable to find documentation on how to handle a wildcard domain when varnish is setup to handle multiple sites.

Continue reading “Caching a Wildcard Domain Using Varnish with Multiple Virtual Hosts”

Pain is a signal of improvement

Be it programming or life, you have to push through your comfort zone to expand your capabilities. If you are unwilling to do that, you’ll lead a very unfulfilling life.

It is a fundamental law of nature that to evolve one has to push one’s limits, which is painful, in order to gain strength—whether it’s in the form of lifting weights, facing problems head-on, or in any other way. Nature gave us pain as a messaging device to tell us that we are approaching, or that we have exceeded, our limits in some way. At the same time, nature made the process of getting stronger require us to push our limits. Gaining strength is the adaptation process of the body and the mind to encountering one’s limits, which is painful. In other words, both pain and strength typically result from encountering one’s barriers. When we encounter pain, we are at an important juncture in our decision-making process.

Ray Dalio, Principles

Every day I try to push myself and challenge my beliefs from the day before. The more I read new topics or tackle difficult tasks, the better I feel.

Progress and Persistence

This quote from Steve Jobs has nothing to do with product design and everything to do with moving society forward.

Designing a product is keeping five thousand things in your brain and fitting them all together in new and different ways to get what you want. And every day you discover something new that is a new problem or a new opportunity to fit these things together a little differently. And it’s that process that is the magic.

Don’t rest on your laurels. Keep pushing.

Backing Up Your Heroku Database with PGBackups

Heroku recently announced that they are changing the way you backup your app’s database. They are deprecating their bundles add-on and have added a new PostgreSQL only backup feature. This is great news as the old bundles method included a copy of your source code as well. In one instance, our backups went from 90MB compressed to just 17MB uncompressed.

Installing the Heroku PGBackups Add-On

First, you’ll need to install the latest version of the heroku gem.

sudo gem install heroku

Next, go into your project directory and install the pgbackups add-on.

cd ~/projects/MyProject/
heroku addons:add pgbackups

Once installed you can easily make a backup to the cloud.

heroku pg:backups capture --expire

There are two things to note here:

  1. This backup now happens synchronously instead of in the background. This makes automation much easier as you don’t have to sleep for a few minutes and hope it’s done.
  2. The ––expire parameter automatically deletes the oldest backup, making historical cleanup a cinch.

Once the backup completes you can fire the download command off. This will get a public url (heroku pgbackups:url) and download it using curl to a directory on your computer. The file is also renamed with a timestamp like 20101213 for easy sorting.

curl -o /MyComputer/Drobo/backups/MyProject/MyProject_pgbackup_`date '+%Y%m%d'`.sql `heroku pgbackups:url`

That’s it. They’ve really done a great job making it easier to backup your database and it works every time.

What else can you do?

For more information, checkout the Heroku documentation on pgbackups. They have a great example at the bottom for transferring your database between production and staging sites, something we do all the time.

Installing PostgreSQL on Snow Leopard 10.6

Good news! Whether you are using PostgreSQL for general development, or need a version to match your setup on Heroku, getting PostgreSQL 8.3 installed on Snow Leopard is fairly straight forward. However, you’ll want to make some changes so that it works right for you.
Continue reading “Installing PostgreSQL on Snow Leopard 10.6”

Fixing Ruby Gems, MySQL and Passenger Phusion on Snow Leopard 10.6

One of the first things I noticed after upgrading to Snow Leopard is that my Passenger based sites stopped working. I use this heavily for Rails development, so I needed it fixed. The first thing I tried was reinstalling Passenger Phusion, which led to an error.
Continue reading “Fixing Ruby Gems, MySQL and Passenger Phusion on Snow Leopard 10.6”