Skip to content

Instantly share code, notes, and snippets.

View morganchristiansson's full-sized avatar

Morgan Christiansson morganchristiansson

View GitHub Profile
@morganchristiansson
morganchristiansson / iam_module_main.tf
Created January 24, 2020 17:49
terraform iam_module.tf
resource aws_iam_role_policy this {
name = var.name
role = aws_iam_role.this.name
policy = var.policy
}
resource aws_iam_role this {
name = var.name
assume_role_policy = <<EOF
{
@morganchristiansson
morganchristiansson / gist:8e7d341824a87dfd292ad1826429405f
Created March 15, 2018 06:32
morganchristiansson/aws-smtp-relay: Build in 'simplify-dockerfile' (154e3aa2)
Building in Docker Cloud's infrastructure...
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Switched to a new branch 'simplify-dockerfile'
Pulling cache layers for index.docker.io/morganchristiansson/aws-smtp-relay:simplify-dockerfile...
Done!
Executing pre_build hook...
=> Building the binary
Unable to find image 'maven:alpine' locally
alpine: Pulling from library/maven
@morganchristiansson
morganchristiansson / extract-123-reg-zonefile.js
Created March 15, 2017 13:30 — forked from biinari/extract-123-reg-zonefile.js
Script to extract the DNS entries from 123-reg advanced dns page
var table = document.getElementsByClassName('advanced_dns')[0];
var rows = table.getElementsByTagName('tr');
var i, len, row;
var hostname, type, priority, ttl, destination;
var output = '';
output += '$TTL 600\n'; // start with default TTL
// skip header and last two rows (add new entry, delete all entries)
for (i = 1, len = rows.length - 2; i < len; i++) {
#!/usr/bin/env ruby
require 'spreadsheet'
input_path = ARGV[0] or abort('Expecting .xls file as argument')
output_path = input_path.sub(/\.xls$/, '-out.xls')
book = Spreadsheet.open(input_path)
# This is a fix/workaround - modifying each sheet in the workbook.
# Without it, the output file doesn't open at all
#!/usr/bin/env rackup
require 'forward'
run Rack::Forwarder.new('google.com')
[alias]
unmerged = !vim -o $(git-unmerged-files)