Skip to content

Instantly share code, notes, and snippets.

@ferhatbostanci
ferhatbostanci / nginx.conf
Created February 17, 2021 15:37
Mailcatcher with Nginx Reverse Proxy
server {
location /mailcatcher {
proxy_pass http://127.0.0.1:1080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 1d;
sub_filter 'src="/' 'src="/mailcatcher/';
sub_filter 'href="/' 'href="/mailcatcher/';
sub_filter 'url(/' 'url(/mailcatcher/';
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active May 31, 2024 23:52
Docker Container Logging using Promtail
@kamermans
kamermans / php-error-logstash.conf
Last active July 31, 2023 11:31
Logstash parser for PHP's error_log to combine multline stack traces / errors into one event
input {
stdin {
codec => multiline {
pattern => "^\[%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME} %{TZ}\]"
negate => true
what => "previous"
auto_flush_interval => 10
}
type => "php-error"
}
@Richard-Mathie
Richard-Mathie / Redis Cluster Setup with Docker Swarm.md
Last active May 11, 2022 12:58
Redis cluster setup with docker swarm

Redis Cluster Setup with Docker Swarm

Setup

./redis.sh

Test

test the redis cluster

@mackensen
mackensen / .gitlab-ci.yml
Created November 14, 2016 15:49
Mocked up gitlab config for running selenium in a linked container
# Custom docker image which exposes 8080
image: lafayette/hoth:5.5
services:
- selenium/standalone-chrome:latest
before_script:
# Use 0.0.0.0 instead of localhost to allow external connections
- php -S 0.0.0.0:8080 -t ../ &> /dev/null &
@titpetric
titpetric / purge.lua
Created November 2, 2016 11:00
Delete NGINX cached items from a PURGE request
-- Tit Petric, Monotek d.o.o., Thu 27 Oct 2016 10:43:38 AM CEST
--
-- Delete nginx cached assets with a PURGE request against an endpoint
--
local md5 = require 'md5'
function file_exists(name)
local f = io.open(name, "r")
if f~=nil then io.close(f) return true else return false end
FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \
@LeonardoCardoso
LeonardoCardoso / gitzip.sh
Last active October 9, 2023 22:38
Zip folder ignoring files listed on .gitignore
#...
function gitzip() {
git archive -o $@.zip HEAD
}
#... gitzip ZIPPED_FILE_NAME
@fforbeck
fforbeck / configure_queues.sh
Created February 25, 2016 14:19
RabbitMQ - Command Line Setup. Create queue, bindings, exchanges with rabbitmqadmin and rabbitmqctl
#!/usr/bin/env bash
URL="http://localhost:15672/cli/rabbitmqadmin"
VHOST="<>"
USER="<>"
PWD="<>"
QUEUE="<>"
FAILED_QUEUE="<>"
@iamralch
iamralch / ssh_client.go
Last active April 16, 2023 03:09
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"