Skip to content

Instantly share code, notes, and snippets.

View douglasmiranda's full-sized avatar
👽

Douglas Miranda douglasmiranda

👽
  • Earth, Brazil
View GitHub Profile
- https://github.com/thumbor/thumbor
- https://github.com/thumbor-community/aws
- https://github.com/Starou/django-thumborstorage
- https://github.com/ricobl/django-thumbor
@douglasmiranda
douglasmiranda / ansible.md
Last active September 12, 2021 15:13
Ansible: Notes, Errors and Solutions

Ansible for Configuration Management

I'm using Ansible only for Configuration Management, the server is up and I want to configure users, install packages and configure them.

For infrastructure provisioning terraform.io is nice!

Currently, my deployment flow includes Drone.io/GitlabCI for CI/CD and Docker Swarm for orchestrating containers.

@douglasmiranda
douglasmiranda / answer.md
Last active December 8, 2018 19:50
Can I retrieve user's IP address in docker swarm mode?

Answer: "NO" (2018-12-08)

When you're running your service on a container as a node of Docker Swarm, you're gonna get the IP of the ingress network gateway, not the user's IP.

Of course there's solutions, not an ideal one, but workarounds with each tool you're using. (Nginx, Caddy, Traefik..)

Related links:

@douglasmiranda
douglasmiranda / drone.md
Created November 26, 2018 22:59
Status: how Drone deals with monorepo; dir/file changed conditions

Well there's no builtin way of doing.

The problem is:

We need a way of skipping steps, or conditional pipelines that are triggered when some dir/* files.* were changed since last commit.

Useful if you maintain a:

  • Monorepo
@douglasmiranda
douglasmiranda / django-media-permissions.md
Last active May 16, 2023 10:33
Fix Django Media Folder Permissions

Check your current file/directory permission with:

stat -c "%a" /path/to/dir_or_file

To recursively give directories read&execute privileges:

find /path/to/base/dir -type d -exec chmod 755 {} +
@douglasmiranda
douglasmiranda / notes.md
Last active July 23, 2018 03:13
Notes about CI/CD + Private Container Registry
@douglasmiranda
douglasmiranda / install.md
Last active January 22, 2019 20:30
Debian Stretch + Docker (PT-BR) (Digital Ocean)

Debian Stretch + Docker

Setup replicado na Digital Ocean e CloudCone, mas funciona basicamente da mesma forma em qualquer server com Debian Stretch + acesso root por ssh.

Resumo:

  • vamos criar um usuário comum do sistema, permitir que ele execute comandos sudo (requisitando senha)
  • vamos conectar ao servidor com ssh com o novo usuário, com acesso a partir de chave pública e desabilitar acesso ssh com senha, bem como acesso ssh do root direto
  • configurar um simples firewall
  • instalar Docker e executá-lo sem o sudo
  • No fim há um tópico "Possíveis erros", então ao se deparar com erros, visite essa seção
@douglasmiranda
douglasmiranda / solution.md
Created July 19, 2018 06:01
Drone agent loses connection when deployed with Docker Swarm

Solution:

In your Drone server set the environment variable:

DRONE_KEEPALIVE_MIN_TIME: 5s

In your Drone agent set the environment variables:

@douglasmiranda
douglasmiranda / instructions.md
Created July 19, 2018 05:51
Add email to Keybase.io PGP Key (Public Key)

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret > keybase-private.key