Skip to content

Instantly share code, notes, and snippets.

View atmosx's full-sized avatar

Panagiotis Atmatzidis atmosx

View GitHub Profile
atmosx / file.js
Created March 22, 2022 17:33
get external IP
var ip = require("ip");
var http = require('http');
var host = "ip-1-2-3-4.ec2.internal"
function getExternalIP(host) {
if (host.includes('ec2.internal')){
console.log("This is an EC2 instance. Fetching 'listenIp' via HTTP");
http.get({'host': '', 'port': 80, 'path': '/'}, function(resp) {
resp.on('data', function(ip) {
return ip;
atmosx /
Created October 19, 2019 20:02 — forked from dpino/
Setup a network namespace with Internet access
#!/usr/bin/env bash
set -x
atmosx /
Created October 6, 2018 10:51 — forked from BretFisher/
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

atmosx /
Created May 30, 2014 15:03 identification

Keybase proof

I hereby claim:

  • I am atmosx on github.
  • I am atmosx ( on keybase.
  • I have a public key whose fingerprint is 3F2B 3653 8175 1BC1 EAC7 C23C FCB4 D5AF 1A7B FEC5

To claim this, I am signing this object: