Skip to content

Instantly share code, notes, and snippets.

View emiglobetrotting's full-sized avatar

Tamunoemi Amachree emiglobetrotting

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emiglobetrotting
emiglobetrotting / ddd_cqrs_event-sourcing_in_php.md
Created January 6, 2022 20:25 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@emiglobetrotting
emiglobetrotting / mysql-docker.sh
Created January 6, 2022 13:33 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@emiglobetrotting
emiglobetrotting / nginx-multiple-php-apps-in-subdirs.conf
Created January 5, 2022 06:39 — forked from Grendel7/nginx-multiple-php-apps-in-subdirs.conf
Example NGINX config file which loads different PHP-FPM apps from subdirectories
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /home/app/html/public;
index index.php index.html index.htm;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
@emiglobetrotting
emiglobetrotting / README.md
Created December 31, 2021 18:13 — forked from lcrilly/README.md
NGINX OAuth 2.0 Token Introspection

OAuth 2.0 Token Introspection with NGINX and njs

This configuration enables NGINX to validate an authentication token against an authorization server by using OAuth 2.0 Token Introspection (RFC 7662). This solution uses the auth_request module and the NGINX JavaScript module to require authentication and perform the token introspection request.

By default, the client's authentication token is expected as a bearer token supplied in the Authorization header. If supplied elsewhere in the HTTP request, the $access_token variable must be configured to specify where to obtain the token.

Token introspection requests are authenticated. By default, the $oauth_client_id and $oauth_client_secret variables are used to perform HTTP Basic authentication with the Authorization Server. If only the $oauth_client_secret variable is specified then that value is used

@emiglobetrotting
emiglobetrotting / nginx.conf
Created December 30, 2021 16:42 — forked from abbaspour/nginx.conf
Guide how to enable JWT validation on open source nginx server using ngx-http-auth-jwt-module
daemon off;
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
@emiglobetrotting
emiglobetrotting / create_swarm_cluster.sh
Created December 28, 2021 15:36 — forked from alexei-led/create_swarm_cluster.sh
Deploy Docker Compose (v3) to Swarm (mode) Cluster
#!/bin/bash
# vars
[ -z "$NUM_WORKERS" ] && NUM_WORKERS=3
# init swarm (need for service command); if not created
docker node ls 2> /dev/null | grep "Leader"
if [ $? -ne 0 ]; then
docker swarm init > /dev/null 2>&1
fi
@emiglobetrotting
emiglobetrotting / vagrant-docker-digitalocean
Created December 20, 2021 02:30 — forked from bdamusis/vagrant-docker-digitalocean
Vagrantfile for deploying to Digital Ocean droplet with Docker
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Quick start:
# - vagrant plugin install vagrant-digitalocean
# - Set-up ~/.digital_ocean.rb like this:
# module DigitalOceanKeys
# CLIENT_ID = 'foooooooo'
# API_KEY = 'fabada'
# end
@emiglobetrotting
emiglobetrotting / iptables-reload.sh
Created December 9, 2021 20:02 — forked from tehmoon/iptables-reload.sh
IPtables and docker reload!
#!/bin/sh
set -e
## SEE https://medium.com/@ebuschini/iptables-and-docker-95e2496f0b45
## You need to add rules in DOCKER-BLOCK AND INPUT for traffic that does not go to a container.
## You only need to add one rule if the traffic goes to the container
CWD=$(cd "$(dirname "${0}")"; pwd -P)
FILE="${CWD}/$(basename "${0}")"
@emiglobetrotting
emiglobetrotting / Vagrantfile
Created December 4, 2021 13:46 — forked from pzelnip/Vagrantfile
Ubuntu xenial64 (Ubuntu 16) Vagrantfile with Docker, pip, and awscli installed
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at