Skip to content

Instantly share code, notes, and snippets.

@carlosparamio
carlosparamio / docker-swarm-ports.md
Created October 4, 2018 12:34 — forked from BretFisher/docker-swarm-ports.md
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@carlosparamio
carlosparamio / id_rsa_encryption.md
Created August 8, 2017 14:49
Encrypt/Decrypt a File using your SSH Public/Private Key on Mac OS X

A Guide to Encrypting Files with Mac OS X

This guide will demonstrate the steps required to encrypt and decrypt files using OpenSSL on Mac OS X. The working assumption is that by demonstrating how to encrypt a file with your own public key, you'll also be able to encrypt a file you plan to send to somebody else using their private key, though you may wish to use this approach to keep archived data safe from prying eyes.

Too Long, Didn't Read

Assuming you've already done the setup described later in this document, that id_rsa.pub.pcks8 is the public key you want to use, that id_rsa is the private key the recipient will use, and secret.txt is the data you want to transmit…

Encrypting

$ openssl rand 192 -out key

$ openssl aes-256-cbc -in secret.txt -out secret.txt.enc -pass file:key

Rehearsal ---------------------------------------------
struct 0.800000 0.110000 0.910000 ( 0.908901)
api_smith 11.370000 0.030000 11.400000 ( 11.416546)
virtus 62.730000 0.080000 62.810000 ( 62.869756)
----------------------------------- total: 75.120000sec
user system total real
struct 0.780000 0.030000 0.810000 ( 0.816881)
api_smith 11.130000 0.010000 11.140000 ( 11.157779)
virtus 60.450000 0.030000 60.480000 ( 60.487696)
@carlosparamio
carlosparamio / RESULTS_2_0_0_p247
Last active December 24, 2015 06:59
Block declaration benchmark
Rehearsal --------------------------------------------------
&block + yield 0.960000 0.050000 1.010000 ( 1.017942)
&block + call 1.080000 0.050000 1.130000 ( 1.122803)
proc + call 0.270000 0.330000 0.600000 ( 0.606673)
yield 0.250000 0.000000 0.250000 ( 0.244251)
----------------------------------------- total: 2.990000sec
user system total real
&block + yield 1.000000 0.050000 1.050000 ( 1.040755)
&block + call 1.090000 0.040000 1.130000 ( 1.133808)