Skip to content

Instantly share code, notes, and snippets.

View shirren's full-sized avatar

Shirren shirren

  • Sydney
View GitHub Profile
@shirren
shirren / keen.hs
Created August 16, 2018 04:42
Haskell example to retrieve metrics from Keen.io via its rest interface
{-# OPTIONS -Wno-unused-top-binds #-}
{-# OPTIONS -Wname-shadowing #-}
module Analysis.Keen where
import Data.Aeson
import qualified Data.ByteString.Char8 as BC
import Data.Text (Text)
import Data.Semigroup
import Network.HTTP.Simple
@shirren
shirren / swarm-https.yml
Created September 4, 2017 05:05
Docker Swarm Compose yml with https redirection example
version: '3.1'
services:
traefik:
command:
- --web
- --docker
- --docker.swarmmode
- --docker.domain="mydomain.com"
- --docker.watch
@shirren
shirren / vultr_dokku_rails.md
Last active March 12, 2018 23:51
How to deploy a Rails 4/5 app on Vultr or Digital Ocean using a stock Ubuntu image with Dokku 0.6.5v

Rails/Dokku Deployment Procedure

This procedure has been tested on Vultr, and Digital Ocean. In theory it should work on any VPS as long as the linux instance is Ubuntu. There might be some subtle differences for other linux variants.

  1. Create a new compute instance on Vultr using an 64-bit ubuntu image
  • From the available compute instance sizes, pick at a minimum a server with 1024Mb of memory. Compute instances with smaller sizes will fail on deploy
  1. ssh on to the server root@ipaddress
  • If this is your first deploy onto Vultr ensure you've created a ssh key pair firstly. Then add your public key during the compute instance creation procedure
  • Now wait for Vultr to provision an instance of your new image
  1. Install Dokku 0.6.5