Skip to content

Instantly share code, notes, and snippets.

Florian Motlik flomotlik

Block or report user

Report or block flomotlik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
flomotlik /
Last active Jan 10, 2020
Heroku run script that exits with the correct error code
#! /bin/bash
array=( $@ )
buffer_file=/tmp/last_heroku_run_`date +%N`
/usr/bin/heroku run "$args; echo \$?" --app $app 2>&1 | tee $buffer_file
flomotlik / myapp.rb
Created Feb 24, 2012
Using Thor subcommands
View myapp.rb
require 'thor'
require "sub"
class MyApp < Thor
desc "parentcommand SUBCOMMAND", "Some Parent Command"
subcommand "sub", Sub
flomotlik / gist:6212725
Last active Nov 13, 2017
Wget Curl comparison and our Approach
View gist:6212725

We have changed our check_url implementation from curl to wget for three reasons

  1. It gives us the ability to retry on connection refused. Compare the command we used previously with curl:
curl -sSfL --retry 3 URL

to the current one:

flomotlik / Dockerfile
Created Sep 18, 2017
AWSGit for pushing to CodeCommit
View Dockerfile
FROM alpine:latest
RUN apk add --no-cache --update \
python \
python-dev \
py-pip \
build-base \
RUN pip install awscli
flomotlik /
Created Sep 28, 2016
Pull Request handling
# Checkout a PR from the current repo
function copr { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }
# Get the current PR from the branch name
function current_pr {
git rev-parse --abbrev-ref HEAD | grep -oE "\d+"
# Update the PR
function upr {
View CodeDeploy Policy
"Version": "2012-10-17",
"Statement": [
"Effect": "Allow",
"Action": [
"Resource": [
flomotlik /
Created Mar 20, 2017 — forked from acolyer/
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
flomotlik / update_firefox
Last active Jan 10, 2017
Update Firefox version on Codeship
View update_firefox
# Add the following commands to your setup commands to update firefox
# git clone update_firefox
# bash ./update_firefox/update_firefox 28
# firefox --version
set -e
if [ -z "$1" ]; then
View create_ami.rb
# Create an Amazon EC2 AMI
ec2 =
:access_key_id => ENV['AWS_KEY'],
:secret_access_key => ENV['AWS_SECRET_KEY'])
ec2.images.create(:instance_id => instance_id)

Setting the AWS API Key & Secret

To start using Serverless and access the AWS API you need to set the AWS API Access Key & Secret.

Quick Setup

As a quick setup to get started you can export them as environment variables so they will be accessible to Serverless and the AWS SDK in your shell:

export AWS_ACCESS_KEY_ID=<key>
export AWS_SECRET_ACCESS_KEY=<secret>
You can’t perform that action at this time.