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 / 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 / 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 / composer-private-package-github-token.md
Created May 7, 2018 17:10 — forked from jeffersonmartin/composer-private-package-github-token.md
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

@avandrevitor
avandrevitor / find.repo.biggest.files
Created April 30, 2018 12:42 — forked from nmussat/find.repo.biggest.files
Find biggest files from a Git repository
#!/bin/bash
# Find biggest files from a Git repository
# See http://progit.org/book/ch9-7.html
MAX_FILES=20
LINES=`git verify-pack -v .git/objects/pack/pack-*.idx | grep blob | sort -k 3 -n | tail -${MAX_FILES}`
IFS=$'\n'
for LINE in $LINES
do
@avandrevitor
avandrevitor / gist:6d1fdf7a4e12ca506945208df11a97d6
Created January 13, 2018 15:54 — forked from rmetzler/gist:2947828
find all non UTF-8 encoded files
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail
@avandrevitor
avandrevitor / ca.md
Created December 26, 2017 12:12 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@avandrevitor
avandrevitor / Zsh & theme
Created September 20, 2017 17:07 — forked from leemour/Zsh & theme
Zsh installation and Agnoster theme settings
# Railscast
http://railscasts.com/episodes/308-oh-my-zsh
# Install Zsh
sudo apt-get update && sudo apt-get install zsh
# Install Oh-my-zsh
wget –no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | sh
# Make ZSH default shell
@avandrevitor
avandrevitor / .gitconfig
Created June 27, 2017 13:29 — forked from jvandyke/.gitconfig
Use PHPStorm/WebStorm for git diff and merge tools
# ~/.gitconfig
# Add this to your global git configuration file
# Change phpstorm to webstorm, if you use that.
# Diff and merge tool changes
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...`
[merge]
tool = phpstorm
[diff]
tool = phpstorm
@avandrevitor
avandrevitor / gist:72e7cbc147b4cc483f58d8411c1bef61
Created June 7, 2017 22:36 — forked from tonyoconnell/gist:2351492
Install Magento 1.8 With Sample Data By SSH
mkdir demo
cd demo
wget http://www.magentocommerce.com/downloads/assets/1.8.1.0/magento-1.8.1.0.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
tar -zxvf magento-1.8.1.0.tar.gz
tar -zxvf magento-sample-data-1.6.1.0.tar.gz
mv magento-sample-data-1.6.1.0/media/* magento/media/
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
mv magento/* magento/.htaccess .
chmod o+w var var/.htaccess app/etc