Skip to content

Instantly share code, notes, and snippets.

View paulcalabro's full-sized avatar

Paul Calabro paulcalabro

View GitHub Profile
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;
@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

@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 / 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 / mmr_tcx_downloader.py
Last active May 8, 2023 18:28
This script downloads Training Center XML (TCX) files from MapMyRun
#!/usr/bin/env python3
from getpass import getpass
from requests import request
###########################################
# Prompt the user for required information.
###########################################
print('\n' + ('*' * 25) + ' Required Information: ' + ('*' * 25))
@paulcalabro
paulcalabro / inspect_comparable_keys.py
Last active October 4, 2018 08:31
These are code snippets that can be used to debug ansible-module-foreman
for key in comparable_keys:
if data[key] != os.get(key, data[key]):
module.fail_json(msg='Problematic key: {0} vs {1}'.format(data[key], os.get(key, data[key])))

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@paulcalabro
paulcalabro / php_apache_homebrew.md
Created January 31, 2018 15:56 — forked from DragonBe/php_apache_homebrew.md
Installation of Apache 2.4 and PHP 7.1 with Homebrew

I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.

The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.

I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.

Apache and PHP with homebrew

I’ve made this according to the installation instructions given on GetGrav.

@paulcalabro
paulcalabro / configure-macos.sh
Created January 9, 2018 21:17 — forked from seize-the-dave/configure-macos.sh
Script to install everything onto a new Mac
# Install command line developer tools
xcode-select --install
# Install Brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Reset brew
brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
# Install HTTPIE
@paulcalabro
paulcalabro / CustomBusinessEventComponent.java
Created November 23, 2017 10:51 — forked from djuang1/CustomBusinessEventComponent.java
Java code to create Business Event in Mule Management Console (MMC)
package com.mulesoft.dejim;
import java.util.HashMap;
import java.util.Map;
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
import org.mule.DefaultMuleEvent;
import org.mule.MessageExchangePattern;
import org.mule.api.MuleEvent;