Capistrano 3: Deploying via a gateway

Capistrano logo

At Kisko some of our projects have production environments with IP restrictions, meaning that we can access the servers from our office but not from any random IP address.

Despite this, it is handy and perhaps even necessary that we can deploy and access the servers when working remotely or if an emergency crops up when we’re away from the office. Using a VPN or SOCKS proxy is one option, but luckily it is also pretty easy to configure Capistrano 3 to deploy via a bastion or gateway host.

Set-up Capistrano as your normally would, then add this to your deploy.rb:

if ENV['VIA_BASTION']
  require 'net/ssh/proxy/command'

  # Use a default host for the bastion, but allow it to be overridden
  bastion_host = ENV['BASTION_HOST'] || 'bastion.example.com'

  # Use the local username by default
  bastion_user = ENV['BASTION_USER'] || ENV['USER']

  # Configure Capistrano to use the bastion host as a proxy
  ssh_command = "ssh #{bastion_user}@#{bastion_host} -W %h:%p"
  set :ssh_options, proxy: Net::SSH::Proxy::Command.new(ssh_command)
end

Note: Remember to replace the bastion hostname with your own…

Now when your not deploying from your regular IP address, you can simply set the VIA_BASTION environment variable to deploy via the bastion host. For example:

VIA_BASTION=1 cap production deploy

And that’s it!

Brewery stamp

Brewery stamp

I designed and bought a stamp for my home “brewery” (known as Baltic Sea Brewing).

Why? Mostly because I could and wanted to…

Retrospective: Ilves IPA

Retrospective: Ilves IPA

It’s been a bit over a year since I started brewing beer and Ilves IPA was the very first beer I ever brewed (brewed on December 14th 2013, bottled January 4th 2014).

I’m afraid time has not been kind to this beer, possibly at least due to my suboptimal storage conditions (I don’t have a cool place to store beer for long periods).

The beer has ended up a bit overcarbed and the flavour profile frankly isn’t great. Luckily this was the last bottle of this gyle of Ilves IPA, so no one will have to have another glass of it ever again.


If you like brewing, you should check out Beer Styles, a free iPhone and iPad app I built for browsing the 2008 BJCP style guidelines.

Books of 2014

Since I did this sort of thing last year, I figured I might as well make this a tradition of sorts.

Favourites of the year

Picking out favourites turned out to be a bit difficult this year (it seems that I read a bunch of good books in 2014), but here’s a few that stuck out.

Going Clear

Going clear cover

I haven’t quite finished this book yet but having read a bit more than half of it I can already tell that this is going to be one of my favourites for the year.

Written by Lawrence Wright, a Pulitzer Prize winning journalist, the book details the history of the Scientology movement and the life of it’s founder, L. Ron Hubbard.

HBO is currently adapting the book into a documentary (slated to air in 2015).

What If?

What If cover

As a long time time fan of xkcd and occasional reader of [What If?] (the online version), this book was most welcome…

The book is both hilarious and informative. I’m pertty sure there wasn’t a single chapter where I didn’t giggle at least a little bit…

Command and Control

Command and Control cover

Warning: this book is extremely scary and will make you wonder who we (we being humanity) have managed to avoid accidentally blowing ourselves up with nukes.

Surface Detail

Surface Detail cover

Since all my other picks where non-fiction, I thought I should include at least one book that isn’t depressing and based on true facts…

Surface Details turned out to be one of my favourite books from the Culture series by Iain M. Banks. In fact, I ended up reading it twice.

The full(ish) list

The (almost) full list of books I read this year. Some books that I had previously read don’t show up on my Goodreads list. Plus there might be a few others missing because of my sloppy Goodreads habits…


Full disclosure: All book links in this article lead to Piranhas, my book price comparison service.

Homebrew wishlist (2014)

Since there seems to be a bunch of homebrew gift lists floating around, I thought I might as well publish my own little list…

These are books and other items that I want, not necessarily things that, for example, a novice brewer really needs. In fact, these might not be things I need as much as things I’d quite like to have…

Equipment

Digital Refractometer

Milwaukee MA871

The Milwaukee MA871 is an affordable and highly praised digital refractometer. It can measure gravity from 0°Bx to 85°Bx (about 1.000 to 1.438 OG) and has automatic temperature correction.

Using Sean Terrill’s Refractometer Calculator, you can even use it to measure/estimate FG.

Digital pH meter

Hanna Instruments HI98128

The Hanna Phep 5 pH meter is the pH meter recommended by The Electric Brewery and should be accurate and long lasting if cared for correctly. It’s also waterproof and floats if dropped in water or wort.

Books

Farmhouse Ales (by Phil Marowski)

Farmhouse Ales

Today’s farmhouse styles resulted from years of evolution, refinement, interpretation and re-interpretation of the simple, rustic ales once brewed on farms in Flanders and Wallonia.

Farmhouse Ales defines these Saison and Biere de Garde brews in modern and historical terms while guiding today’s brewers toward credible and enjoyable reproductions of these Old World classics.

For a more detailed book review, see Michael Tonsmeire’s review of Farmhouse Ales on his blog.

Brew Like a Monk (by Stan Hieronymus)

Brew Like a Monk

In Brew Like a Monk, Stan Hieronymus details the beers and brewing of the famous Trappist producers along with dozens of others from both Belgium and America. Sip along as you read and, if you feel yourself divinely inspired to brew some of your own, try out the tips and recipes as well!

Michael Tonsmeire also has a good review of Brew Like a Monk on his site.


Full disclosure: Equipment links are Amazon affiliate links. The books link to Piranhas, my book price comparison service.

You should also install Beer Styles, a free iOS app I built for browsing the BJCP style guidelines.

Baltic Amber

Baltic Amber

I bottled my Baltic Amber this weekend. It’s an American Amber Ale brewed with sahti malt, hopped with Newport and Amarillo, and flavoured with a small amount of dried juniper berries (as a nod towards traditional Sahti). Fermented with Safale US-05 yeast.


You should totally install Beer Styles, a free iOS app I built for browsing the BJCP style guidelines.

Unable to connect to the Internet

The next time you have connection issues, you can play this little Dinosaur game in Google Chrome.

Press spacebar or the up-key when Chrome can’t connect to the internet.

Google Chrome can’t display the web page because your computer isn’t connected to the Internet.

Extra Sahti Bitter

Extra Sahti Bitter

The label for my Extra Sahti Bitter, which is an ESB brewed with Sahti Malt (from Viking Malt), flavoured with English hops and dried juniper berries. It was fermented with two yeasts: an English ale yeast (Fermentis S-04) and a wheat beer yeast (Fermentis WB-06).

The wheat beer yeast was used as a “clean” substitute for the bread yeast which is normally used when brewing Sahti (since you can’t be sure that bread yeast doesn’t contain miscellaneous microbes).


Beer Styles is a free iOS app I built for browsing the BJCP style guidelines. You should totally install it

New version of Beer Styles

Beer Styles 0.10.0 on an iPad and iPhone 6

A new and improved version of Beer Styles just went live on the App Store, though it might take a little while before it propagates to everyone.

Release notes

  • You can now search for styles!
  • Send feedback via the app info dialog
  • Better contrast between the navigation and title in the top bar
  • Miscellaneous bug fixes and improvements
  • Now with extra lemurs! (No, not really. I just made that up)

What is Beer Styles?

The app might not be very useful if you’re not into homebrewing, or at least into beer. Beer Styles wraps up the 2008 BJCP Style Guidelines in a pleasing interface on the iPhone and iPad.

Read more about Beer Styles from the original announcement blog post…

Beer Styles on the App Store

Me, I'm Counting

Me, I'm Counting

Just labelled two cases of Me, I’m Counting, my Dubbel that was supposed to be a Tripel (there were problems with efficiency).