Skip to content

Instantly share code, notes, and snippets.

Alexandre Fogaça Duarte duartealexf

Block or report user

Report or block duartealexf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@duartealexf
duartealexf / example.com.conf
Created Sep 16, 2019
apache virtualhost config for prerender.io
View example.com.conf
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,QSA,R=permanent]
</VirtualHost>
@duartealexf
duartealexf / create-ssh-key.md
Created Jan 12, 2018
Creating a SSH key and adding to agent.
View create-ssh-key.md
  1. Open terminal.
  2. Enter the command below, replacing with your email:
$ ssh-keygen -t rsa -b 4096 -C "johndoe@example.com" -f <path to key>

The path to key should be in ~/.ssh directory, with a self-explanatory filename and no spaces.

  1. Type a password...
@duartealexf
duartealexf / differences.md
Created Jan 12, 2018
Differences in git user and repos SSH Keys
View differences.md

As we have a server and we have git repositories hosted in it, frequently we need to git pull and build projects. To pull, we need to have access to the git repository.

The current "logged in” git user in the server is, for example, “x-bot” (https://github.com/x-bot). It is part of the team and has access to the repositories the other users do.

Make sure you can login with the x-bot user.

As many deploys are automated, there is no opportunity to type the password, as there is no prompt. To “auto-authenticate” into github, we use a SSH key. It holds an identity and password combination. When you create a key, it is a good idea to keep the same password as in git. In git, not everyone needs to create a SSH key to prevent having to type username / password combination everytime they push or pull.

@duartealexf
duartealexf / mongo-3.6.conf
Last active Jun 12, 2019
Full configuration of mongod.conf and mongos.conf file.
View mongo-3.6.conf
# Full configuration of mongod and mongos file, based on MongoDB 3.6.
# Includes links for official docs, for each section of config.
#
# Are not mentioned in this document:
# - Deprecated options as of 3.6;
# - Options only available to mmapv1;
# - Windows Service Options;
#
# This document is divided as follows:
# - Options for both mongod and mongos;
You can’t perform that action at this time.