Skip to content

Instantly share code, notes, and snippets.

@zombig
zombig / DockerNetwork.md
Last active December 13, 2024 11:11
Short how to about my current windows environment

Docker Network (VM)

Configure Docker daemon

 sudo cat << EOF > /etc/docker/daemon.json
{
  "bip": "192.168.100.1/24",
  "mtu": 1500,
 "default-address-pools":[
@zombig
zombig / Makefile
Created August 10, 2023 07:13 — forked from mcspring/Makefile
Static build of nginx with custom openssl, pcre and zlib
# Author: Eric Pruitt (http://www.codevat.com)
# License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
# Description: This Makefile is designed to create a statically linked nginx
# binary without any dependencies on the host system's version of glibc.
NGINX_VERSION=1.15.0
OPENSSL_VERSION=1.0.2o
PCRE_VERSION=8.42
ZLIB_VERSION=1.2.11
@zombig
zombig / gist:21e24220cd5d5915cd194946cdc7061b
Last active June 23, 2023 14:26 — forked from hgross/gist:26042d052f58feeb6d1b329e8dd2dfcc
Change docker_gwbridge subnet address
## Do this on each swarm-node
# store containers attached to the bridge
gwbridge_users=$(docker network inspect --format '{{range $key, $val := .Containers}} {{$key}}{{end}}' docker_gwbridge | xargs -d' ' -I {} -n1 docker ps --format {{.Names}} -f id={})
# stop all containers
# if you have stacks that restart automatically, remove them via docker stack <stackName> rm
echo "$gwbridge_users" | xargs docker stop
docker network rm docker_gwbridge
docker network disconnect -f docker_gwbridge ingress
docker network rm docker_gwbridge
@zombig
zombig / LetMeGoogleThatForYou.js
Created June 2, 2023 13:50 — forked from brianhanifin/LetMeGoogleThatForYou.js
Let Me Google That For You (LMGTFY)
CmdUtils.CreateCommand({
name: "lmgtfy",
synonyms: ["letmegooglethatforyou"],
takes: {"words to google": noun_arb_text},
icon: "http://letmegooglethatforyou.com/favicon.ico",
description: "Replaces the selected words with a <a href=\"http://www.tinyurl.com\">TinyUrl</a> of the <a href=\"\">Let Me Google That For You</a> link",
preview: function( pblock, urlToShorten ){
pblock.innerHTML = "Replaces the selected URL with a tiny LMGTFY url.";
var baseUrl = "http://tinyurl.com/api-create.php?url=http://letmegooglethatforyou.com/?q=";
pblock.innerHTML = "Replaces the selected URL with ",
@zombig
zombig / mongo-docker-compose.yml
Created April 13, 2022 09:16 — forked from gbzarelli/mongo-docker-compose.yml
Initializing mongo db in docker-compose with init script
version: '3.8'
services:
# Database - Mongo DB
mongo:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: helpdev
MONGO_INITDB_ROOT_PASSWORD: 123456
@zombig
zombig / delete-from-v2-docker-registry.md
Created February 14, 2022 13:03 — forked from jaytaylor/delete-from-v2-docker-registry.md
One liner for deleting images from a v2 docker registry

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
    curl -sSL -I \
        -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
@zombig
zombig / pipe_to_docker_examples
Created September 9, 2021 22:02 — forked from ElijahLynn/pipe_to_docker_examples
How to pipe to `docker exec` examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt`
#2a Pipe by piping
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash -
@zombig
zombig / README.md
Created June 4, 2021 14:50 — forked from warmfusion/README.md
Notes from building ETCD / Confd / Haproxy autoconfiguration environment

The following documents a trial of using etcd, and confd to automatically configure a haproxy load balancer.

It is built using a combination of blogs, resources and experimentation, but provides a rough template of the approach that would allow a fully featured balancer to be configured from etcd keyvalues.

TODO

  • Include systemd sidekick unit to automatically register the key's into ETCD based on a docker service (for example) being started
  • A more complete haproxy template that builds a valid, complex haproxy that would be capable of dealing with Future PLC's balancer requirements
# -*- coding: utf-8 -*-
import socket
import os
print("Connecting...")
if os.path.exists("/tmp/python_unix_sockets_example"):
client = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
client.connect("/tmp/python_unix_sockets_example")
print("Ready.")
print("Ctrl-C to quit.")
@zombig
zombig / zram
Created April 1, 2021 14:46 — forked from oliviertoupin/zram
ZRam on Centos
#!/bin/bash
### BEGIN INIT INFO
# Provides: zram
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Virtual Swap Compressed in RAM
# Description: Virtual Swap Compressed in RAM
### END INIT INFO