Skip to content

gabrielvsantana/dev-productivity-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

$ dev-productivity

dev-productivity


Table of Contents

  1. Softwares I Use
  2. Setup a Quick Postgres DB with Docker
  3. Set SSH for Multiple Accounts
    1. Generate SSH
    2. Copy SSH To Hosting Services
    3. Create SSH Config File
    4. Add SSH
    5. Remove SSH
    6. Git Config and Workflow
    7. Clone Repository
    8. Check the Git User Email Inside the Repository
  4. For More Dev Notes

Softwares I Use

  • Postman
  • iTerm2 with ZSH
  • Simplenote
  • pgAdmin
  • Docker
  • VSCode
    • Font - FiraCode
    • Theme - Retreon Color Theme
    • Prettier
    • Rainbow Brackets
    • Material Icon Theme
    • Indent Rainbow
    • ESLint
    • Live share
    • Git Lens

Setup a Quick Postgres DB with Docker

docker run --name <db-name> -e POSTGRES_PASSWORD=admin -p 5432:5432 -d postgres

Set SSH for Multiple Accounts

Generate SSH

$ ssh-keygen -t ed25519 -C "[email protected]"
$ ssh-keygen -t ed25519 -C "[email protected]"

You should check if ed25519 is still the most recommended algorithm.

Copy SSH to Hosting Services

Copy output from each key using:

$ cat ~/.ssh/<your_geenrated_ssh_key>.pub

Create SSH Config File

Create file:

$ touch ~/.ssh/config

Open file with VSCode:

$ code ~/.ssh/config

Paste configuration

~/.ssh/config

Host work
  AddKeysToAgent yes
  HostName <work_host_name>
  User <work_user_name>
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/<work_key>
  Port <port_number>

Host personal
  AddKeysToAgent yes
  HostName <personal_host_name>
  User <personal_user_name>
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/<personal_key>
  Port <port_number>

Or

$ echo "Host work
  AddKeysToAgent yes
  HostName <work_host_name>
  User <work_user_name>
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/<work_key>
  Port <port_number>

Host personal
  AddKeysToAgent yes
  HostName <personal_host_name>
  User <personal_user_name>
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/<personal_key>
  Port <port_number>" > ~/.ssh/config

Add SSH

$ ssh-add <ssh_key_name>

Remove SSH

In case you need to remove it, you can do:

$ ssh-add -D
$ rm -rf ~/.ssh/*

Git Config and Workflow

You should create a root folder called repos, and inside of it, create two new folders.

  • work - This folder you'll have all your work repositories
  • personal - This folder you'll have all your personal repositories

Edit your git config file, and create two new ones for each of the folders above.

~/.gitconfig

[includeIf "gitdir:~/repos/work/"]
    path = ~/repos/work/.gitconfig
[includeIf "gitdir:~/repos/personal/"]
    path = ~/repos/personal/.gitconfig

~/repos/work/.gitconfig

[user]
	email = [email protected]
	name = Your Name

~/repos/personal/.gitconfig

[user]
	email = [email protected]
	name = Your Name

Clone Repository

To clone any repository now, public or private, use this command:

git clone git@<your_host_name>:<remote_repository_name>

Example

If the git repository tells you to clone like this: [email protected]:nodejs/node.git

You should use this command instead:

git clone git@work:nodejs/node.git

or

git clone git@personal:nodejs/node.git

Check the Git User Email Inside the Repository

$ git config --show-origin --get user.email

For More Dev Notes

This is just one piece of my open personal notes collection, where I'm mapping out all my knowledge. If you're keen on checking out other topics, give this a click: official dev-notes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published