Skip to content

Instantly share code, notes, and snippets.

View jpsecher's full-sized avatar

Jens Peter Secher jpsecher

View GitHub Profile
@jpsecher
jpsecher / mywebapp.tf
Last active February 20, 2016 18:54
Terraform AWS Docker host setup
variable "aws_key_name" {
description = "Name of the SSH keypair to use in AWS."
}
variable "safe_ips" {
description = "Comma-separated string of CIDR blocks for trusted IPs."
}
variable "pem_file" {
description = "Local SSH key that matches AWS key."
@jpsecher
jpsecher / sequence-with-delay.js
Last active March 5, 2017 14:35
Promise sequence with delay & progress
'use strict';
/**
* Dripwise process a list of items through a processing promise.
* @param {Array(α)} list Items to process.
* @param {int} msDelay Delay in ms between each processing.
* @param {α -> Promise(void)} processing Processer of one item.
* @param {int -> ()} progressReporter Optional function, called with index of item.
* @return {Promise(void)} Promise of the sequential processing.
*/
@jpsecher
jpsecher / gluster_volume-problem.md
Last active June 9, 2018 20:33
Ansible gluster_volume fails during probe peer

I am hitting the same problem with (which used to work)

- name: Create Gluster volume
  gluster_volume:
    name: "{{ volume_name }}"
    state: present
    host: "{{ inventory_hostname }}"
    bricks: "{{ brick_dir }}/{{ brick_name }}"
    cluster: "{% for host in workers %}{{ host }},{% endfor %}{{ inventory_hostname }}"

replicas: "{{ workers|length + 1 }}"

@jpsecher
jpsecher / ubuntu-16-04-ami-contents.md
Last active December 17, 2018 11:34
Ubuntu 16.04 Xenial AMI contents

Here is what a freshly Ubuntu 16.04 Xenial AWS Machine Image (specifically ami-0181f8d9b6f098ec4) contains.

First and most importantly, only SSH daemon and DHCP client is running:

ubuntu@ip-172-1-2-3$ netstat -tupln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1240/sshd       
tcp6       0      0 :::22                   :::*                    LISTEN      1240/sshd       
udp        0      0 0.0.0.0:68              0.0.0.0:*                           883/dhclient