Skip to content

Instantly share code, notes, and snippets.


Alexandre Fogaça Duarte duartealexf

View GitHub Profile
View gist:22b418c18130e1ab2aa216e1d2335039
$ git remote -v
origin (fetch)
origin (push)
another (fetch)
another (push)
$ git fetch another
$ git checkout -b another/master -t another/master
duartealexf /
Created Sep 16, 2019
apache virtualhost config for
<VirtualHost *:80>
DocumentRoot /var/www/example
RewriteEngine on
RewriteCond %{SERVER_NAME} [OR]
RewriteCond %{SERVER_NAME}
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,QSA,R=permanent]
duartealexf /
Created Jan 12, 2018
Creating a SSH key and adding to agent.
  1. Open terminal.
  2. Enter the command below, replacing with your email:
$ ssh-keygen -t rsa -b 4096 -C "" -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 /
Created Jan 12, 2018
Differences in git user and repos SSH Keys

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” ( 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 / mongo-3.6.conf
Last active Nov 13, 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;