Friday 8 September 2017

Multiple SSH Keys settings for different github accounts

Say you have two keys. Add these two keys as following to ssh agent running on your local machine:

 $ ssh-add ~/.ssh/id_rsa_hacker
 $ ssh-add ~/.ssh/id_rsa_exchan

You can check your saved keys

 $ ssh-add -l

Sample ssh config settings, uses aliases in first line of blocks

 Host github-hacker
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_hacker

 Host github-exchan
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_exchan

then use normal flow to push your code

git clone git@github.com:hacker/myrepo.git

set remote host from the default (github.com) to match alias in the ssh config

git remote set-url origin git@github-hacker:hacker/myrepo.git
you can see the change in .git/config file if you look carefully
git add .
git commit -m "your comments" git push

Monday 4 September 2017

Docker training on Mac, 001


Take these steps, and, afterwards, try to understand how and why they worked, including flags/options "passed into" the command.
  • install Docker for Mac
    • verify install
      • docker --version
    • run basic container test
      • docker run hello-world
  • install iTerm2
    • open a terminal window and split horizontally, then close
    • open a terminal window and split vertically, then close
  • run webserver
    • open a terminal window and split horizontal
    • in bottom pane, run: 
      • watch -d -n7 docker ps -a
      • as you take steps below, watch what changes occur in this window
    • in top window, run:
      • docker run -d -p 8080:80 --name mywebserver001 nginx
    • open this in your web browser
      • http://localhost:8080
  • shut it down
    • docker stop mywebserver001
    • docker rm mywebserver001

Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...