Skip to content

Instantly share code, notes, and snippets.

@gregoiredx
gregoiredx / default.conf.template
Last active September 2, 2022 14:33
Nginx configured as a third party internal gateway proxy with cache
# To be use with https://hub.docker.com/_/nginx or https://hub.docker.com/r/nginxinc/nginx-unprivileged
# COPY this file to /etc/nginx/templates/default.conf.template
# For env var substitution, see "Using environment variables in nginx configuration" at https://hub.docker.com/_/nginx
# Example values:
# environment:
# - CACHE_FILES_PATH=/mnt/cache
# - CACHE_FILES_MAX_SIZE=1g
# - CACHE_MEMORY_SIZE=10m
# - CACHE_VALID_TIME=1m
import pika
from pika import spec
from pika.adapters.blocking_connection import BlockingChannel
from lib import connection
class Consumer:
def __init__(self, channel: BlockingChannel, queue: str):
self.channel = channel
@gregoiredx
gregoiredx / bind_events.py
Created June 13, 2022 09:58
bind system events and traces to queues
"""
This requires the following server conf:
rabbitmq-plugins enable rabbitmq_event_exchange
rabbitmq-plugins enable rabbitmq_tracing
rabbitmqctl trace_on
"""
from lib import channel, connection
channel.queue_declare(
// ==UserScript==
// @name autocomplete
// @namespace https://*
// @include https://*
// ==/UserScript==
for(var i=0; i< document.forms.length; i++){
document.forms[i].autocomplete = "on";
for(var j=0; j< document.forms[i].elements.length; j++){
document.forms[i].elements[j].autocomplete = "on";