Skip to content

Instantly share code, notes, and snippets.

View avandrevitor's full-sized avatar
😎
A mind that opens up to a new idea never returns to its original size

André Vitor Cuba de Miranda avandrevitor

😎
A mind that opens up to a new idea never returns to its original size
View GitHub Profile
@avandrevitor
avandrevitor / README.md
Created February 4, 2024 16:02
How to solve the problem of "not being able to use box centos/stream 9"

How to solve the problem of "not being able to use box centos/stream 9" ?

When performing a small proof of concept (POC), I decided to use a Vagrant box with CentOS Stream 9. Unfortunately, to my surprise, I encountered the same issue reported in this thread.

`$ vagrant up
Bringing machine 'machine' up with 'virtualbox' provider...
==> machine: Box 'centos/stream9' could not be found. Attempting to find and install...
 machine: Box Provider: virtualbox
@avandrevitor
avandrevitor / using-uuid-as-pk.md
Created February 25, 2021 20:04 — forked from rponte/using-uuid-as-pk.md
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@avandrevitor
avandrevitor / nginxproxy.md
Created September 25, 2019 18:02 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@avandrevitor
avandrevitor / Dockerfile
Created June 17, 2019 20:04
Docker PHP 7.2 Apache
FROM php:7.2.10-apache
LABEL maintainer='André Vitor Cuba de Miranda <[email protected]'
# Update and Download Packages Debian
RUN apt-get update --yes
# Install Dependencies
RUN apt-get install --yes \
autoconf \
@avandrevitor
avandrevitor / pre-receive.sh
Last active August 21, 2018 22:13
Bash Example Pre-Receive
#!/usr/bin/env bash
zero_commit="0000000000000000000000000000000000000000"
excludeExisting="--not --all"
while read oldrev newrev refname; do
echo $refname $oldrev $newrev
# branch or tag get deleted
if [ "$newrev" = "$zero_commit" ]; then
#!/usr/bin/env ruby
our_secret = "aaaa"
params = gets
oldref = params.split()[0]
newref = params.split()[1]
refname = params.split()[2]
@avandrevitor
avandrevitor / generate_docker_cert.sh
Created August 13, 2018 12:08 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@avandrevitor
avandrevitor / certificate-self-signed.sh
Created June 5, 2018 12:40
Certificado Auto Assinado
#!/bin/bash
openssl req \
--newkey rsa:4096 --nodes -sha256 -keyout certs/domain.key \
-x509 -days 365 -out certs/domain.crt
@avandrevitor
avandrevitor / Dockerfile
Created May 25, 2018 22:22
Docker PHP-5.6.35-CLI with Composer, Prestissimo and XDebug
FROM php:5.6.35-cli
LABEL maintainer='André Vitor Cuba de Miranda <[email protected]>'
# Update and Download Packages Debian
RUN apt-get update --yes
# Install Dependencies
RUN apt-get install --yes \
autoconf \
@avandrevitor
avandrevitor / find-with-cp.bash
Created May 23, 2018 02:43
Busca todos os arquivos com extensão mp4 na pasta atual e copia mantendo a hierarquia de pastas para o path /tmp/movies
#!/bin/bash
find . -name '*.mp4' -exec cp {} --parents /tmp/movies \;