Skip to content

Instantly share code, notes, and snippets.

View elasticsearch.toml
name = "elasticsearch.infra"
image = "elasticsearch:5.5.1-alpine"
stateful = true
[scale]
containers = 1
ram = "> 256 Mi < 1024 Mi"
cpu = "> 1% < 100%"
[env]
@arobson
arobson / es-service.yml
Last active Mar 18, 2018
An Elastic Search Stateful Set and Service Manifest
View es-service.yml
- apiVersion: v1
kind: Service
metadata:
namespace: infra
name: es
labels:
app: es
name: es
namespace: infra
spec:
@arobson
arobson / nginx.conf
Created Jun 27, 2017
npme nginx + varnish
View nginx.conf
# -----------------------------------------------------------------------------
# 1. replace `your-domain.com` with your public-facing domain
# 2. replace `1.1.1.1` with your primary server's IP
# 3. replace worker_processes with 1 if host only has 1 core
# 4. add `fs.file-max = 4096` to `/etc/sysctl.conf`
# 5. copy your SSL pem file to `/etc/nginx/wildcard.pem`
# -----------------------------------------------------------------------------
user root;
worker_processes 2;
@arobson
arobson / npme-cloudformation.yaml
Last active Jun 16, 2017
npme CloudFormation starter template
View npme-cloudformation.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: AWS CloudFormation Template for npm enterprise instance.
Parameters:
SSHKeyName:
Description: Name of existing EC2 KeyPair to enable SSH access.
Type: 'AWS::EC2::KeyPair::KeyName'
ConstraintDescription: must be the name of an existing EC2 KeyPair.
SSHLocation:
Description: The IP address range that can be used to SSH to the EC2 instances
Type: String
View keybase.md

Keybase proof

I hereby claim:

  • I am arobson on github.
  • I am arob (https://keybase.io/arob) on keybase.
  • I have a public key ASCE83LKQpAo2zdVrOWtZbmaqOXOo9S2cqUXWRVdyDTgiwo

To claim this, I am signing this object:

@arobson
arobson / abstractions.md
Last active Oct 14, 2021
Rabbit.MQ + Node.js Notes
View abstractions.md

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
@arobson
arobson / Topic Matching
Created May 24, 2012
Fun with applied FP
View Topic Matching
Subscribers subscribe to topics.
A topic is expressed as a period delimited namespace: "a.b.c.d"
A topic subscription may be an exact match or use wild card characters:
* - match 1 namespace segment at a specific location
# - match any number of namespace segments
When a message comes in, it will always have a fully specified topic.
The list of subscriptions with topics that would match the message's topic is the desired outcome.
@arobson
arobson / forkjoin-mockjax-defs.js
Created Mar 22, 2012
Mockjax Definitions for my Fork Join Blog post
View forkjoin-mockjax-defs.js
$.mockjax( {
url: "http://api.github.com/users/arobson",
type: "GET",
status: 200,
data: {
"name": "Alex Robson",
"company": "appendTo",
"public_repos": 31,
"followers": 18,
"following": 4,
@arobson
arobson / Dependency URLs
Created Mar 8, 2012
A Cartographer Starter HTML Page
View Dependency URLs
These URLs should be to the actual script files and can be used for to populate tools like JS Fiddle.
Cartographer:
https://raw.github.com/arobson/cartographer.js/master/lib/cartographer.min.js
jQuery:
http://code.jquery.com/jquery-1.7.1.min.js
Underscore:
https://raw.github.com/documentcloud/underscore/master/underscore-min.js
View gist:1586476
zlib = require 'zlib'
module.exports = (robot) ->
robot.respond /(stack|ss) ?(find:.*) ?(tags:.*)/i, (msg)->
query = msg.match[2]
query2 = msg.match[3]
query = query.replace /find:/i, ""
query2 = query2.replace /tags:/i, ""