Skip to content

Instantly share code, notes, and snippets.

Avatar

Panagiotis Atmatzidis atmosx

View GitHub Profile
@atmosx
atmosx / file.js
Created March 22, 2022 17:33
get external IP
View file.js
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': 'checkip.amazonaws.com', 'port': 80, 'path': '/'}, function(resp) {
resp.on('data', function(ip) {
return ip;
@atmosx
atmosx / ns-inet.sh
Created October 19, 2019 20:02 — forked from dpino/ns-inet.sh
Setup a network namespace with Internet access
View ns-inet.sh
#!/usr/bin/env bash
set -x
NS="ns1"
VETH="veth1"
VPEER="vpeer1"
VETH_ADDR="10.200.1.1"
VPEER_ADDR="10.200.1.2"
@atmosx
atmosx / docker-swarm-ports.md
Created October 6, 2018 10:51 — 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
View docker-swarm-ports.md

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
atmosx / keybase.md
Created May 30, 2014 15:03
keybase.io identification
View keybase.md

Keybase proof

I hereby claim:

  • I am atmosx on github.
  • I am atmosx (https://keybase.io/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: