

======Notepad++  and atom.io  editors =========================================================
Notepad++   
https://notepad-plus-plus.org/download

install atom.io editor  and  language-puppet  package
??install software from atom.io, then on git command line
$ apm install language-puppet
Installing language-puppet to C:\Users\Admin\.atom\packages done

`====putty download=============================================================================
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

http://cmder.net/   (for ssh on windows )
https://git-scm.com/downloads   ==(can use  git like putty )
===============================================

setting up Vagrant for chef and package a vagrant box
https://gist.github.com/dergachev/3866825

Setting Up Vagrant Environment on Windows Platform
https://github.com/saasbook/courseware/wiki/Setting-Up-Vagrant-Environment-on-Windows-Platform

===Vagrant  ========================================================
https://www.vagrantup.com/downloads.html
   download windows 64 bit vagrant and install 

install virtualbox  for windows
	http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html
	https://www.virtualbox.org/wiki/Downloads
install git  ==(details later below )
Install  vagrant  

open  git-bash  on c:\bobtk
cd /c/bobtk/sparkvm/
vagrant version
vagrant init

vagrant list-commands
vagrant box add ADDRESS

vagrant box list
vagrant box prune
     This command removes old versions of installed boxes. 
vagrant box remove NAME
--all - Remove all available versions of a box.
--force - Forces removing the box even if an active Vagrant environment is using it.
--provider VALUE - The provider-specific box to remove with the given name. 	 
vagrant box update
--box VALUE - Name of a specific box to update. If this flag is not specified, Vagrant will update the boxes for the active Vagrant environment.
--provider VALUE - When --box is present, this controls what provider-specific box to update. 

vagrant up
vagrant halt
vagrant destroy
vagrant status

==== download  vagrant images from vagrantcloud.com
==== to download  OS iamges/box  to vargrant
 vagrant box add precise64 http://files.vagrantup.com/precise64.box # 323MB, faster download
 vagrant box add "centos/7"
 vagrant box add "ubuntu/xenial64"

vagrant up puppetmaster
vagrant halt puppetmaster 

$vagrant up puppetmaster
$vagrant up puppet-agent-centos
$vagrant up puppet-agent-ubuntu 

$ vagrant status
Current machine states:
puppetmaster              running (virtualbox)
puppet-agent-centos       running (virtualbox)
puppet-agent-ubuntu       running (virtualbox)

vagrant ssh puppetmaster 
vagrant ssh puppet-agent-centos
vagrant ssh puppet-agent-ubuntu
====== Setting to login with ip address===============================
# to enable to login with ip address   user/pass = vagrant/vagrant
ip addr show
vi /etc/ssh/sshd_config
PasswordAuthentication yes
systemctl restart sshd
===================================================
====to pre download the boxes ======================================
$ vagrant box add  centos/7
==> box: Loading metadata for box 'centos/7'
    box: URL: https://vagrantcloud.com/centos/7
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.
1) hyperv
2) libvirt
3) virtualbox
4) vmware_desktop

$ vagrant box add ubuntu/xenial64 

----vagrant file entry for multiple vms ----------
$ vi Vagrantfile
Vagrant.configure("2") do |config|
    config.vm.provider "virtualbox" do |v|
		v.memory = 1800
		v.cpus = 1
	end
# make sure vm ips  different from LAN ips of other devicesa
	config.vm.define "puppetmaster" do |pm|
		pm.vm.box = "centos/7"
		pm.vm.network "private_network",ip: "192.168.2.161"
		pm.vm.hostname = "puppetmaster"
	end
	config.vm.define "puppet-agent-centos" do |pac|
		 pac.vm.box = "centos/7"
		 pac.vm.network "private_network",ip: "192.168.2.162"
		 pac.vm.hostname = "centos-agent"
	end
	config.vm.define "puppet-agent-ubuntu" do |pau|
		 pau.vm.box = "ubuntu/xenial64"
		 pau.vm.network "private_network",ip: "192.168.2.163"
		 pau.vm.hostname = "ubuntu-agent"
	end
end
--------------------------------------------------------------
#to make vms with different cpus & memory

Vagrant.configure("2") do |config|
# make sure vm ips  different from LAN ips of other devicesa
        config.vm.define "puppetmaster" do |pm|
                pm.vm.box = "centos/7"
                pm.vm.network "private_network",ip: "192.168.2.161"
                pm.vm.hostname = "puppetmaster"
                pm.vm.provider "virtualbox" do |vpm|
                        vpm.memory = 2048
                        vpm.cpus = 2
                end
        end
        config.vm.define "puppet-agent-centos" do |pac|
                pac.vm.box = "centos/7"
                pac.vm.network "private_network",ip: "192.168.2.162"
                pac.vm.hostname = "centos-agent"
                pac.vm.provider "virtualbox" do |vpac|
                        vpac.memory = 1800
                        vpac.cpus = 1
                end
        end
        config.vm.define "puppet-agent-ubuntu" do |pau|
                pau.vm.box = "ubuntu/xenial64"
                pau.vm.network "private_network",ip: "192.168.2.163"
                pau.vm.hostname = "ubuntu-agent"
                pau.vm.provider "virtualbox" do |vpau|
                        vpau.memory = 1750
                        vpau.cpus = 1
                end
        end
end

--------------------------------------------------

====git installation section======================================================================
===download and install Git-2.18.0-64-bit 
https://git-scm.com/downloads      ==(download from here)
during installation select 
"Use Git and optional Unix tools from the windows Command prompt"
then launch git bash  
start->git->git bash

-create a folder -> right click on it -> Git bash here
   touch index.html
   touch app.py
    git init
    git config --global user.name  "lenov lap"
    git config --global user.email "sjbuy25@gmail.com"
    git add  
    git index.html
    git *.html
    git status
    git rm --cached index.html
    git status
    git add .
vi index.html  (add  some text)
git commit -m 'changed  index.html'

git branch login
$ git checkout login
Switched to branch 'login'
git status
touch login.html ( add some text)
git add .
git status
git commit -m 'login form'
git checkout master
git branch   -->  to see  what branch on now 
git merge login -m 'merging the login branch'
=====git with github===
on github.com create a repo 'Gitapp1'
echo "# Gitapp1" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/sjcode236/Gitapp1.git
git push -u origin master

mkdir dir1
mkdir dir2
git commit -m "adding dir1 dir2"
git push
Now all the files will be on github.come
make a change to index.html  on github then
git pull -> will update all local file

to clone 
git clone https://github.com/sjcode236/Gitapp1.git
---------------------------------------
===install git on centos linux =====
yum install git
git --version
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --list
	user.name=Your Name
	user.email=you@example.com

# Set the cache to timeout after 1 hour (setting is in seconds)
git config --global credential.helper 'cache --timeout=3600'
git push origin master 


====================================
***TO see all branches
git branch --all

***TO see on which branch  now checkout to
[root@puppetmaster envAnirban2]# git branch
  master
  production
  staging
* test

***To delete  remote branch at  github  
git push origin --delete  staging    
 
***Deleting a local branch:
git branch --delete <branch>
git branch -d <branch> # Shorter version
git branch -D <branch> # Force delete un-merged branches
***Deleting a local remote-tracking branch:
git branch --delete --remotes <remote>/<branch>
git branch -rd <remote>/<branch> # Shorter
git branch -rd  origin/staging

git fetch <remote> --prune # Delete multiple obsolete tracking branches
git fetch <remote> -p      # Shorter
***Note that this removes all obsolete local remote-tracking branches for any remote branches that no longer exist on the remote:

 

