Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
@bsodmike
bsodmike / edgemax-ad-blocker-dnsmasq.md
Last active September 4, 2023 18:28
HOWTO Ubiquity EdgeMAX Ad Blocking Content Filtering using EdgeRouter

Ubiquity EdgeMAX Ad Blocking Content Filtering using EdgeRouter

This is based on a guide on the Ubnt forums.

Log into your Edgerouter and run the following - sudo -i && vi /config/user-data/update-adblock-dnsmasq.sh This will switch you to the root user and open up vi.

#!/bin/bash
@redecs
redecs / Dockerfile
Created November 22, 2019 11:38
Docker entrypoint example for node.js
FROM node:${NODE_VERSION}-alpine
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
#COPY package.json yarn.lock ./
COPY package*.json ./
#RUN yarn install --pure-lockfile
@tjstein
tjstein / nginx-vhost.conf
Created April 5, 2011 00:47
nginx vhost config for WordPress + PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
@pecigonzalo
pecigonzalo / docker-dind-swarm-cluster.sh
Created June 9, 2017 17:32
Docker in Docker (dind) swarm creation script
#!/bin/bash
# set -x
MANAGER=${1:-3}
WORKER=${2:-0}
#=========================
# Creating cluster members
#=========================
@Taubin
Taubin / traefik.yml
Created January 9, 2020 22:06
Traefik Docker
traefik:
image: "traefik:v2.1"
container_name: "traefik"
hostname: "traefik"
restart: unless-stopped
env_file:
- .env
ports:
- "80:80"
- "443:443"
@prayagsingh
prayagsingh / docker-compose-traefik.yaml
Created February 25, 2020 08:25
Treaefik with file provider and with letsencrypt and custom tls certs
# Providers :- discover the services that live on your infrastructure (their IP, health, ...)
# Entrypoints :- listen for incoming traffic (ports, ...)
# Routers :- analyse the requests (host, path, headers, SSL, ...). A router is in charge of connecting incoming requests to the services that can handle them.
# Services :- forward the request to your services (load balancing, ...). The Services are responsible for configuring how to reach the actual services that will eventually handle the incoming requests.
# Middlewares :- may update the request or make decisions based on the request (authentication, rate limiting, headers, ...)
version: "3.7"
networks:
@lfache
lfache / docker-compose.yaml
Created July 15, 2020 12:46
Hardened Traefik sample with whoami + HTTPS everywhere/redirect
version: "3.8"
services:
dockerproxy:
image: tecnativa/docker-socket-proxy
environment:
- CONTAINERS=1
networks:
- socket_docker
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
@shebpamm
shebpamm / kickstart.cfg.j2
Created September 24, 2021 11:32
Kickstart template for RHEL 8
lang en_US
keyboard us
timezone Europe/Helsinki --isUtc
reboot
text
cdrom
bootloader --location=mbr --append="rhgb quiet crashkernel=auto"
zerombr
clearpart --all --initlabel
autopart

Simple envoy configuration with basic authentication and without authorization service

Sometime you need scrape prometheus metrics from external envoy that deploy not to kubernetes environment

You can use iptable or other stuff on external server to allow only trusted IP for scraping metrics - but for dynamic infrastructure some time it's hard to support it.

Envoy can expose this metrics more elegant style - using basic auth

Simple envoy.yaml

@jesugmz
jesugmz / multi-cloud-docker-swarm.md
Last active January 2, 2024 18:40
Create a simple multi cloud Docker cluster using Docker Swarm, Docker Machine and the three top cloud providers nowadays - Google Compute Engine, Microsoft Azure and AWS

Simple multi cloud Docker cluster using Docker Swarm

This guide explains how to create a simple multi cloud Docker cluster using Docker Swarm, Docker Machine and the three top cloud providers nowadays - Google Compute Engine, Microsoft Azure and AWS.

Prerequisites

This guide assumes you have a Linux host with Docker CE installed. If you are using Docker for Mac or Docker for Windows you can avoid the Docker Machine set up since it comes included.

Install Docker Machine