Skip to content

Instantly share code, notes, and snippets.

View samirfor's full-sized avatar

Samir C. Costa samirfor

  • Brazil
  • 08:05 (UTC -03:00)
View GitHub Profile
@samirfor
samirfor / zero_downtime_deploy.sh
Created September 1, 2023 22:28
Simple, zero-downtime deploys with nginx and docker-compose
#!/bin/bash
# Simple, zero-downtime deploys with nginx and docker-compose
# Thanks to Stephen O'Brien, Head of Product, Tines
# Source: https://www.tines.com/blog/simple-zero-downtime-deploys-with-nginx-and-docker-compose
set -e
set -x
compose_yml="${1:-docker-compose.yml}"
@samirfor
samirfor / revoke_pgsql_user.md
Last active January 19, 2024 13:16
Revoke a user on PostgreSQL
DBNAME=# \du
                                    List of roles
  Role name  |                         Attributes                         | Member of
-------------+------------------------------------------------------------+-----------
 user        |                                                            | {}
 postgres    | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 dbuser      |                                                            | {}

DBNAME=# REASSIGN OWNED BY dbuser TO postgres;
@samirfor
samirfor / reload_galileu.js
Created April 1, 2025 13:53
Reload Galileu
// ==UserScript==
// @name Reload Galileu
// @namespace http://tampermonkey.net/
// @version 2025-03-12
// @description try to take over the world!
// @author Samir
// @match https://galileu.pefoce.ce.gov.br/pages/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=gov.br
// @grant none
// ==/UserScript==