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
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
end
MyApp.start
@flomotlik
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
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 \
git
RUN pip install awscli
@flomotlik
flomotlik / functions.sh
Created Sep 28, 2016
Pull Request handling
View functions.sh
# 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": [
"codedeploy:RegisterApplicationRevision",
"codedeploy:GetApplicationRevision"
],
"Resource": [
@flomotlik
flomotlik / service-checklist.md
Created Mar 20, 2017 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist
View service-checklist.md

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
flomotlik / update_firefox
Last active Jan 10, 2017
Update Firefox version on Codeship
View update_firefox
#!/bin/bash
# Add the following commands to your setup commands to update firefox
# git clone https://gist.github.com/9525133.git 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 = AWS::EC2.new(
:access_key_id => ENV['AWS_KEY'],
:secret_access_key => ENV['AWS_SECRET_KEY'])
ec2.images.create(:instance_id => instance_id)
View something.md

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>
View install_go.sh
cd
rm -fr go
wget http://go.googlecode.com/files/go1.2.linux-amd64.tar.gz
tar xfz go1.2.linux-amd64.tar.gz
cd clone
go get github.com/kr/godep
You can’t perform that action at this time.