Skip to content

Instantly share code, notes, and snippets.

View davorpa's full-sized avatar
🧑‍💻
Learn, Code, Enjoy, Repeat

David Ordás davorpa

🧑‍💻
Learn, Code, Enjoy, Repeat
View GitHub Profile
@davorpa
davorpa / gpg_git_signing.md
Created September 3, 2021 04:18 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@davorpa
davorpa / git-pushing-multiple.rst
Created July 26, 2021 01:05 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

1- Creamos el par, seleccionamos 0
gpg --gen-key
2- Listamos las claves
gpg --list-keys
Tambien las secretas, con su fingerprint:
gpg --list-secret-keys --fingerprint
3- Podemos exportar a un fichero la clave pública
gpg --armor --export marge@aplawrence.com > mypk
así como también la secreta:
gpg --export-secret-key -a "User Name" > private.key

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
//Referred link https://www.lunchbadger.com/tracking-the-performance-of-express-js-routes-and-middleware/
var express = require('express')
var uuid = require('uuid')
const bodyParser = require('body-parser');
const {
EventEmitter
} = require('events');
const profiles = new EventEmitter();