How To Install Git on Ubuntu 18.04


Step 1 — Update Default Packages

Logged into your Ubuntu 18.04 server as a sudo non-root user, first update your default packages.

  • sudo apt update

Step 2 — Install Git

  • sudo apt install git

Step 3 — Confirm Successful Installation

You can confirm that you have installed Git correctly by running this command and receiving output similar to the following:

  • git –version
Output
git version 2.17.1

Visual Studio Code – Keyboard shortcuts for Linux


General

Ctrl+Shift+P, F1 Show Command Palette
Ctrl+P Quick Open, Go to File…
Ctrl+Shift+N New window/instance
Ctrl+W Close window/instance
Ctrl+, User Settings
Ctrl+K Ctrl+S Keyboard Shortcuts

Basic editing

Ctrl+X Cut line (empty selection)
Ctrl+C Copy line (empty selection)
Alt+ ↓ / ↑ Move line down/up
Ctrl+Shift+K Delete line
Ctrl+Enter /
Ctrl+Shift+Enter
Insert line below/ above
Ctrl+Shift+\ Jump to matching bracket
Ctrl+] / Ctrl+[ Indent/Outdent line
Home / End Go to beginning/end of line
Ctrl+ Home / End Go to beginning/end of file
Ctrl+ ↑ / ↓ Scroll line up/down
Alt+ PgUp / PgDn Scroll page up/down
Ctrl+Shift+ [ / ] Fold/unfold region
Ctrl+K Ctrl+ [ / ] Fold/unfold all subregions
Ctrl+K Ctrl+0 /
Ctrl+K Ctrl+J
Fold/Unfold all regions
Ctrl+K Ctrl+C Add line comment
Ctrl+K Ctrl+U Remove line comment
Ctrl+/ Toggle line comment
Ctrl+Shift+A Toggle block comment
Alt+Z Toggle word wrap

Rich languages editing

Ctrl+Space Trigger suggestion
Ctrl+Shift+Space Trigger parameter hints
Ctrl+Shift+I Format document
Ctrl+K Ctrl+F Format selection
F12 Go to Definition
Ctrl+Shift+F10 Peek Definition
Ctrl+K F12 Open Definition to the side
Ctrl+. Quick Fix
Shift+F12 Show References
F2 Rename Symbol
Ctrl+K Ctrl+X Trim trailing whitespace
Ctrl+K M Change file language

Multi-cursor and selection

Alt+Click Insert cursor*
Shift+Alt+ ↑ / ↓ Insert cursor above/below
Ctrl+U Undo last cursor operation
Shift+Alt+I Insert cursor at end of each line selected
Ctrl+L Select current line
Ctrl+Shift+L Select all occurrences of current selection
Ctrl+F2 Select all occurrences of current word
Shift+Alt + → Expand selection
Shift+Alt + ← Shrink selection
Shift+Alt + drag mouse Column (box) selection

Display

F11 Toggle full screen
Shift+Alt+0 Toggle editor layout (horizontal/vertical)
Ctrl+ = / – Zoom in/out
Ctrl+B Toggle Sidebar visibility
Ctrl+Shift+E Show Explorer / Toggle focus
Ctrl+Shift+F Show Search
Ctrl+Shift+G Show Source Control
Ctrl+Shift+D Show Debug
Ctrl+Shift+X Show Extensions
Ctrl+Shift+H Replace in files
Ctrl+Shift+J Toggle Search details
Ctrl+Shift+C Open new command prompt/terminal
Ctrl+K Ctrl+H Show Output panel
Ctrl+Shift+V Open Markdown preview
Ctrl+K V Open Markdown preview to the side
Ctrl+K Z Zen Mode (Esc Esc to exit)

Search and replace

Ctrl+F Find
Ctrl+H Replace
F3 / Shift+F3 Find next/previous
Alt+Enter Select all occurrences of Find match
Ctrl+D Add selection to next Find match
Ctrl+K Ctrl+D Move last selection to next Find match
Navigation
Ctrl+T Show all Symbols
Ctrl+G Go to Line…
Ctrl+P Go to File…
Ctrl+Shift+O Go to Symbol…
Ctrl+Shift+M Show Problems panel
F8 Go to next error or warning
Shift+F8 Go to previous error or warning
Ctrl+Shift+Tab Navigate editor group history
Ctrl+Alt+- Go back
Ctrl+Shift+- Go forward
Ctrl+M Toggle Tab moves focus

Editor management

Ctrl+W Close editor
Ctrl+K F Close folder
Ctrl+\ Split editor
Ctrl+ 1 / 2 / 3 Focus into 1
st, 2nd, 3rd editor group
Ctrl+K Ctrl + ← Focus into previous editor group
Ctrl+K Ctrl + → Focus into next editor group
Ctrl+Shift+PgUp Move editor left
Ctrl+Shift+PgDn Move editor right
Ctrl+K ← Move active editor group left/up
Ctrl+K → Move active editor group right/down

File management

Ctrl+N New File
Ctrl+O Open File…
Ctrl+S Save
Ctrl+Shift+S Save As…
Ctrl+W Close
Ctrl+K Ctrl+W Close All
Ctrl+Shift+T Reopen closed editor
Ctrl+K Enter Keep preview mode editor open
Ctrl+Tab Open next
Ctrl+Shift+Tab Open previous
Ctrl+K P Copy path of active file
Ctrl+K R Reveal active file in Explorer
Ctrl+K O Show active file in new window/instance

Debug

F9 Toggle breakpoint
F5 Start / Continue
F11 / Shift+F11 Step into/out
F10 Step over
Shift+F5 Stop
Ctrl+K Ctrl+I Show hover
Integrated terminal
Ctrl+` Show integrated terminal
Ctrl+Shift+` Create new terminal
Ctrl+Shift+C Copy selection
Ctrl+Shift+V Paste into active terminal
Ctrl+Shift+ ↑ / ↓ Scroll up/down
Shift+ PgUp / PgDn Scroll page up/down
Shift+ Home / End Scroll to top/bottom

Download Visual Studio Code Cheet Sheet : https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf

How to install Ansible


 

root@aryan-VirtualBox:~# apt-add-repository ppa:ansible/ansible
Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.

http://ansible.com/
More info: https://launchpad.net/~ansible/+archive/ubuntu/ansible
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://ca.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://ca.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://ca.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]

 

root@aryan-VirtualBox:~# apt-get install ansible
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
python-httplib2 python-jinja2 python-markupsafe python-paramiko
python-pyasn1 python-yaml sshpass
Suggested packages:
python-jinja2-doc python-gssapi
The following NEW packages will be installed:
ansible python-httplib2 python-jinja2 python-markupsafe python-paramiko
python-pyasn1 python-yaml sshpass
0 upgraded, 8 newly installed, 0 to remove and 10 not upgraded.
Need to get 4,369 kB of archives.
After this operation, 36.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]

provider.docker: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket


provider.docker: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/_ping: dial unix /var/run/docker.sock: connect: permission denied

 

aryan@aryan-VirtualBox:~/docker$ terraform plan
Refreshing Terraform state in-memory prior to plan…
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
————————————————————————

Error: Error running plan: 1 error(s) occurred:

* provider.docker: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/_ping: dial unix /var/run/docker.sock: connect: permission denied
aryan@aryan-VirtualBox:~/docker$

try it with sudo command

aryan@aryan-VirtualBox:~/docker$ sudo terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:

+ docker_image.image_id
id: <computed>
latest: <computed>
name: “ghost:latest”
Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only ‘yes’ will be accepted to approve.

Enter a value: yes

docker_image.image_id: Creating…
latest: “” => “<computed>”
name: “” => “ghost:latest”
docker_image.image_id: Still creating… (10s elapsed)
docker_image.image_id: Still creating… (20s elapsed)
docker_image.image_id: Creation complete after 20s (ID: sha256:f32905852788d222be7b05357a906cf9…2f50b7cea5a0ecf229d892d9d9ghost:latest)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
aryan@aryan-VirtualBox:~/docker$

Steps to install terraform on Ubuntu / Ubuntu cloud server :


  1. Install unzip
    sudo apt-get install unzip
    
  2. Download latest version of the terraform
    wget https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip
    
  3. Extract the downloaded file archive
    unzip terraform_0.11.13_linux_amd64.zip
    
  4. Move the executable into a directory searched for executables
    sudo mv terraform /usr/local/bin/
    
  5. Run it
    terraform --version

 

aryan@aryan-VirtualBox:~$ sudo apt-get install unzip
[sudo] password for aryan:
Reading package lists… Done
Building dependency tree
Reading state information… Done
unzip is already the newest version (6.0-21ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
aryan@aryan-VirtualBox:~$ wget https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip
–2019-05-03 11:59:38– https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip
Resolving releases.hashicorp.com (releases.hashicorp.com)… 151.101.1.183, 151.101.193.183, 151.101.129.183, …
Connecting to releases.hashicorp.com (releases.hashicorp.com)|151.101.1.183|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 21128942 (20M) [application/zip]
Saving to: ‘terraform_0.11.13_linux_amd64.zip’

terraform_0.11.13_l 100%[===================>] 20.15M 69.3MB/s in 0.3s

2019-05-03 11:59:38 (69.3 MB/s) – ‘terraform_0.11.13_linux_amd64.zip’ saved [21128942/21128942]

aryan@aryan-VirtualBox:~$ unzip terraform_0.11.13_linux_amd64.zip
Archive: terraform_0.11.13_linux_amd64.zip
inflating: terraform
aryan@aryan-VirtualBox:~$ sudo mv terraform /usr/local/bin/
aryan@aryan-VirtualBox:~$ terraform –version
Terraform v0.11.13