Skip to content

Instantly share code, notes, and snippets.

View jaymecd's full-sized avatar

Nikolai Zujev jaymecd

View GitHub Profile
# iops
resource "aws_db_instance" "rds" {
identifier = "${var.identifier}"
allocated_storage = "${var.allocated_storage}"
iops = "${var.iops}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
instance_class = "${var.instance_class}"
name = "${var.db_name}"
username = "${var.db_username}"
#!/usr/bin/python
# aws-instance-monitor
#
# This is a command-line tool, as well as a monitor/failover script that is designed
# for HA NAT, but should be usable when the following conditions are met:
#
# 1. Used in AWS VPC Route Table - VPC routing describes methods of egress
# for outbound traffic. Typically, a NAT will have a 0.0.0.0/0 rule
# and the route will be in a table associated with a Private Subnet.
@jaymecd
jaymecd / puma.sh
Last active August 29, 2015 14:24 — forked from ktaragorn/puma.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: pumacontrol
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Puma web server
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
#!/bin/sh
# This script will install a Git pre-push hook that prevents force pushing the master branch.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/d465f1e331fc5c632088/raw/install-pre-push.sh | sh
# Uninstall:
# rm .git/hooks/pre-push
# in each repository that you've added this to.
GITROOT=`git rev-parse --show-toplevel 2> /dev/null`
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.

HAProxy + Consul vs VulcanD + EtcD

HAProxy/Consul

  • Pro: Both are production ready
  • Pro: Can handle any throughput we will see
  • Pro: More feature rich
    1. Healthchecks
    2. DNS and HTTP API available to map endpoints
    3. Lots of service discovery built in
  • Pro: Solution could be used in more than one place (bld/prod/etc..)
@jaymecd
jaymecd / nodecqrs.js
Last active August 29, 2015 14:17 — forked from janderit/nodecqrs.js
function UserWasCreated(id, name){
this.Event = arguments.callee.name;
this.UserId=id;
this.Name=name;
}
function UserWasRenamed(id, name){
this.Event = arguments.callee.name;
this.UserId=id;

Resilient Architectures for the cloud

Slide - Introduction

Ask these questions:

  • How many of you have deployed your applications for the cloud?
  • Have you ever had any downtown out of something you didn't do?

##Reactive System Design Links

#Articles and Papers