Skip to content

Instantly share code, notes, and snippets.

View paulcalabro's full-sized avatar

Paul Calabro paulcalabro

View GitHub Profile
@paulcalabro
paulcalabro / linkroll.md
Created December 7, 2018 10:08 — forked from digitaljhelms/linkroll.md
Interesting and/or useful dev links
  • How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript – Link
    • The npm Blog – kik, left-pad, and npm – Link
  • Electron – Build cross platform desktop apps with web technologies – Link
  • What every Browser knows about you – Link
  • Android Studio 2.0 | Android Developers Blog – Link
  • Dev Centers – Directory of developer center websites with memorable URL shortcuts – Link
  • Java Forever And Ever Movie (Java vs Windows .Net) – Link
  • Everything announced at Facebook's F8 conference – Link
  • New Facebook dev tools include Account Kit, push and quote sharin
@paulcalabro
paulcalabro / haproxy.conf
Created March 3, 2019 01:43 — forked from nateware/haproxy.conf
HAProxy sample config for EC2
#
# This config file is a combination of ideas from:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#
@paulcalabro
paulcalabro / docker-swarm-ports.md
Created March 4, 2019 07:39 — 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

echo "Turn OFF Firewall"
chkconfig firewalld off
service firewalld stop
echo "192.168.122.226 ipa.ec.example.com ipa" >> /etc/hosts
echo "Change DNS server to 192.168.122.247 (ad.example.com)"
cat >> /etc/dhcp/dhclient-eth0.conf << EOF
supersede domain-name-servers 192.168.122.247;

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

@paulcalabro
paulcalabro / Remote API via daemon.json.md
Created May 3, 2019 20:20 — forked from kekru/Remote API via daemon.json.md
Enable Docker Remote API via daemon.json
@paulcalabro
paulcalabro / github-clone-all.py
Created April 16, 2020 19:32 — forked from YuriyGuts/github-clone-all.py
Clone all public and private repositories from a specific GitHub user or organization
#!/usr/bin/env python
"""
Clone all public and private repositories from a GitHub user or organization.
Copyright (c) 2018 Yuriy Guts
usage: github-clone-all.py [-h] [--auth-user AUTH_USER]
[--auth-password AUTH_PASSWORD] [--clone-user USER]
[--clone-org ORG]
@paulcalabro
paulcalabro / proxy.md
Created May 25, 2020 16:40 — forked from yougg/proxy.md
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@paulcalabro
paulcalabro / list-manually-installed-packages.sh
Created June 22, 2020 20:31 — forked from UniIsland/list-manually-installed-packages.sh
List all manually installed packages on a debian/ubuntu system
#!/bin/bash
## List all manually installed packages on a debian/ubuntu system
## manually installed means:
## 1. not pre-installed with the system
## 2. not marked auto-installed by apt (not dependencies of other
## packages)
## Note: pre-installed packages that got updated still needs to be
## filtered out.
@paulcalabro
paulcalabro / make_writable.js
Created October 14, 2021 18:17 — forked from moehlone/make_writable.js
Make JavaScript readonly propertys writable (example for overwriting navigator.userAgent; useful for unit tests -> browser detection)
/**
* Creates a read/writable property which returns a function set for write/set (assignment)
* and read/get access on a variable
*
* @param {Any} value initial value of the property
*/
function createProperty(value) {
var _value = value;
/**